]> git.eshelyaron.com Git - emacs.git/commitdiff
(mail-abbrev-make-syntax-table): New subroutine
authorRichard M. Stallman <rms@gnu.org>
Sat, 23 Mar 2002 16:10:14 +0000 (16:10 +0000)
committerRichard M. Stallman <rms@gnu.org>
Sat, 23 Mar 2002 16:10:14 +0000 (16:10 +0000)
broken out of sendmail-pre-abbrev-expand-hook.
(sendmail-pre-abbrev-expand-hook): Use it.

lisp/ChangeLog
lisp/mail/mailabbrev.el

index 29c55d3d36120f2b99df7fc1a26107917698c24e..9c9c9170c66f47dd241be446ece6bda3768878ee 100644 (file)
@@ -1,3 +1,9 @@
+2002-03-23  Richard M. Stallman  <rms@gnu.org>
+
+       * 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  <monnier@cs.yale.edu>
 
        * Makefile.in (finder-inf.el): Remove.
index 75e8d54e555f049103d32bc58b1bf5025dfff449..ed389526475c03ed742309130959be4e5e1e9304 100644 (file)
@@ -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