From: Richard M. Stallman Date: Sat, 23 Mar 2002 16:10:14 +0000 (+0000) Subject: (mail-abbrev-make-syntax-table): New subroutine X-Git-Tag: ttn-vms-21-2-B4~16002 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=cf8b484f16197f8f890c75861984e2fc3f214b9f;p=emacs.git (mail-abbrev-make-syntax-table): New subroutine broken out of sendmail-pre-abbrev-expand-hook. (sendmail-pre-abbrev-expand-hook): Use it. --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 29c55d3d361..9c9c9170c66 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,9 @@ +2002-03-23 Richard M. Stallman + + * mail/mailabbrev.el (mail-abbrev-make-syntax-table): New subroutine + broken out of sendmail-pre-abbrev-expand-hook. + (sendmail-pre-abbrev-expand-hook): Use it. + 2002-03-22 Stefan Monnier * Makefile.in (finder-inf.el): Remove. diff --git a/lisp/mail/mailabbrev.el b/lisp/mail/mailabbrev.el index 75e8d54e555..ed389526475 100644 --- a/lisp/mail/mailabbrev.el +++ b/lisp/mail/mailabbrev.el @@ -405,6 +405,19 @@ This is not actually made the current syntax table of the buffer, but 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 @@ of a mail alias. The value is set up, buffer-local, when first needed.") ;; 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