aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard M. Stallman1997-12-04 04:36:46 +0000
committerRichard M. Stallman1997-12-04 04:36:46 +0000
commit524d06f590ee3df21f46f8f4a07783984bf0cd30 (patch)
tree9d9a0bc8da685fa0618f229074008c8fdc38e3d2
parent36347d4342355ee31b9d4237503d2b43c8e57e2d (diff)
downloademacs-524d06f590ee3df21f46f8f4a07783984bf0cd30.tar.gz
emacs-524d06f590ee3df21f46f8f4a07783984bf0cd30.zip
(mail-extr-voodoo): Allow & between names.
Reenable &-substitution when & comes last.
-rw-r--r--lisp/mail/mail-extr.el40
1 files changed, 22 insertions, 18 deletions
diff --git a/lisp/mail/mail-extr.el b/lisp/mail/mail-extr.el
index daa50daa8f7..27bdd8b3fc5 100644
--- a/lisp/mail/mail-extr.el
+++ b/lisp/mail/mail-extr.el
@@ -1533,7 +1533,6 @@ ADDRESS may be a string or a buffer. If it is a buffer, the visible
1533 (while (re-search-forward mail-extr-bad-dot-pattern nil t) 1533 (while (re-search-forward mail-extr-bad-dot-pattern nil t)
1534 (replace-match "\\1 \\2" t)))))) 1534 (replace-match "\\1 \\2" t))))))
1535 1535
1536
1537 ;; Loop over the words (and other junk) in the name. 1536 ;; Loop over the words (and other junk) in the name.
1538 (goto-char (point-min)) 1537 (goto-char (point-min))
1539 (while (not name-done-flag) 1538 (while (not name-done-flag)
@@ -1647,23 +1646,6 @@ ADDRESS may be a string or a buffer. If it is a buffer, the visible
1647 (if initial 1646 (if initial
1648 (insert initial ". "))))) 1647 (insert initial ". ")))))
1649 1648
1650 ;; Handle & substitution
1651 ;; This is turned off because an & from the passwd file
1652 ;; should not really get into a mail address without
1653 ;; being substituted, and people use it for other things.
1654;;; ((and (or (bobp)
1655;;; (eq ?\ (preceding-char)))
1656;;; (looking-at "&\\( \\|\\'\\)"))
1657;;; (mail-extr-delete-char 1)
1658;;; (capitalize-region
1659;;; (point)
1660;;; (progn
1661;;; (insert-buffer-substring canonicalization-buffer
1662;;; mbox-beg mbox-end)
1663;;; (point)))
1664;;; (setq disable-initial-guessing-flag t)
1665;;; (setq word-found-flag t))
1666
1667 ;; Handle *Stupid* VMS date stamps 1649 ;; Handle *Stupid* VMS date stamps
1668 ((looking-at mail-extr-stupid-vms-date-stamp-pattern) 1650 ((looking-at mail-extr-stupid-vms-date-stamp-pattern)
1669 (replace-match "" t)) 1651 (replace-match "" t))
@@ -1726,6 +1708,28 @@ ADDRESS may be a string or a buffer. If it is a buffer, the visible
1726 (setq word-found-flag t) 1708 (setq word-found-flag t)
1727 (setq name-done-flag t)) 1709 (setq name-done-flag t))
1728 1710
1711 ;; Handle & substitution, when & is last and is not first.
1712 ((and (> word-count 0)
1713 (eq ?\ (preceding-char))
1714 (eq (following-char) ?&)
1715 (eq (1+ (point)) (point-max)))
1716 (mail-extr-delete-char 1)
1717 (capitalize-region
1718 (point)
1719 (progn
1720 (insert-buffer-substring canonicalization-buffer
1721 mbox-beg mbox-end)
1722 (point)))
1723 (setq disable-initial-guessing-flag t)
1724 (setq word-found-flag t))
1725
1726 ;; Handle & between names, as in "Bob & Susie".
1727 ((and (> word-count 0) (eq (following-char) ?\&))
1728 (setq name-beg (point))
1729 (setq name-end (1+ name-beg))
1730 (setq word-found-flag t)
1731 (goto-char name-end))
1732
1729 ;; Regular name words 1733 ;; Regular name words
1730 ((looking-at mail-extr-name-pattern) 1734 ((looking-at mail-extr-name-pattern)
1731 (setq name-beg (point)) 1735 (setq name-beg (point))