comparison lisp/mh-e/mh-alias.el @ 67760:9c3504ae6060

Follow MH-E Developers Guide conventions. Use `' quotes for Help hyperlinks such as symbols, Info nodes, or URLs. Use \" quotes for everything else. Otherwise, you can accidently get links to nonsense symbols.
author Bill Wohler <wohler@newt.com>
date Fri, 23 Dec 2005 08:40:31 +0000
parents 6b063593fdad
children 7882fc7df359
comparison
equal deleted inserted replaced
67759:b7b75914a27d 67760:9c3504ae6060
68 "/usr/lib/mh/MailAliases" "/usr/share/mailutils/mh/MailAliases" 68 "/usr/lib/mh/MailAliases" "/usr/share/mailutils/mh/MailAliases"
69 "/etc/passwd") 69 "/etc/passwd")
70 "*A list of system files which are a source of aliases. 70 "*A list of system files which are a source of aliases.
71 If these files are modified, they are automatically reread. This list 71 If these files are modified, they are automatically reread. This list
72 need include only system aliases and the passwd file, since personal 72 need include only system aliases and the passwd file, since personal
73 alias files listed in your `Aliasfile:' MH profile component are 73 alias files listed in your \"Aliasfile:\" MH profile component are
74 automatically included. You can update the alias list manually using 74 automatically included. You can update the alias list manually using
75 \\[mh-alias-reload].") 75 \\[mh-alias-reload].")
76 76
77 77
78 78
144 (setq res (concat "\"" res "\""))) 144 (setq res (concat "\"" res "\"")))
145 res)) 145 res))
146 146
147 (defun mh-alias-local-users () 147 (defun mh-alias-local-users ()
148 "Return an alist of local users from /etc/passwd. 148 "Return an alist of local users from /etc/passwd.
149 Exclude all aliases already in `mh-alias-alist' from `ali'" 149 Exclude all aliases already in `mh-alias-alist' from \"ali\""
150 (let (passwd-alist) 150 (let (passwd-alist)
151 (save-excursion 151 (save-excursion
152 (set-buffer (get-buffer-create mh-temp-buffer)) 152 (set-buffer (get-buffer-create mh-temp-buffer))
153 (erase-buffer) 153 (erase-buffer)
154 (cond 154 (cond
186 (defun mh-alias-reload () 186 (defun mh-alias-reload ()
187 "Reload MH aliases. 187 "Reload MH aliases.
188 188
189 Since aliases are updated frequently, MH-E reloads aliases 189 Since aliases are updated frequently, MH-E reloads aliases
190 automatically whenever an alias lookup occurs if an alias source has 190 automatically whenever an alias lookup occurs if an alias source has
191 changed. Sources include files listed in your `Aliasfile:' profile 191 changed. Sources include files listed in your \"Aliasfile:\" profile
192 component and your password file if option `mh-alias-local-users' is 192 component and your password file if option `mh-alias-local-users' is
193 turned on. However, you can reload your aliases manually by calling 193 turned on. However, you can reload your aliases manually by calling
194 this command directly. 194 this command directly.
195 195
196 This function runs `mh-alias-reloaded-hook' after the aliases have 196 This function runs `mh-alias-reloaded-hook' after the aliases have
420 found))) 420 found)))
421 421
422 (defun mh-alias-insert-file (&optional alias) 422 (defun mh-alias-insert-file (&optional alias)
423 "Return filename which should be used to add ALIAS. 423 "Return filename which should be used to add ALIAS.
424 The value of the option `mh-alias-insert-file' is used if non-nil\; 424 The value of the option `mh-alias-insert-file' is used if non-nil\;
425 otherwise the value of the `Aliasfile:' profile component is used. 425 otherwise the value of the \"Aliasfile:\" profile component is used.
426 If the alias already exists, try to return the name of the file that 426 If the alias already exists, try to return the name of the file that
427 contains it." 427 contains it."
428 (cond 428 (cond
429 ((and mh-alias-insert-file (listp mh-alias-insert-file)) 429 ((and mh-alias-insert-file (listp mh-alias-insert-file))
430 (if (not (elt mh-alias-insert-file 1)) ; Only one entry, use it 430 (if (not (elt mh-alias-insert-file 1)) ; Only one entry, use it
447 file)) 447 file))
448 (mh-alias-filenames t))))) 448 (mh-alias-filenames t)))))
449 (cond 449 (cond
450 ((not autolist) 450 ((not autolist)
451 (error "No writable alias file. 451 (error "No writable alias file.
452 Set `mh-alias-insert-file' or the Aliasfile profile component")) 452 Set `mh-alias-insert-file' or the \"Aliasfile:\" profile component"))
453 ((not (elt autolist 1)) ; Only one entry, use it 453 ((not (elt autolist 1)) ; Only one entry, use it
454 (car autolist)) 454 (car autolist))
455 ((or (not alias) 455 ((or (not alias)
456 (string-equal alias (mh-alias-ali alias))) ;alias doesn't exist 456 (string-equal alias (mh-alias-ali alias))) ;alias doesn't exist
457 (completing-read "Alias file: " (mapcar 'list autolist) nil t)) 457 (completing-read "Alias file: " (mapcar 'list autolist) nil t))