aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/mail
diff options
context:
space:
mode:
authorRichard M. Stallman <[email protected]>2002-03-23 16:10:14 +0000
committerRichard M. Stallman <[email protected]>2002-03-23 16:10:14 +0000
commitcf8b484f16197f8f890c75861984e2fc3f214b9f (patch)
tree584af37ced6e466afdecc1d4db0898246d3e83fe /lisp/mail
parenta3dde781f2cc94552f82b503fce75944cde64b99 (diff)
(mail-abbrev-make-syntax-table): New subroutine
broken out of sendmail-pre-abbrev-expand-hook. (sendmail-pre-abbrev-expand-hook): Use it.
Diffstat (limited to 'lisp/mail')
-rw-r--r--lisp/mail/mailabbrev.el26
1 files changed, 14 insertions, 12 deletions
diff --git a/lisp/mail/mailabbrev.el b/lisp/mail/mailabbrev.el
index 75e8d54e55..ed38952647 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