]> git.eshelyaron.com Git - emacs.git/commitdiff
(define-mail-abbrev): Define as system abbrev.
authorRichard M. Stallman <rms@gnu.org>
Wed, 13 Feb 2002 15:59:53 +0000 (15:59 +0000)
committerRichard M. Stallman <rms@gnu.org>
Wed, 13 Feb 2002 15:59:53 +0000 (15:59 +0000)
(mail-abbrev-in-expansion-header-p): Copy the code of mail-header-end
to avoid needing sendmail.el at run time.

lisp/mail/mailabbrev.el

index 5243438fbe8b12d57fe091346f8ce23c28d175b2..75e8d54e555f049103d32bc58b1bf5025dfff449 100644 (file)
@@ -317,7 +317,7 @@ If DEFINITION contains multiple addresses, separate them with commas."
   (setq name (downcase name))
   ;; use an abbrev table instead of an alist for mail-abbrevs.
   (let ((abbrevs-changed abbrevs-changed))  ; protect this from being changed.
-    (define-abbrev mail-abbrevs name definition 'mail-abbrev-expand-hook)))
+    (define-abbrev mail-abbrevs name definition 'mail-abbrev-expand-hook 0 t)))
 
 
 (defun mail-resolve-all-aliases ()
@@ -418,7 +418,12 @@ of a mail alias.  The value is set up, buffer-local, when first needed.")
        (looking-at mail-abbrev-mode-regexp))
      ;;
      ;; ...and are we in the headers?
-     (< (point) (mail-header-end)))))
+     (< (point)
+       (save-restriction
+         (widen)
+         (save-excursion
+           (rfc822-goto-eoh)
+           (point)))))))
 
 (defvar mail-mode-abbrev-table) ; quiet the compiler
 
@@ -464,6 +469,7 @@ of a mail alias.  The value is set up, buffer-local, when first needed.")
                              (if (equal value _)
                                  (set-char-table-range tab key w))))
                  tab)
+                (modify-syntax-entry ?@ "w" tab)
                 (setq mail-abbrev-syntax-table tab)))
 
             ;; If the character just typed was non-alpha-symbol-syntax,