From b3990fb30d16530a1e3e83be672428ac98b77729 Mon Sep 17 00:00:00 2001 From: yamaoka Date: Sun, 30 Mar 2003 13:35:22 +0000 Subject: [PATCH] Synch to Oort Gnus 200303301251. --- lisp/ChangeLog | 7 +++++++ lisp/gnus-art.el | 2 +- lisp/message.el | 25 +++++++++++++++---------- 3 files changed, 23 insertions(+), 11 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 588ca2b..ce09824 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,10 @@ +2003-03-30 Simon Josefsson + + * message.el (message-idna-inside-rhs-p): Narrow to header before + searching. + + * gnus-art.el (article-decode-idna-rhs): More restrictive regexp. + 2003-03-30 Lars Magne Ingebrigtsen * gnus-registry.el (gnus-registry-translate-to-alist): Make a diff --git a/lisp/gnus-art.el b/lisp/gnus-art.el index 63a1962..e14d2e6 100644 --- a/lisp/gnus-art.el +++ b/lisp/gnus-art.el @@ -2301,7 +2301,7 @@ If PROMPT (the prefix), prompt for a coding system to use." buffer-read-only) (article-narrow-to-head) (goto-char (point-min)) - (while (re-search-forward "\\(xn--.*\\)[ \t\n\r,>]" nil t) + (while (re-search-forward "\\(xn--[-A-Za-z0-9.]*\\)[ \t\n\r,>]" nil t) (let (ace unicode) (when (save-match-data (and (setq ace (match-string 1)) diff --git a/lisp/message.el b/lisp/message.el index f2756ca..9319ff0 100644 --- a/lisp/message.el +++ b/lisp/message.el @@ -5286,16 +5286,21 @@ string." "Return t iff point is inside a RHS (heuristically). Only works properly if header contains mailbox-list or address-list. I.e., calling it on a Subject: header is useless." - (if (re-search-backward - "[\\\n\r\t ]" (save-excursion (search-backward "@" nil t)) t) - ;; whitespace between @ and point - nil - (let ((dquote 1) (paren 1)) - (while (save-excursion (re-search-backward "[^\\]\"" nil t dquote)) - (incf dquote)) - (while (save-excursion (re-search-backward "[^\\]\(" nil t paren)) - (incf paren)) - (and (= (% dquote 2) 1) (= (% paren 2) 1))))) + (save-restriction + (narrow-to-region (save-excursion (or (re-search-backward "^[^ \t]" nil t) + (point-min))) + (save-excursion (or (re-search-forward "^[^ \t]" nil t) + (point-max)))) + (if (re-search-backward "[\\\n\r\t ]" + (save-excursion (search-backward "@" nil t)) t) + ;; whitespace between @ and point + nil + (let ((dquote 1) (paren 1)) + (while (save-excursion (re-search-backward "[^\\]\"" nil t dquote)) + (incf dquote)) + (while (save-excursion (re-search-backward "[^\\]\(" nil t paren)) + (incf paren)) + (and (= (% dquote 2) 1) (= (% paren 2) 1)))))) (autoload 'idna-to-ascii "idna") -- 1.7.10.4