]> git.eshelyaron.com Git - emacs.git/commitdiff
(mail-extr-voodoo): Treat a number as a word
authorRichard M. Stallman <rms@gnu.org>
Fri, 16 Nov 2001 19:57:07 +0000 (19:57 +0000)
committerRichard M. Stallman <rms@gnu.org>
Fri, 16 Nov 2001 19:57:07 +0000 (19:57 +0000)
if it doesn't make sense as anything else.
(mail-extr-leading-garbage): Match non-word characters only.

lisp/ChangeLog
lisp/mail/mail-extr.el

index bb93cffb3fcacb004e41b57b3d0b3546bcdc7e3a..64b6da0ba24eceef035b4c612cb38d34745b74c7 100644 (file)
@@ -1,3 +1,10 @@
+2001-11-16  Richard M. Stallman  <rms@gnu.org>
+
+       * mail/mail-extr.el (mail-extr-voodoo): Treat a number as a word
+       if it doesn't make sense as anything else.
+       Don't recognize a "telephone number" at the beginning of the name.
+       (mail-extr-leading-garbage): Match non-word characters only.
+
 2001-11-16  Pavel Jan\e,Bm\e(Bk  <Pavel@Janik.cz>
 
        * emulation/viper.el: Fix typo.
index 0fd3414df047d82f1d42924ec9cf4ffa5e1bf024..d6a1f9ffe1c155ae783c5e732950c49647bd0d47 100644 (file)
@@ -316,8 +316,7 @@ by translating things like \"foo!bar!baz@host\" into \"baz@bar.UUCP\"."
 ;; Keep this set as minimal as possible.
 (defconst mail-extr-last-letters (purecopy "[:alpha:]`'."))
 
-(defconst mail-extr-leading-garbage
-  (purecopy (format "[^%s]+" mail-extr-first-letters)))
+(defconst mail-extr-leading-garbage "\\W+")
 
 ;; (defconst mail-extr-non-name-chars 
 ;;   (purecopy (concat "^" mail-extr-all-letters ".")))
@@ -1687,7 +1686,8 @@ ADDRESS may be a string or a buffer.  If it is a buffer, the visible
           (looking-at mail-extr-trailing-comment-start-pattern)
           
           ;; Stop before telephone numbers
-          (looking-at mail-extr-telephone-extension-pattern))
+          (and (>= word-count 1)
+               (looking-at mail-extr-telephone-extension-pattern)))
          (setq name-done-flag t))
         
         ;; Delete ham radio call signs
@@ -1765,6 +1765,13 @@ ADDRESS may be a string or a buffer.  If it is a buffer, the visible
          (goto-char name-end)
          (setq word-found-flag t))
 
+        ;; Allow a number as a word, if it doesn't mean anything else.
+        ((looking-at "[0-9]+\\>")
+         (setq name-beg (point))
+         (setq name-end (match-end 0))
+         (goto-char name-end)
+         (setq word-found-flag t))
+
         (t
          (setq name-done-flag t)
          ))