comparison lisp/mh-e/mh-alias.el @ 49578:b35587af8747

Upgraded to MH-E version 7.2. See etc/MH-E-NEWS and lisp/mh-e/ChangeLog for details.
author Bill Wohler <wohler@newt.com>
date Mon, 03 Feb 2003 20:55:30 +0000
parents 06b77df47802
children 0d8b17d428b5
comparison
equal deleted inserted replaced
49577:dad6f3184ccd 49578:b35587af8747
88 ;; ~~~~~~~~~~~~~~~~ 88 ;; ~~~~~~~~~~~~~~~~
89 ;; There are commands to insert new aliases into your alias file(s) (defined 89 ;; There are commands to insert new aliases into your alias file(s) (defined
90 ;; by the `Aliasfile' component in the .mh_profile file or by the variable 90 ;; by the `Aliasfile' component in the .mh_profile file or by the variable
91 ;; `mh-alias-insert-file'). In particular, there is a tool-bar icon to grab 91 ;; `mh-alias-insert-file'). In particular, there is a tool-bar icon to grab
92 ;; an alias from the From line of the current message. 92 ;; an alias from the From line of the current message.
93
94 ;;; Change Log:
95
96 ;; $Id: mh-alias.el,v 1.25 2003/01/27 04:16:47 wohler Exp $
93 97
94 ;;; Code: 98 ;;; Code:
95 99
96 (require 'mh-e) 100 (require 'mh-e)
97 (load "cmr" t t) ; Non-fatal dependency for 101 (load "cmr" t t) ; Non-fatal dependency for
281 (completing-read-multiple prompt mh-alias-alist nil nil)) 285 (completing-read-multiple prompt mh-alias-alist nil nil))
282 ((featurep 'multi-prompt) 286 ((featurep 'multi-prompt)
283 (multi-prompt "," nil prompt mh-alias-alist nil nil)) 287 (multi-prompt "," nil prompt mh-alias-alist nil nil))
284 (t 288 (t
285 (split-string 289 (split-string
286 (completing-read "To: " mh-alias-alist nil nil) 290 (completing-read prompt mh-alias-alist nil nil)
287 ",")))))) 291 ","))))))
288 (if (not mh-alias-expand-aliases-flag) 292 (if (not mh-alias-expand-aliases-flag)
289 (mapconcat 'identity the-answer ", ") 293 (mapconcat 'identity the-answer ", ")
290 ;; Loop over all elements, checking if in passwd aliast or blind first 294 ;; Loop over all elements, checking if in passwd aliast or blind first
291 (mapconcat 'mh-alias-expand the-answer ",\n "))))) 295 (mapconcat 'mh-alias-expand the-answer ",\n ")))))
445 (t 449 (t
446 (or (mh-alias-which-file-has-alias alias autolist) 450 (or (mh-alias-which-file-has-alias alias autolist)
447 (completing-read "Alias file [press Tab]: " 451 (completing-read "Alias file [press Tab]: "
448 (mapcar 'list autolist) nil t)))))))) 452 (mapcar 'list autolist) nil t))))))))
449 453
454 ;;;###mh-autoload
450 (defun mh-alias-address-to-alias (address) 455 (defun mh-alias-address-to-alias (address)
451 "Return the ADDRESS alias if defined, or nil." 456 "Return the ADDRESS alias if defined, or nil."
452 (let* ((aliases (mh-alias-ali address t))) 457 (let* ((aliases (mh-alias-ali address t)))
453 (if (string-equal aliases address) 458 (if (string-equal aliases address)
454 nil ; ali returned same string -> no. 459 nil ; ali returned same string -> no.
455 ;; For the comma-separated aliases reyurned by ali, check that one of 460 ;; Double-check that we have an individual alias. This means that the
456 ;; them doesn't expand into a list. e.g. we do have an individual 461 ;; alias doesn't expand into a list (of which this address is part).
457 ;; alias for that adress.
458 (car (delq nil (mapcar 462 (car (delq nil (mapcar
459 (function 463 (function
460 (lambda (alias) 464 (lambda (alias)
461 (let ((recurse (mh-alias-ali alias nil))) 465 (let ((recurse (mh-alias-ali alias nil)))
462 (if (string-match ".*,.*" recurse) 466 (if (string-match ".*,.*" recurse)
499 (case-fold-search t)) 503 (case-fold-search t))
500 (cond ((string-match "^i" answer)) 504 (cond ((string-match "^i" answer))
501 ((string-match "^a" answer) 505 ((string-match "^a" answer)
502 (forward-line 1)) 506 (forward-line 1))
503 (t 507 (t
504 error "Quitting.")))) 508 (error "Quitting")))))
505 ;; No, so sort-in at the right place 509 ;; No, so sort-in at the right place
506 ;; search for "^alias", then "^alia", etc. 510 ;; search for "^alias", then "^alia", etc.
507 ((eq mh-alias-insertion-location 'sorted) 511 ((eq mh-alias-insertion-location 'sorted)
508 (setq letter (substring alias-search -1) 512 (setq letter (substring alias-search -1)
509 alias-search (substring alias-search 0 -1)) 513 alias-search (substring alias-search 0 -1))