+2003-03-30 Simon Josefsson <jas@extundo.com>
+
+ * 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 <larsi@gnus.org>
* gnus-registry.el (gnus-registry-translate-to-alist): Make a
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))
"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")