From acc0a01c763be5c724f545734b24019c208d47cd Mon Sep 17 00:00:00 2001 From: yamaoka Date: Tue, 27 Sep 2005 22:26:16 +0000 Subject: [PATCH] Synch to No Gnus 200509272038. --- lisp/ChangeLog | 41 +++++++++++++++++++++++++++++++++++++++++ lisp/gnus-art.el | 8 +++++--- lisp/message.el | 46 +++++++++++++++++++++++++++++++--------------- lisp/mm-decode.el | 3 ++- lisp/mm-uu.el | 46 ++++++++++++++++++++++++++++++++++++++++------ texi/ChangeLog | 5 +++++ texi/emacs-mime.texi | 19 +++++++++++++++++++ 7 files changed, 143 insertions(+), 25 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index fc0483f..a943d03 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,44 @@ +2005-09-27 Reiner Steib + + * mm-uu.el (mm-uu-emacs-sources-regexp): Make variable + customizable. Change default value. + (mm-uu-diff-groups-regexp): Change default value. + (mm-uu-type-alist): Added doc string. + (mm-uu-configure): Added doc string. Make it interactive. + (mm-uu-tex-groups-regexp): New variable. + (mm-uu-latex-extract, mm-uu-latex-test): New functions. + (mm-uu-type-alist): Added LaTeX documents. + (mm-uu-verbatim-marks-extract): Use "text/x-gnus-verbatim" instead + of "text/verbatim".. + (mm-uu-diff-groups-regexp): Fix missing quotes from previous + commit. + + * mm-decode.el (mm-automatic-display): Use "text/x-gnus-verbatim" + instead of "text/verbatim". + + * message.el (message-mark-inserted-region) + (message-mark-insert-file): Use slrn style marks when called with + prefix argument. + +2005-09-27 Simon Josefsson + + * message.el (message-idna-to-ascii-rhs-1): Reformat. + +2005-09-27 Arne J,Ax(Brgensen + + * message.el (message-remove-duplicates): New function. + Implementation borrowed from `gnus-remove-duplicates'. + (message-idna-to-ascii-rhs): Also encode idna addresses in + Reply-To:, Mail-Reply-To: and Mail-Followup-To:. + (message-idna-to-ascii-rhs-1): When `message-use-idna' is 'ask + only ask about the same idna domain once per header and also tell + in what header to replace the idna domain. + + * gnus-art.el (article-decode-idna-rhs): Also decode idna + addresses in Reply-To:, Mail-Reply-To: and Mail-Followup-To:. + (article-decode-idna-rhs): Fix regexp so that all idna-address in + a header is decoded and not just the last one. + 2005-09-27 Katsumi Yamaoka * gnus-art.el (gnus-mime-display-single): Don't modify text if it diff --git a/lisp/gnus-art.el b/lisp/gnus-art.el index ea47716..e2ebd6b 100644 --- a/lisp/gnus-art.el +++ b/lisp/gnus-art.el @@ -2500,20 +2500,22 @@ If PROMPT (the prefix), prompt for a coding system to use." (autoload 'idna-to-unicode "idna") (defun article-decode-idna-rhs () - "Decode IDNA strings in RHS in From:, To: and Cc: headers in current buffer." + "Decode IDNA strings in RHS in various headers in current buffer. +The following headers are decoded: From:, To:, Cc:, Reply-To:, +Mail-Reply-To: and Mail-Followup-To:." (when gnus-use-idna (save-restriction (let ((inhibit-point-motion-hooks t) (inhibit-read-only t)) (article-narrow-to-head) (goto-char (point-min)) - (while (re-search-forward "@.*\\(xn--[-A-Za-z0-9.]*\\)[ \t\n\r,>]" nil t) + (while (re-search-forward "@[^ \t\n\r,>]*\\(xn--[-A-Za-z0-9.]*\\)[ \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"))) + (looking-at "From\\|To\\|Cc\\|Reply-To\\|Mail-Reply-To\\|Mail-Followup-To"))) (setq unicode (idna-to-unicode ace)))) (unless (string= ace unicode) (replace-match unicode nil nil nil 1))))))))) diff --git a/lisp/message.el b/lisp/message.el index ee3a7de..274f861 100644 --- a/lisp/message.el +++ b/lisp/message.el @@ -2125,29 +2125,31 @@ Leading \"Re: \" is not stripped by this function. Use the function old-subject ")\n"))))))))) ;;;###autoload -(defun message-mark-inserted-region (beg end) +(defun message-mark-inserted-region (beg end &optional verbatim) "Mark some region in the current article with enclosing tags. -See `message-mark-insert-begin' and `message-mark-insert-end'." - (interactive "r") +See `message-mark-insert-begin' and `message-mark-insert-end'. +If VERBATIM, use slrn style verbatim marks (\"#v+\" and \"#v-\")." + (interactive "r\nP") (save-excursion ;; add to the end of the region first, otherwise end would be invalid (goto-char end) - (insert message-mark-insert-end) + (insert (if verbatim "#v-\n" message-mark-insert-end)) (goto-char beg) - (insert message-mark-insert-begin))) + (insert (if verbatim "#v+\n" message-mark-insert-begin)))) ;;;###autoload -(defun message-mark-insert-file (file) +(defun message-mark-insert-file (file &optional verbatim) "Insert FILE at point, marking it with enclosing tags. -See `message-mark-insert-begin' and `message-mark-insert-end'." - (interactive "fFile to insert: ") +See `message-mark-insert-begin' and `message-mark-insert-end'. +If VERBATIM, use slrn style verbatim marks (\"#v+\" and \"#v-\")." + (interactive "fFile to insert: \nP") ;; reverse insertion to get correct result. (let ((p (point))) - (insert message-mark-insert-end) + (insert (if verbatim "#v-\n" message-mark-insert-end)) (goto-char p) (insert-file-contents file) (goto-char p) - (insert message-mark-insert-begin))) + (insert (if verbatim "#v+\n" message-mark-insert-begin)))) ;;;###autoload (defun message-add-archive-header () @@ -2315,6 +2317,14 @@ With prefix-argument just set Follow-Up, don't cross-post." ;;; End of functions adopted from `message-utils.el'. +(defun message-remove-duplicates (list) + (let (new) + (while list + (or (member (car list) new) + (setq new (cons (car list) new))) + (setq list (cdr list))) + (nreverse new))) + (defun message-remove-header (header &optional is-regexp first reverse) "Remove HEADER in the narrowed buffer. If IS-REGEXP, HEADER is a regular expression. @@ -5625,13 +5635,17 @@ subscribed address (and not the additional To and Cc header contents)." (let ((field (message-fetch-field header)) rhs ace address) (when field - (dolist (address (mail-header-parse-addresses field)) - (setq address (car address) - rhs (downcase (or (cadr (split-string address "@")) "")) - ace (downcase (idna-to-ascii rhs))) + (dolist (rhs + (message-remove-duplicates + (mapcar (lambda (rhs) (or (cadr (split-string rhs "@")) "")) + (mapcar 'downcase + (mapcar + 'car (mail-header-parse-addresses field)))))) + (setq ace (downcase (idna-to-ascii rhs))) (when (and (not (equal rhs ace)) (or (not (eq message-use-idna 'ask)) - (y-or-n-p (format "Replace %s with %s? " rhs ace)))) + (y-or-n-p (format "Replace %s with %s in %s:? " + rhs ace header)))) (goto-char (point-min)) (while (re-search-forward (concat "^" header ":") nil t) (message-narrow-to-field) @@ -5651,6 +5665,8 @@ See `message-idna-encode'." (message-idna-to-ascii-rhs-1 "From") (message-idna-to-ascii-rhs-1 "To") (message-idna-to-ascii-rhs-1 "Reply-To") + (message-idna-to-ascii-rhs-1 "Mail-Reply-To") + (message-idna-to-ascii-rhs-1 "Mail-Followup-To") (message-idna-to-ascii-rhs-1 "Cc"))))) (defun message-generate-headers (headers) diff --git a/lisp/mm-decode.el b/lisp/mm-decode.el index 0fc4f4b..f39118a 100644 --- a/lisp/mm-decode.el +++ b/lisp/mm-decode.el @@ -291,7 +291,8 @@ when selecting a different article." :group 'mime-display) (defcustom mm-automatic-display - '("text/plain" "text/enriched" "text/richtext" "text/html" "text/verbatim" + '("text/plain" "text/enriched" "text/richtext" "text/html" + "text/x-gnus-verbatim" "text/x-vcard" "image/.*" "message/delivery-status" "multipart/.*" "message/rfc822" "text/x-patch" "text/dns" "application/pgp-signature" "application/emacs-lisp" "application/x-emacs-lisp" diff --git a/lisp/mm-uu.el b/lisp/mm-uu.el index d4410d7..4675e3a 100644 --- a/lisp/mm-uu.el +++ b/lisp/mm-uu.el @@ -77,15 +77,25 @@ decoder, such as hexbin." "The default disposition of uu parts. This can be either \"inline\" or \"attachment\".") -(defvar mm-uu-emacs-sources-regexp "gnu\\.emacs\\.sources" - "The regexp of Emacs sources groups.") +(defcustom mm-uu-emacs-sources-regexp "\\.emacs\\.sources" + "The regexp of Emacs sources groups." + :version "22.1" + :type 'regexp + :group 'gnus-article-mime) -(defcustom mm-uu-diff-groups-regexp "gnus\\.commits" - "*Regexp matching diff groups." +(defcustom mm-uu-diff-groups-regexp + "\\(gmane\\|gnu\\)\\..*\\(diff\\|commit\\|cvs\\|bug\\|devel\\)" + "Regexp matching diff groups." :version "22.1" :type 'regexp :group 'gnus-article-mime) +(defcustom mm-uu-tex-groups-regexp "\\.tex\\>" + "*Regexp matching TeX groups." + :version "23.0" + :type 'regexp + :group 'gnus-article-mime) + (defvar mm-uu-type-alist '((postscript "^%!PS-" @@ -160,7 +170,18 @@ This can be either \"inline\" or \"attachment\".") "^#v\\+$" "^#v\\-$" mm-uu-verbatim-marks-extract - nil))) + nil) + (LaTeX + "^\\\\documentclass" + "^\\\\end{document}" + mm-uu-latex-extract + nil + mm-uu-latex-test)) + "A list of specifications for non-MIME attachments. +Each element consist of the following entries: label, +start-regexp, end-regexp, extract-function, test-function. + +After modifying this list you must run \\[mm-uu-configure].") (defcustom mm-uu-configure-list '((shar . disabled)) "A list of mm-uu configuration. @@ -236,6 +257,8 @@ apply the face `mm-uu-extract'." (member (cons key val) mm-uu-configure-list)) (defun mm-uu-configure (&optional symbol value) + "Configure detection of non-MIME attachments." + (interactive) (if symbol (set-default symbol value)) (setq mm-uu-beginning-regexp nil) (mapcar (lambda (entry) @@ -289,7 +312,13 @@ apply the face `mm-uu-extract'." (progn (goto-char start-point) (forward-line) (point)) (progn (goto-char end-point) (forward-line -1) (point)) t) - '("text/verbatim" (charset . gnus-decoded)))) + '("text/x-gnus-verbatim" (charset . gnus-decoded)))) + +(defun mm-uu-latex-extract () + (mm-make-handle + (mm-uu-copy-to-buffer start-point end-point t) + ;; application/x-tex? + '("text/x-gnus-verbatim" (charset . gnus-decoded)))) (defun mm-uu-emacs-sources-extract () (mm-make-handle (mm-uu-copy-to-buffer start-point end-point) @@ -316,6 +345,11 @@ apply the face `mm-uu-extract'." mm-uu-diff-groups-regexp (string-match mm-uu-diff-groups-regexp gnus-newsgroup-name))) +(defun mm-uu-latex-test () + (and gnus-newsgroup-name + mm-uu-tex-groups-regexp + (string-match mm-uu-tex-groups-regexp gnus-newsgroup-name))) + (defun mm-uu-forward-extract () (mm-make-handle (mm-uu-copy-to-buffer (progn (goto-char start-point) (forward-line) (point)) diff --git a/texi/ChangeLog b/texi/ChangeLog index fbfb8a8..1b3923e 100644 --- a/texi/ChangeLog +++ b/texi/ChangeLog @@ -1,3 +1,8 @@ +2005-09-27 Reiner Steib + + * emacs-mime.texi (Non-MIME): Add Slrn-style verbatim marks and + LaTeX documents. Describe "text/x-gnus-verbatim". + 2005-09-26 Katsumi Yamaoka * gnus.texi (Server Buffer Format): Document the %a format spec. diff --git a/texi/emacs-mime.texi b/texi/emacs-mime.texi index 21af535..10cf8f9 100644 --- a/texi/emacs-mime.texi +++ b/texi/emacs-mime.texi @@ -176,8 +176,27 @@ Patches. This is intended for groups where diffs of committed files are automatically sent to. It only works in groups matching @code{mm-uu-diff-groups-regexp}. +@item verbatim-marks +@cindex verbatim-marks +Slrn-style verbatim marks. + +@item LaTeX +@cindex LaTeX +LaTeX documents. It only works in groups matching +@code{mm-uu-tex-groups-regexp}. + @end table +@cindex text/x-gnus-verbatim +@c Is @vindex suitable for a face? +@vindex mm-uu-extract +Some inlined non-@acronym{MIME} attachments are displayed using the face +@code{mm-uu-extract}. By default, no @acronym{MIME} button for these +parts is displayed. You can force displaying a button using @kbd{K b} +(@code{gnus-summary-display-buttonized}) or add @code{text/x-gnus-verbatim} to +@code{gnus-buttonized-mime-types}, @xref{MIME Commands, ,MIME +Commands, gnus, Gnus Manual}. + @node Handles @section Handles -- 1.7.10.4