comparison lisp/mail/mailabbrev.el @ 43268:08fa5680829b

(define-mail-abbrev): Define as system abbrev. (mail-abbrev-in-expansion-header-p): Copy the code of mail-header-end to avoid needing sendmail.el at run time.
author Richard M. Stallman <rms@gnu.org>
date Wed, 13 Feb 2002 15:59:53 +0000
parents c7e8bcec1caf
children 00eee90af15f
comparison
equal deleted inserted replaced
43267:a98ecf783878 43268:08fa5680829b
315 mail-alias-separator-string))) 315 mail-alias-separator-string)))
316 (setq mail-abbrev-aliases-need-to-be-resolved t) 316 (setq mail-abbrev-aliases-need-to-be-resolved t)
317 (setq name (downcase name)) 317 (setq name (downcase name))
318 ;; use an abbrev table instead of an alist for mail-abbrevs. 318 ;; use an abbrev table instead of an alist for mail-abbrevs.
319 (let ((abbrevs-changed abbrevs-changed)) ; protect this from being changed. 319 (let ((abbrevs-changed abbrevs-changed)) ; protect this from being changed.
320 (define-abbrev mail-abbrevs name definition 'mail-abbrev-expand-hook))) 320 (define-abbrev mail-abbrevs name definition 'mail-abbrev-expand-hook 0 t)))
321 321
322 322
323 (defun mail-resolve-all-aliases () 323 (defun mail-resolve-all-aliases ()
324 "Resolve all forward references in the mail aliases table." 324 "Resolve all forward references in the mail aliases table."
325 (if mail-abbrev-aliases-need-to-be-resolved 325 (if mail-abbrev-aliases-need-to-be-resolved
416 (re-search-backward "^[^ \t]" nil 'move) 416 (re-search-backward "^[^ \t]" nil 'move)
417 ;; are we at the front of an appropriate header line? 417 ;; are we at the front of an appropriate header line?
418 (looking-at mail-abbrev-mode-regexp)) 418 (looking-at mail-abbrev-mode-regexp))
419 ;; 419 ;;
420 ;; ...and are we in the headers? 420 ;; ...and are we in the headers?
421 (< (point) (mail-header-end))))) 421 (< (point)
422 (save-restriction
423 (widen)
424 (save-excursion
425 (rfc822-goto-eoh)
426 (point)))))))
422 427
423 (defvar mail-mode-abbrev-table) ; quiet the compiler 428 (defvar mail-mode-abbrev-table) ; quiet the compiler
424 429
425 (defun sendmail-pre-abbrev-expand-hook () 430 (defun sendmail-pre-abbrev-expand-hook ()
426 (and (and mail-abbrevs (not (eq mail-abbrevs t))) 431 (and (and mail-abbrevs (not (eq mail-abbrevs t)))
462 (map-char-table 467 (map-char-table
463 (function (lambda (key value) 468 (function (lambda (key value)
464 (if (equal value _) 469 (if (equal value _)
465 (set-char-table-range tab key w)))) 470 (set-char-table-range tab key w))))
466 tab) 471 tab)
472 (modify-syntax-entry ?@ "w" tab)
467 (setq mail-abbrev-syntax-table tab))) 473 (setq mail-abbrev-syntax-table tab)))
468 474
469 ;; If the character just typed was non-alpha-symbol-syntax, 475 ;; If the character just typed was non-alpha-symbol-syntax,
470 ;; then don't expand the abbrev now (that is, don't expand 476 ;; then don't expand the abbrev now (that is, don't expand
471 ;; when the user types -.) Check the character's syntax in 477 ;; when the user types -.) Check the character's syntax in