Mercurial > emacs
comparison lisp/mail/mail-extr.el @ 20400:fd74979309d3
(mail-extr-voodoo): Allow & between names.
Reenable &-substitution when & comes last.
author | Richard M. Stallman <rms@gnu.org> |
---|---|
date | Thu, 04 Dec 1997 04:36:46 +0000 |
parents | 3b0ad3d46bde |
children | 1b4f02e638b8 |
comparison
equal
deleted
inserted
replaced
20399:04ce86b23ffa | 20400:fd74979309d3 |
---|---|
1531 ;; Example: danj1@cb.att.com (daniel.jacobson) | 1531 ;; Example: danj1@cb.att.com (daniel.jacobson) |
1532 (goto-char (point-min)) | 1532 (goto-char (point-min)) |
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) |
1540 | 1539 |
1541 (cond (word-found-flag | 1540 (cond (word-found-flag |
1645 (setq initial nil)) | 1644 (setq initial nil)) |
1646 (delete-region cbeg cend) | 1645 (delete-region cbeg cend) |
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)) |
1670 | 1652 |
1671 ;; Handle Chinese characters. | 1653 ;; Handle Chinese characters. |
1724 (looking-at mail-extr-listserv-list-name-pattern)) | 1706 (looking-at mail-extr-listserv-list-name-pattern)) |
1725 (narrow-to-region (match-beginning 1) (match-end 1)) | 1707 (narrow-to-region (match-beginning 1) (match-end 1)) |
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)) |
1732 (setq name-end (match-end 0)) | 1736 (setq name-end (match-end 0)) |
1733 | 1737 |