mirror of
git://git.sv.gnu.org/emacs.git
synced 2025-12-15 18:40:39 -08:00
Remove redundant 'function's around lambdas in mh/*.el
* lisp/mh-e/mh-alias.el (mh-alias-tstamp, mh-alias-filenames) (mh-alias-address-to-alias): * lisp/mh-e/mh-comp.el (mh-edit-again, mh-redistribute): * lisp/mh-e/mh-identity.el (mh-identity-make-menu): * lisp/mh-e/mh-utils.el (mh-help): Remove redundant 'function's around lambdas.
This commit is contained in:
parent
ab9a23e029
commit
68e57e0046
4 changed files with 73 additions and 80 deletions
|
|
@ -73,12 +73,11 @@ If ARG is non-nil, set timestamp with the current time."
|
|||
(setq mh-alias-tstamp (list (nth 0 time) (nth 1 time))))
|
||||
(let ((stamp))
|
||||
(car (memq t (mapcar
|
||||
(function
|
||||
(lambda (file)
|
||||
(when (and file (file-exists-p file))
|
||||
(setq stamp (file-attribute-modification-time
|
||||
(file-attributes file)))
|
||||
(time-less-p mh-alias-tstamp stamp))))
|
||||
(lambda (file)
|
||||
(when (and file (file-exists-p file))
|
||||
(setq stamp (file-attribute-modification-time
|
||||
(file-attributes file)))
|
||||
(time-less-p mh-alias-tstamp stamp)))
|
||||
(mh-alias-filenames t)))))))
|
||||
|
||||
(defun mh-alias-filenames (arg)
|
||||
|
|
@ -93,11 +92,10 @@ appended."
|
|||
(filelist (and filename (split-string filename "[ \t]+")))
|
||||
(userlist
|
||||
(mapcar
|
||||
(function
|
||||
(lambda (file)
|
||||
(if (and mh-user-path file
|
||||
(file-exists-p (expand-file-name file mh-user-path)))
|
||||
(expand-file-name file mh-user-path))))
|
||||
(lambda (file)
|
||||
(if (and mh-user-path file
|
||||
(file-exists-p (expand-file-name file mh-user-path)))
|
||||
(expand-file-name file mh-user-path)))
|
||||
filelist)))
|
||||
(if arg
|
||||
(if (stringp mh-alias-system-aliases)
|
||||
|
|
@ -466,12 +464,11 @@ set `mh-alias-insert-file' or the \"Aliasfile:\" profile component"))
|
|||
;; Double-check that we have an individual alias. This means that the
|
||||
;; alias doesn't expand into a list (of which this address is part).
|
||||
(car (delq nil (mapcar
|
||||
(function
|
||||
(lambda (alias)
|
||||
(let ((recurse (mh-alias-ali alias nil)))
|
||||
(if (string-match ".*,.*" recurse)
|
||||
nil
|
||||
alias))))
|
||||
(lambda (alias)
|
||||
(let ((recurse (mh-alias-ali alias nil)))
|
||||
(if (string-match ".*,.*" recurse)
|
||||
nil
|
||||
alias)))
|
||||
(split-string aliases ", +")))))))
|
||||
|
||||
;;;###mh-autoload
|
||||
|
|
|
|||
|
|
@ -435,43 +435,42 @@ See also `mh-send'."
|
|||
(mh-insert-header-separator)
|
||||
;; Merge in components
|
||||
(mh-mapc
|
||||
(function
|
||||
(lambda (header-field)
|
||||
(let ((field (car header-field))
|
||||
(value (cdr header-field))
|
||||
(case-fold-search t))
|
||||
(cond
|
||||
;; Address field
|
||||
((string-match field "^To$\\|^Cc$\\|^From$")
|
||||
(cond
|
||||
((not (mh-goto-header-field (concat field ":")))
|
||||
;; Header field does not exist, add it
|
||||
(mh-goto-header-end 0)
|
||||
(insert field ": " value "\n"))
|
||||
((string-equal value "")
|
||||
;; Header field already exists and no value
|
||||
)
|
||||
(t
|
||||
;; Header field exists and we have a value
|
||||
(let (address mailbox (alias (mh-alias-expand value)))
|
||||
(and alias
|
||||
(setq address (ietf-drums-parse-address alias))
|
||||
(setq mailbox (car address)))
|
||||
;; XXX - Need to parse all addresses out of field
|
||||
(if (and
|
||||
(not (mh-regexp-in-field-p
|
||||
(concat "\\b" (regexp-quote value) "\\b") field))
|
||||
mailbox
|
||||
(not (mh-regexp-in-field-p
|
||||
(concat "\\b" (regexp-quote mailbox) "\\b") field)))
|
||||
(insert " " value ","))
|
||||
))))
|
||||
((string-match field "^Fcc$")
|
||||
;; Folder reference
|
||||
(mh-modify-header-field field value))
|
||||
;; Text field, that's an easy case
|
||||
(t
|
||||
(mh-modify-header-field field value))))))
|
||||
(lambda (header-field)
|
||||
(let ((field (car header-field))
|
||||
(value (cdr header-field))
|
||||
(case-fold-search t))
|
||||
(cond
|
||||
;; Address field
|
||||
((string-match field "^To$\\|^Cc$\\|^From$")
|
||||
(cond
|
||||
((not (mh-goto-header-field (concat field ":")))
|
||||
;; Header field does not exist, add it
|
||||
(mh-goto-header-end 0)
|
||||
(insert field ": " value "\n"))
|
||||
((string-equal value "")
|
||||
;; Header field already exists and no value
|
||||
)
|
||||
(t
|
||||
;; Header field exists and we have a value
|
||||
(let (address mailbox (alias (mh-alias-expand value)))
|
||||
(and alias
|
||||
(setq address (ietf-drums-parse-address alias))
|
||||
(setq mailbox (car address)))
|
||||
;; XXX - Need to parse all addresses out of field
|
||||
(if (and
|
||||
(not (mh-regexp-in-field-p
|
||||
(concat "\\b" (regexp-quote value) "\\b") field))
|
||||
mailbox
|
||||
(not (mh-regexp-in-field-p
|
||||
(concat "\\b" (regexp-quote mailbox) "\\b") field)))
|
||||
(insert " " value ","))
|
||||
))))
|
||||
((string-match field "^Fcc$")
|
||||
;; Folder reference
|
||||
(mh-modify-header-field field value))
|
||||
;; Text field, that's an easy case
|
||||
(t
|
||||
(mh-modify-header-field field value)))))
|
||||
(mh-components-to-list components-file))
|
||||
(delete-file components-file)
|
||||
(goto-char (point-min))
|
||||
|
|
@ -700,25 +699,24 @@ message and scan line."
|
|||
;; trumping anything in the distcomps file.
|
||||
(let ((components-file (mh-bare-components mh-dist-formfile)))
|
||||
(mh-mapc
|
||||
(function
|
||||
(lambda (header-field)
|
||||
(let ((field (car header-field))
|
||||
(value (cdr header-field))
|
||||
(case-fold-search t))
|
||||
(cond
|
||||
((string-match field "^Resent-Fcc$")
|
||||
(setq comp-fcc value))
|
||||
((string-match field "^Resent-From$")
|
||||
(or from
|
||||
(setq from value)))
|
||||
((string-match field "^Resent-To$")
|
||||
(setq comp-to value))
|
||||
((string-match field "^Resent-Cc$")
|
||||
(setq comp-cc value))
|
||||
((string-match field "^Resent-Bcc$")
|
||||
(setq comp-bcc value))
|
||||
((string-match field "^Resent-.*$")
|
||||
(mh-insert-fields field value))))))
|
||||
(lambda (header-field)
|
||||
(let ((field (car header-field))
|
||||
(value (cdr header-field))
|
||||
(case-fold-search t))
|
||||
(cond
|
||||
((string-match field "^Resent-Fcc$")
|
||||
(setq comp-fcc value))
|
||||
((string-match field "^Resent-From$")
|
||||
(or from
|
||||
(setq from value)))
|
||||
((string-match field "^Resent-To$")
|
||||
(setq comp-to value))
|
||||
((string-match field "^Resent-Cc$")
|
||||
(setq comp-cc value))
|
||||
((string-match field "^Resent-Bcc$")
|
||||
(setq comp-bcc value))
|
||||
((string-match field "^Resent-.*$")
|
||||
(mh-insert-fields field value)))))
|
||||
(mh-components-to-list components-file))
|
||||
(delete-file components-file))
|
||||
(mh-insert-fields "Resent-To:" (mapconcat 'identity (list to comp-to) ", ")
|
||||
|
|
|
|||
|
|
@ -71,10 +71,9 @@ See `mh-identity-add-menu'."
|
|||
(mh-insert-auto-fields) mh-auto-fields-list]
|
||||
"--")
|
||||
|
||||
(mapcar (function
|
||||
(lambda (arg)
|
||||
`[,arg (mh-insert-identity ,arg) :style radio
|
||||
:selected (equal mh-identity-local ,arg)]))
|
||||
(mapcar (lambda (arg)
|
||||
`[,arg (mh-insert-identity ,arg) :style radio
|
||||
:selected (equal mh-identity-local ,arg)])
|
||||
(mapcar 'car mh-identity-list))
|
||||
'(["None"
|
||||
(mh-insert-identity "None") :style radio
|
||||
|
|
|
|||
|
|
@ -270,9 +270,8 @@ and displayed in a help buffer."
|
|||
(cdr (assoc nil (assoc major-mode mh-help-messages)))))
|
||||
(text (substitute-command-keys (mapconcat 'identity help ""))))
|
||||
(with-electric-help
|
||||
(function
|
||||
(lambda ()
|
||||
(insert text)))
|
||||
(lambda ()
|
||||
(insert text))
|
||||
mh-help-buffer)))
|
||||
|
||||
;;;###mh-autoload
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue