Mercurial > emacs
changeset 44118:00eee90af15f
(mail-abbrev-make-syntax-table): New subroutine
broken out of sendmail-pre-abbrev-expand-hook.
(sendmail-pre-abbrev-expand-hook): Use it.
author | Richard M. Stallman <rms@gnu.org> |
---|---|
date | Sat, 23 Mar 2002 16:09:59 +0000 |
parents | 48ee57a8b28c |
children | 6e7d7ac30428 |
files | lisp/mail/mailabbrev.el |
diffstat | 1 files changed, 14 insertions(+), 12 deletions(-) [+] |
line wrap: on
line diff
--- a/lisp/mail/mailabbrev.el Sat Mar 23 10:47:23 2002 +0000 +++ b/lisp/mail/mailabbrev.el Sat Mar 23 16:09:59 2002 +0000 @@ -405,6 +405,19 @@ simply controls the set of characters which may be a part of the name of a mail alias. The value is set up, buffer-local, when first needed.") +(defun mail-abbrev-make-syntax-table () + (make-local-variable 'mail-abbrev-syntax-table) + (unless mail-abbrev-syntax-table + (let ((tab (copy-syntax-table old-syntax-table)) + (_ (aref (standard-syntax-table) ?_)) + (w (aref (standard-syntax-table) ?w))) + (map-char-table + (function (lambda (key value) + (if (equal value _) + (set-char-table-range tab key w)))) + tab) + (modify-syntax-entry ?@ "w" tab) + (setq mail-abbrev-syntax-table tab)))) (defun mail-abbrev-in-expansion-header-p () "Whether point is in a mail-address header field." @@ -459,18 +472,7 @@ ;; expand-abbrev, and not as a result of the call to ;; expand-abbrev which invoked *us*. - (make-local-variable 'mail-abbrev-syntax-table) - (unless mail-abbrev-syntax-table - (let ((tab (copy-syntax-table old-syntax-table)) - (_ (aref (standard-syntax-table) ?_)) - (w (aref (standard-syntax-table) ?w))) - (map-char-table - (function (lambda (key value) - (if (equal value _) - (set-char-table-range tab key w)))) - tab) - (modify-syntax-entry ?@ "w" tab) - (setq mail-abbrev-syntax-table tab))) + (mail-abbrev-make-syntax-table) ;; If the character just typed was non-alpha-symbol-syntax, ;; then don't expand the abbrev now (that is, don't expand