# HG changeset patch # User Richard M. Stallman # Date 1016899799 0 # Node ID 00eee90af15f35923eb2b55f07bd14b67fbb0b08 # Parent 48ee57a8b28c2bb6bfa31fc6d89b2aacd2094f4f (mail-abbrev-make-syntax-table): New subroutine broken out of sendmail-pre-abbrev-expand-hook. (sendmail-pre-abbrev-expand-hook): Use it. diff -r 48ee57a8b28c -r 00eee90af15f lisp/mail/mailabbrev.el --- 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