From 0330231b3c22e3dbb4cea2891cfae6c3156c18cd Mon Sep 17 00:00:00 2001 From: Chong Yidong Date: Mon, 4 Jun 2007 23:21:07 +0000 Subject: [PATCH] (mail-extract-address-components): Recognize non-ASCII characters except for NBSP as words. --- lisp/mail/mail-extr.el | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/lisp/mail/mail-extr.el b/lisp/mail/mail-extr.el index 9e1b94d8b7a..5029ca23343 100644 --- a/lisp/mail/mail-extr.el +++ b/lisp/mail/mail-extr.el @@ -873,7 +873,17 @@ consing a string.)" (mail-extr-nuke-char-at (point)) (forward-char 1)) (t - (forward-word 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 ?,) -- 2.39.2