comparison lisp/mail/mailabbrev.el @ 907:48ca3bf4b5f8

*** empty log message ***
author Roland McGrath <roland@gnu.org>
date Sun, 02 Aug 1992 03:36:38 +0000
parents 20674ae6bf52
children 907639748f24
comparison
equal deleted inserted replaced
906:97064c6420e7 907:48ca3bf4b5f8
1 ;;; mailabbrev.el --- abbrev-expansion of mail aliases. 1 ;;; mailabbrev.el --- abbrev-expansion of mail aliases.
2 2
3 ;;; Copyright (C) 1985, 1986, 1987, 1992 Free Software Foundation, Inc. 3 ;;; Copyright (C) 1985, 1986, 1987, 1992 Free Software Foundation, Inc.
4 4
5 ;; Author: Jamie Zawinski <jwz@lucid.com> 5 ;; Author: Jamie Zawinski <jwz@lucid.com>
6 ;; Roland McGrath <roland@gnu.ai.mit.edu> 6 ;; Maintainer: Jamie Zawinski <jwz@lucid.com>
7 ;; Created: 19 Oct 90 7 ;; Created: 19 Oct 90
8 ;; Keywords: mail 8 ;; Keywords: mail
9 9
10 ;;; ??? We must get papers for this or delete it. 10 ;;; ??? We must get papers for this or delete it.
11
11 ;;; This file is part of GNU Emacs. 12 ;;; This file is part of GNU Emacs.
12 13
13 ;;; GNU Emacs is free software; you can redistribute it and/or modify 14 ;;; GNU Emacs is free software; you can redistribute it and/or modify
14 ;;; it under the terms of the GNU General Public License as published by 15 ;;; it under the terms of the GNU General Public License as published by
15 ;;; the Free Software Foundation; either version 2, or (at your option) 16 ;;; the Free Software Foundation; either version 2, or (at your option)
218 (if (= (preceding-char) ?\\) 219 (if (= (preceding-char) ?\\)
219 (progn (delete-char -1) (delete-char 1) (insert ?\ )) 220 (progn (delete-char -1) (delete-char 1) (insert ?\ ))
220 (forward-char 1))) 221 (forward-char 1)))
221 (goto-char (point-min)) 222 (goto-char (point-min))
222 (while (re-search-forward 223 (while (re-search-forward
223 "^\\(a\\(lias\\|\\)\\|g\\(roup\\)\\|source\\)[ \t]+" nil t) 224 "^\\(a\\(lias\\)?\\|g\\(roup\\)?\\|source\\)[ \t]+" nil t)
224 (beginning-of-line) 225 (beginning-of-line)
225 (if (looking-at "source[ \t]+\\([^ \t\n]+\\)") 226 (if (looking-at "source[ \t]+\\([^ \t\n]+\\)")
226 (progn 227 (progn
227 (end-of-line) 228 (end-of-line)
228 (build-mail-aliases 229 (build-mail-aliases
522 (setq mail-aliases nil) 523 (setq mail-aliases nil)
523 (build-mail-aliases file)) 524 (build-mail-aliases file))
524 525
525 (defun mail-interactive-insert-alias (&optional alias) 526 (defun mail-interactive-insert-alias (&optional alias)
526 "Prompt for and insert a mail alias." 527 "Prompt for and insert a mail alias."
527 (interactive (list (completing-read "Expand alias: " mail-aliases nil t))) 528 (interactive (progn
529 (if (not (vectorp mail-aliases)) (mail-aliases-setup))
530 (list (completing-read "Expand alias: " mail-aliases nil t))))
531 (if (not (vectorp mail-aliases)) (mail-aliases-setup))
528 (insert (or (and alias (symbol-value (intern-soft alias mail-aliases))) ""))) 532 (insert (or (and alias (symbol-value (intern-soft alias mail-aliases))) "")))
529 533
530 (defun abbrev-hacking-next-line (&optional arg) 534 (defun abbrev-hacking-next-line (&optional arg)
531 "Just like `next-line' (\\[next-line]) but expands abbrevs when at \ 535 "Just like `next-line' (\\[next-line]) but expands abbrevs when at \
532 end of line." 536 end of line."