Mercurial > emacs
comparison lisp/mail/mailabbrev.el @ 34921:fc01ec9131a8
(mail-abbrevs-enable, mail-abbrevs-disable):
Use mail-mode-hook instead of mail-setup-hook. Otherwise
continuing an interrupted message with C-u C-x m for instence,
winds up in Mail mode without abbrevs.
author | Gerd Moellmann <gerd@gnu.org> |
---|---|
date | Fri, 29 Dec 2000 12:19:28 +0000 |
parents | e559f0aa6b2d |
children | 253f761ad37b |
comparison
equal
deleted
inserted
replaced
34920:f3d136693fb1 | 34921:fc01ec9131a8 |
---|---|
107 ;; If you would like your aliases to be expanded when you type M-> or ^N to | 107 ;; If you would like your aliases to be expanded when you type M-> or ^N to |
108 ;; move out of the mail-header into the message body (instead of having to | 108 ;; move out of the mail-header into the message body (instead of having to |
109 ;; type SPC at the end of the abbrev before moving away) then you can do | 109 ;; type SPC at the end of the abbrev before moving away) then you can do |
110 ;; | 110 ;; |
111 ;; (add-hook | 111 ;; (add-hook |
112 ;; 'mail-setup-hook | 112 ;; 'mail-mode-hook |
113 ;; (lambda () | 113 ;; (lambda () |
114 ;; (substitute-key-definition 'next-line 'mail-abbrev-next-line | 114 ;; (substitute-key-definition 'next-line 'mail-abbrev-next-line |
115 ;; mail-mode-map global-map) | 115 ;; mail-mode-map global-map) |
116 ;; (substitute-key-definition 'end-of-buffer 'mail-abbrev-end-of-buffer | 116 ;; (substitute-key-definition 'end-of-buffer 'mail-abbrev-end-of-buffer |
117 ;; mail-mode-map global-map))) | 117 ;; mail-mode-map global-map))) |
122 ;; behaviour. | 122 ;; behaviour. |
123 ;; | 123 ;; |
124 ;; Thanks to Harald Hanche-Olsen, Michael Ernst, David Loeffler, and | 124 ;; Thanks to Harald Hanche-Olsen, Michael Ernst, David Loeffler, and |
125 ;; Noah Friedman for suggestions and bug reports. | 125 ;; Noah Friedman for suggestions and bug reports. |
126 | 126 |
127 ;; To use this package, do (add-hook 'mail-setup-hook 'mail-abbrevs-setup). | 127 ;; To use this package, do (add-hook 'mail-mode-hook 'mail-abbrevs-setup). |
128 | 128 |
129 ;;; Code: | 129 ;;; Code: |
130 | 130 |
131 (require 'sendmail) | 131 (require 'sendmail) |
132 | 132 |
183 (add-hook 'pre-abbrev-expand-hook 'sendmail-pre-abbrev-expand-hook | 183 (add-hook 'pre-abbrev-expand-hook 'sendmail-pre-abbrev-expand-hook |
184 nil t) | 184 nil t) |
185 (abbrev-mode 1)) | 185 (abbrev-mode 1)) |
186 | 186 |
187 (defun mail-abbrevs-enable () | 187 (defun mail-abbrevs-enable () |
188 (add-hook 'mail-setup-hook 'mail-abbrevs-setup)) | 188 (add-hook 'mail-mode-hook 'mail-abbrevs-setup)) |
189 | 189 |
190 (defun mail-abbrevs-disable () | 190 (defun mail-abbrevs-disable () |
191 "Turn off use of the `mailabbrev' package." | 191 "Turn off use of the `mailabbrev' package." |
192 (remove-hook 'mail-setup-hook 'mail-abbrevs-setup) | 192 (remove-hook 'mail-mode-hook 'mail-abbrevs-setup) |
193 (abbrev-mode (if (default-value 'abbrev-mode) 1 -1))) | 193 (abbrev-mode (if (default-value 'abbrev-mode) 1 -1))) |
194 | 194 |
195 ;;;###autoload | 195 ;;;###autoload |
196 (defun build-mail-abbrevs (&optional file recursivep) | 196 (defun build-mail-abbrevs (&optional file recursivep) |
197 "Read mail aliases from personal mail alias file and set `mail-abbrevs'. | 197 "Read mail aliases from personal mail alias file and set `mail-abbrevs'. |