aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard M. Stallman2002-03-23 16:10:14 +0000
committerRichard M. Stallman2002-03-23 16:10:14 +0000
commitcf8b484f16197f8f890c75861984e2fc3f214b9f (patch)
tree584af37ced6e466afdecc1d4db0898246d3e83fe
parenta3dde781f2cc94552f82b503fce75944cde64b99 (diff)
downloademacs-cf8b484f16197f8f890c75861984e2fc3f214b9f.tar.gz
emacs-cf8b484f16197f8f890c75861984e2fc3f214b9f.zip
(mail-abbrev-make-syntax-table): New subroutine
broken out of sendmail-pre-abbrev-expand-hook. (sendmail-pre-abbrev-expand-hook): Use it.
-rw-r--r--lisp/ChangeLog6
-rw-r--r--lisp/mail/mailabbrev.el26
2 files changed, 20 insertions, 12 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 29c55d3d361..9c9c9170c66 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,9 @@
12002-03-23 Richard M. Stallman <rms@gnu.org>
2
3 * mail/mailabbrev.el (mail-abbrev-make-syntax-table): New subroutine
4 broken out of sendmail-pre-abbrev-expand-hook.
5 (sendmail-pre-abbrev-expand-hook): Use it.
6
12002-03-22 Stefan Monnier <monnier@cs.yale.edu> 72002-03-22 Stefan Monnier <monnier@cs.yale.edu>
2 8
3 * Makefile.in (finder-inf.el): Remove. 9 * 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
405simply controls the set of characters which may be a part of the name 405simply controls the set of characters which may be a part of the name
406of a mail alias. The value is set up, buffer-local, when first needed.") 406of a mail alias. The value is set up, buffer-local, when first needed.")
407 407
408(defun mail-abbrev-make-syntax-table ()
409 (make-local-variable 'mail-abbrev-syntax-table)
410 (unless mail-abbrev-syntax-table
411 (let ((tab (copy-syntax-table old-syntax-table))
412 (_ (aref (standard-syntax-table) ?_))
413 (w (aref (standard-syntax-table) ?w)))
414 (map-char-table
415 (function (lambda (key value)
416 (if (equal value _)
417 (set-char-table-range tab key w))))
418 tab)
419 (modify-syntax-entry ?@ "w" tab)
420 (setq mail-abbrev-syntax-table tab))))
408 421
409(defun mail-abbrev-in-expansion-header-p () 422(defun mail-abbrev-in-expansion-header-p ()
410 "Whether point is in a mail-address header field." 423 "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.")
459 ;; expand-abbrev, and not as a result of the call to 472 ;; expand-abbrev, and not as a result of the call to
460 ;; expand-abbrev which invoked *us*. 473 ;; expand-abbrev which invoked *us*.
461 474
462 (make-local-variable 'mail-abbrev-syntax-table) 475 (mail-abbrev-make-syntax-table)
463 (unless mail-abbrev-syntax-table
464 (let ((tab (copy-syntax-table old-syntax-table))
465 (_ (aref (standard-syntax-table) ?_))
466 (w (aref (standard-syntax-table) ?w)))
467 (map-char-table
468 (function (lambda (key value)
469 (if (equal value _)
470 (set-char-table-range tab key w))))
471 tab)
472 (modify-syntax-entry ?@ "w" tab)
473 (setq mail-abbrev-syntax-table tab)))
474 476
475 ;; If the character just typed was non-alpha-symbol-syntax, 477 ;; If the character just typed was non-alpha-symbol-syntax,
476 ;; then don't expand the abbrev now (that is, don't expand 478 ;; then don't expand the abbrev now (that is, don't expand