unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* [yamaoka@jpl.org: Re: mail-extract-address-components bug]
@ 2007-05-15 19:39 Richard Stallman
  0 siblings, 0 replies; only message in thread
From: Richard Stallman @ 2007-05-15 19:39 UTC (permalink / raw)
  To: emacs-devel

Would someone please install this change?

------- Start of forwarded message -------
X-Spam-Status: No, score=0.0 required=5.0 tests=UNPARSEABLE_RELAY 
	autolearn=failed version=3.1.0
Date: Tue, 15 May 2007 18:00:43 +0900
From: Katsumi Yamaoka <yamaoka@jpl.org>
To: emacs-pretest-bug@gnu.org
Organization: Emacsen advocacy group
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Subject: Re: mail-extract-address-components bug

>>>>> In <b4mk5vcdrg8.fsf@jpl.org> Katsumi Yamaoka wrote:

> 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.

[...]

> The causes are

[...]

> and `m-e-a-c' uses `forward-word' to try to skip them even if
> they are not words.

I found another solution, which doesn't need to modify mail-extr.el:

;; Set the syntax of all non-ASCII characters to `word'
;; in the syntax tables that mail-extr.el uses.
(eval-after-load "mail-extr"
  '(let ((tables '(mail-extr-address-syntax-table
		   mail-extr-address-comment-syntax-table
		   mail-extr-address-domain-literal-syntax-table
		   mail-extr-address-text-comment-syntax-table
		   mail-extr-address-text-syntax-table))
	 table charsets generic-char)
     (while tables
       (setq table (symbol-value (car tables))
	     tables (cdr tables)
	     charsets charset-list)
       (while charsets
	 (setq generic-char (make-char (car charsets))
	       charsets (cdr charsets))
	 (if (>= generic-char 128)
	     (modify-syntax-entry generic-char "w" table))))))

This form also modifies the syntax of the Latin-1 nbsp character
to `word' but it doesn't seem to be a problem.

BTW, I think it should be documented that `modify-syntax-entry'
allows the generic character of a charset as the first argument,
as it is mentioned in the doc string of `make-char'.

Regards,


_______________________________________________
emacs-pretest-bug mailing list
emacs-pretest-bug@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-pretest-bug
------- End of forwarded message -------

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2007-05-15 19:39 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-05-15 19:39 [yamaoka@jpl.org: Re: mail-extract-address-components bug] Richard Stallman

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).