From: yamaoka Date: Fri, 9 May 2003 00:41:05 +0000 (+0000) Subject: Synch to Gnus 200305082302. X-Git-Url: http://git.chise.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=aa9bdf2c55867cef040628a463096793e98f2ad5;p=elisp%2Fgnus.git- Synch to Gnus 200305082302. --- diff --git a/contrib/gnus-idna.el b/contrib/gnus-idna.el deleted file mode 100644 index 15c47b6..0000000 --- a/contrib/gnus-idna.el +++ /dev/null @@ -1,154 +0,0 @@ -;;; gnus-idna.el --- Internationalized domain names support for Gnus. - -;; Copyright (C) 2003 Free Software Foundation, Inc. - -;; Author: Simon Josefsson -;; Keywords: news, mail - -;; This file is part of GNU Emacs. - -;; GNU Emacs is free software; you can redistribute it and/or modify -;; it under the terms of the GNU General Public License as published by -;; the Free Software Foundation; either version 2, or (at your option) -;; any later version. - -;; GNU Emacs is distributed in the hope that it will be useful, -;; but WITHOUT ANY WARRANTY; without even the implied warranty of -;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -;; GNU General Public License for more details. - -;; You should have received a copy of the GNU General Public License -;; along with GNU Emacs; see the file COPYING. If not, write to the -;; Free Software Foundation, Inc., 59 Temple Place - Suite 330, -;; Boston, MA 02111-1307, USA. - -;;; Commentary: - -;; This package implement crude support for internationalized domain -;; names in Gnus. - -;; Theory of Operation: - -;; RFC 2822 RHS's inside the From:, To:, and CC: headers are encoded -;; using IDNA ToASCII() when you send mail using Message. The hook -;; used is message-send-hook. -;; -;; For incoming articles, when QP in headers are decoded (i.e., when -;; gnus-article-decode-hook is invoked), it searches for "xn--" -;; prefixes and decode them if they are found inside (heuristically -;; determined) RHS in From:, To: and Cc:, using IDNA ToUnicode(). - -;; Usage: - -;; You need to install GNU Libidn (0.1.11 or later) and make sure the -;; idna.el installed by it is found by emacs. - -;; If you use an older Gnus, you may need to put the following in your -;; init scripts too, but keep in mind that most older Gnuses either -;; doesn't have these hooks or are buggy in other regards so it -;; doesn't work anyway. (The window of Gnus versions that this works -;; on is a few weeks during the Oort CVS in winter 2003.) Update to a -;; recent Gnus instead, then you don't have to do anything. - -;; (add-hook 'message-send-hook 'message-idna-to-ascii-rhs) -;; (add-hook 'gnus-article-decode-hook 'gnus-idna-to-unicode-rhs 'append) - -;; Revision history: - -;; 2003-02-26 Initial release -;; -;; 2003-03-19 Cleanup. Fixes a bug that may corrupt outgoing mail if -;; it contains From:, To: or Cc: headers in the body. - -;;; Code: - -(require 'gnus) -(require 'gnus-util) -(require 'rfc822) -(autoload 'idna-to-ascii "idna") -(autoload 'idna-to-unicode "idna") - -(defcustom message-use-idna 'ask - "Whether to encode non-ASCII in domain names into ASCII according to IDNA." - :type '(choice (const :tag "Ask" ask) - (const :tag "Never" nil) - (const :tag "Always" t))) - -(defun message-idna-inside-rhs-p () - "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))))) - -(defun message-idna-to-ascii-rhs-1 (header) - "Interactively potentially IDNA encode domain names in HEADER." - (let (rhs ace start end startpos endpos) - (goto-char (point-min)) - (setq start (re-search-forward (concat "^" header) nil t) - end (or (save-excursion (re-search-forward "^[ \t]" nil t)) - (point-max))) - (when (and start end) - (while (re-search-forward "@\\([^ \t\r\n>]+\\)" end t) - (setq rhs (match-string-no-properties 1) - startpos (match-beginning 1) - endpos (match-end 1)) - (when (save-match-data - (and (message-idna-inside-rhs-p) - (setq ace (idna-to-ascii rhs)) - (not (string= rhs ace)) - (if (eq message-use-idna 'ask) - (unwind-protect - (progn - (replace-highlight startpos endpos) - (y-or-n-p - (format "Replace with `%s'? " ace))) - (message "") - (replace-dehighlight)) - message-use-idna))) - (replace-match (concat "@" ace))))))) - -;;;###autoload -(defun message-idna-to-ascii-rhs () - "Possibly IDNA encode non-ASCII domain names in From:, To: and Cc: headers. -See `message-idna-encode'." - (interactive) - (when (condition-case nil (require 'idna) (file-error)) - (save-excursion - (save-restriction - (message-narrow-to-head) - (message-idna-to-ascii-rhs-1 "From") - (message-idna-to-ascii-rhs-1 "To") - (message-idna-to-ascii-rhs-1 "Cc"))))) - -;;;###autoload -(defun gnus-idna-to-unicode-rhs () - "Decode IDNA strings in RHS in From:, To: and Cc: headers in current buffer." - (when (condition-case nil (require 'idna) (file-error)) - (let ((inhibit-point-motion-hooks t) - buffer-read-only) - (article-narrow-to-head) - (goto-char (point-min)) - (while (re-search-forward "\\(xn--.*\\)[ \t\n\r,>]" nil t) - (let (ace unicode) - (when (save-match-data - (and (setq ace (match-string 1)) - (save-excursion (and (re-search-backward "^[^ \t]" nil t) - (looking-at "From\\|To\\|Cc"))) - (save-excursion (backward-char) - (message-idna-inside-rhs-p)) - (setq unicode (idna-to-unicode ace)))) - (unless (string= ace unicode) - (replace-match unicode nil nil nil 1)))))))) - -(provide 'gnus-idna) - -;; gnus-idna.el ends here diff --git a/lisp/ChangeLog b/lisp/ChangeLog index eeb9619..cf77b81 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,20 @@ +2003-05-09 Jesper Harder + + * gnus-picon.el (gnus-picon-transform-address): Parse the encoded + address. + +2003-05-08 Teodor Zlatanov + + * gnus-start.el (gnus-clear-system): added gnus-registry-alist to + the list of cleared variables + + * gnus-registry.el (gnus-registry-split-fancy-with-parent): + nnmail-split-fancy-with-parent-ignore-groups can be a single regex + in addition to a list of regexes. + + * spam.el (spam-use-regex-headers): docstring fix. From Niklas + Morberg + 2003-05-08 Kai Gro,A_(Bjohann * gnus-sum.el (gnus-summary-next-page): Mention diff --git a/lisp/gnus-picon.el b/lisp/gnus-picon.el index ae2d107..8fed51f 100644 --- a/lisp/gnus-picon.el +++ b/lisp/gnus-picon.el @@ -1,6 +1,6 @@ ;;; gnus-picon.el --- displaying pretty icons in Gnus -;; Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002 +;; Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 ;; Free Software Foundation, Inc. ;; Author: Wes Hardaker @@ -153,7 +153,11 @@ GLYPH can be either a glyph or a string." (defun gnus-picon-transform-address (header category) (gnus-with-article-headers (let ((addresses - (mail-header-parse-addresses (mail-fetch-field header))) + (mail-header-parse-addresses + ;; mail-header-parse-addresses does not work (reliably) on + ;; decoded headers. + (mail-encode-encoded-word-string + (or (mail-fetch-field header) "")))) spec file point cache) (dolist (address addresses) (setq address (car address)) diff --git a/lisp/gnus-registry.el b/lisp/gnus-registry.el index 9cc54cd..4da392c 100644 --- a/lisp/gnus-registry.el +++ b/lisp/gnus-registry.el @@ -134,8 +134,11 @@ see which group that message was put in. This group is returned. See the Info node `(gnus)Fancy Mail Splitting' for more details." (let ((refstr (or (message-fetch-field "references") (message-fetch-field "in-reply-to"))) - (references nil) - (res nil)) + (nnmail-split-fancy-with-parent-ignore-groups + (if (listp nnmail-split-fancy-with-parent-ignore-groups) + nnmail-split-fancy-with-parent-ignore-groups + (list nnmail-split-fancy-with-parent-ignore-groups))) + references res) (when refstr (setq references (nreverse (gnus-split-references refstr))) (mapcar (lambda (x) diff --git a/lisp/gnus-start.el b/lisp/gnus-start.el index bee9b60..87485d5 100644 --- a/lisp/gnus-start.el +++ b/lisp/gnus-start.el @@ -697,7 +697,8 @@ the first newsgroup." nnoo-state-alist nil gnus-current-select-method nil nnmail-split-history nil - gnus-ephemeral-servers nil) + gnus-ephemeral-servers nil + gnus-registry-alist nil) (gnus-shutdown 'gnus) ;; Kill the startup file. (and gnus-current-startup-file diff --git a/lisp/spam.el b/lisp/spam.el index 4f84c11..477b052 100644 --- a/lisp/spam.el +++ b/lisp/spam.el @@ -141,7 +141,7 @@ are considered spam." (defcustom spam-use-regex-headers nil "Whether a header regular expression match should be used by spam-split. -Also see the variable `spam-spam-regex-headers' and `spam-ham-regex-headers'." +Also see the variables `spam-regex-headers-spam' and `spam-regex-headers-ham'." :type 'boolean :group 'spam)