[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

mail-extract-address-components bug

From: Katsumi Yamaoka
Subject: mail-extract-address-components bug
Date: Mon, 14 May 2007 12:17:27 +0900
User-agent: Gnus/5.110007 (No Gnus v0.7) Emacs/22.1.50 (gnu/linux)


I hope this is fixed in Emacs 22.2 (or possibly 22.1).  I've been
annoyed that `mail-extract-address-component' sometimes fails to
parse addresses containing non-ASCII names correctly.  Japanese
people often use their native names in the From header.  Since
they sometimes use non-ASCII letters which are not specified as
words in the syntax table, Gnus, for example, fails to build the
recipient address when replying.  Here are examples:

(mail-extract-address-components "阿部 晋三  <address@hidden>")
 => ("阿部 晋三  <Shinzo Abe" "阿部 晋三  <address@hidden ")

(mail-extract-address-components "阿部 晋三 ◆ <address@hidden>")
 => ("阿部 晋三 ◆ <Shinzo Abe" "阿部 晋三 ◆ <address@hidden ")

 "阿部 晋三  (しんちゃん) <address@hidden>")
 => ("阿部 晋三  (しんちゃん" "address@hidden")

The causes are " " (wide space) and "◆" in the name portion
and `m-e-a-c' uses `forward-word' to try to skip them even if
they are not words.  I tried fixing of this problem as follows:

(NOTE: it contains Latin-1 nbsp characters encoded with utf-8.)
*** mail-extr.el~       Sun Jan 21 21:57:52 2007
--- mail-extr.el        Mon May 14 03:16:51 2007
*** 873,879 ****
              (mail-extr-nuke-char-at (point))
              (forward-char 1))
!             (forward-word 1)))
            (or (eq char ?\()
                ;; At the end of first address of a multiple address header.
                (and (eq char ?,)
--- 873,889 ----
              (mail-extr-nuke-char-at (point))
              (forward-char 1))
!             ;; Do `(forward-word 1)', recognizing non-ASCII characters
!             ;; except Latin-1 nbsp as words.
!             (while (progn
!                      (skip-chars-forward "^\000-\177 ")
!                      (and (not (eobp))
!                           (eq ?w (char-syntax (char-after)))
!                           (progn
!                             (forward-word 1)
!                             (and (not (eobp))
!                                  (> (char-after) ?\177)
!                                  (not (eq (char-after ? ))))))))))
            (or (eq char ?\()
                ;; At the end of first address of a multiple address header.
                (and (eq char ?,)
I appreciate someone looking into it.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]