From f49bfaf89b87cf663c86d6e81e5391857fe0e0fe Mon Sep 17 00:00:00 2001 From: yamaoka Date: Thu, 20 Apr 2000 23:17:28 +0000 Subject: [PATCH] Sync with latest Gnus. --- lisp/ChangeLog | 45 ++++++++++++++++++++++++++++++++++++ lisp/gnus-art.el | 39 ++++++++++++++++++++++++------- lisp/gnus-group.el | 5 +++- lisp/gnus-sum.el | 2 +- lisp/gnus-vers.el | 2 +- lisp/mail-source.el | 2 +- lisp/message.el | 32 +++++++++++++++----------- lisp/mm-decode.el | 64 ++++++++++++++++++++++++++++++++++++++++++++++----- lisp/mm-uu.el | 14 +++++++---- lisp/mm-view.el | 25 +++++++++++++++++++- lisp/nnmail.el | 13 +++++++++++ lisp/nnml.el | 7 ++++++ texi/ChangeLog | 8 +++++++ texi/gnus-ja.texi | 14 +++++++++-- texi/gnus.texi | 23 ++++++++++++++---- 15 files changed, 252 insertions(+), 43 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 74238c9..4bf83f3 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,48 @@ +2000-04-20 16:35:41 Shenghuo ZHU + + * mm-uu.el (mm-uu-dissect): Check forwarded message. + +2000-04-20 21:17:48 Lars Magne Ingebrigtsen + + * gnus-art.el (gnus-request-article-this-buffer): Allow + re-selecting referenced articles. + + * message.el (message-cancel-news): Allow editing. + (message-cancel-message): Add newline. + +2000-04-20 21:03:54 William M. Perry + + * mm-view.el (mm-inline-image-emacs): New function. + +2000-04-20 20:44:55 Lars Magne Ingebrigtsen + + * mail-source.el (mail-source-delete-incoming): Change default in + cvs. + +2000-04-20 20:43:34 Kim-Minh Kaplan + + * gnus-art.el (gnus-mime-view-part-as-type-internal): New + function. + +2000-04-20 14:45:20 Lars Magne Ingebrigtsen + + * nnml.el (nnml-request-expire-articles): Use it. + + * nnmail.el (nnmail-expiry-target): New variable. + (nnmail-expiry-target-group): New function. + +2000-04-20 02:36:31 Emerick Rogul + + * message.el (message-forward): Add non-MIME separators. + +2000-04-20 02:25:39 Lars Magne Ingebrigtsen + + * message.el (message-generate-headers): Respect the syntax check + spec. + + * gnus-sum.el (gnus-remove-thread-1): Show thread. + (gnus-remove-thread): Don't show all threads. + Thu Apr 20 01:39:25 2000 Lars Magne Ingebrigtsen * gnus.el: Pterodactyl Gnus v5.8.4 is released. diff --git a/lisp/gnus-art.el b/lisp/gnus-art.el index b8f61d2..e80f58e 100644 --- a/lisp/gnus-art.el +++ b/lisp/gnus-art.el @@ -3218,14 +3218,33 @@ value of the variable `gnus-show-mime' is non-nil." (let ((data (get-text-property (point) 'gnus-data))) (mm-interactively-view-part data))) -(defun gnus-mime-view-part-as-type () +(defun gnus-mime-view-part-as-type-internal () + (gnus-article-check-buffer) + (let* ((name (mail-content-type-get + (mm-handle-type (get-text-property (point) 'gnus-data)) + 'name)) + (def-type (and name (mm-default-file-encoding name)))) + (and def-type (cons def-type 0)))) + +(defun gnus-mime-view-part-as-type (mime-type) "Choose a MIME media type, and view the part as such." (interactive - (list (completing-read "View as MIME type: " - (mapcar 'list (mailcap-mime-types))))) + (list (completing-read + "View as MIME type: " + (mapcar (lambda (i) (list i i)) (mailcap-mime-types)) + nil nil + (gnus-mime-view-part-as-type-internal)))) (gnus-article-check-buffer) (let ((handle (get-text-property (point) 'gnus-data))) - (gnus-mm-display-part handle))) + (gnus-mm-display-part + (mm-make-handle (mm-handle-buffer handle) + (cons mime-type (cdr (mm-handle-type handle))) + (mm-handle-encoding handle) + (mm-handle-undisplayer handle) + (mm-handle-disposition handle) + (mm-handle-description handle) + (mm-handle-cache handle) + (mm-handle-id handle))))) (defun gnus-mime-copy-part (&optional handle) "Put the the MIME part under point into a new buffer." @@ -4118,7 +4137,8 @@ If given a prefix, show the hidden text instead." (gnus-cache-request-article article group)) 'article) ;; Get the article and put into the article buffer. - ((or (stringp article) (numberp article)) + ((or (stringp article) + (numberp article)) (let ((gnus-override-method gnus-override-method) (methods (and (stringp article) gnus-refer-article-method)) @@ -4126,11 +4146,14 @@ If given a prefix, show the hidden text instead." (buffer-read-only nil)) (setq methods (if (listp methods) - (delq 'current methods) + methods (list methods))) - (if (and (null gnus-override-method) methods) - (setq gnus-override-method (pop methods))) + (when (and (null gnus-override-method) + methods) + (setq gnus-override-method (pop methods))) (while (not result) + (when (eq gnus-override-method 'current) + (setq gnus-override-method gnus-current-select-method)) (erase-buffer) (gnus-kill-all-overlays) (let ((gnus-newsgroup-name group)) diff --git a/lisp/gnus-group.el b/lisp/gnus-group.el index 95f77ea..39ac45e 100644 --- a/lisp/gnus-group.el +++ b/lisp/gnus-group.el @@ -2654,7 +2654,10 @@ or nil if no action could be taken." (expirable (if (gnus-group-total-expirable-p group) (cons nil (gnus-list-of-read-articles group)) (assq 'expire (gnus-info-marks info)))) - (expiry-wait (gnus-group-find-parameter group 'expiry-wait))) + (expiry-wait (gnus-group-find-parameter group 'expiry-wait)) + (nnmail-expiry-target + (or (gnus-group-find-parameter group 'expiry-target) + nnmail-expiry-target))) (when expirable (setcdr expirable diff --git a/lisp/gnus-sum.el b/lisp/gnus-sum.el index 75058c6..703766f 100644 --- a/lisp/gnus-sum.el +++ b/lisp/gnus-sum.el @@ -3622,7 +3622,6 @@ If LINE, insert the rebuilt thread starting on line LINE." (while thread (gnus-remove-thread-1 (car thread)) (setq thread (cdr thread)))) - (gnus-summary-show-all-threads) (gnus-remove-thread-1 thread)))))))) (defun gnus-remove-thread-1 (thread) @@ -3634,6 +3633,7 @@ If LINE, insert the rebuilt thread starting on line LINE." (gnus-remove-thread-1 (pop thread))) (when (setq d (gnus-data-find number)) (goto-char (gnus-data-pos d)) + (gnus-summary-show-thread) (gnus-data-remove number (- (gnus-point-at-bol) diff --git a/lisp/gnus-vers.el b/lisp/gnus-vers.el index 709c672..cd56f93 100644 --- a/lisp/gnus-vers.el +++ b/lisp/gnus-vers.el @@ -40,7 +40,7 @@ (list 6 14 2 (string-to-number gnus-revision-number)))) -(defconst gnus-original-version-number "5.8.4" +(defconst gnus-original-version-number "5.8.5" "Version number for this version of Gnus.") (provide 'running-pterodactyl-gnus-0_73-or-later) diff --git a/lisp/mail-source.el b/lisp/mail-source.el index 2017b4e..e57cf27 100644 --- a/lisp/mail-source.el +++ b/lisp/mail-source.el @@ -62,7 +62,7 @@ If non-nil, this maildrop will be checked periodically for new mail." :group 'mail-source :type 'integer) -(defcustom mail-source-delete-incoming t +(defcustom mail-source-delete-incoming nil "*If non-nil, delete incoming files after handling." :group 'mail-source :type 'boolean) diff --git a/lisp/message.el b/lisp/message.el index b69238c..646aa43 100644 --- a/lisp/message.el +++ b/lisp/message.el @@ -431,7 +431,7 @@ The provided functions are: :group 'message-insertion :type 'regexp) -(defcustom message-cancel-message "I am canceling my own article." +(defcustom message-cancel-message "I am canceling my own article.\n" "Message to be inserted in the cancel message." :group 'message-interface :type 'string) @@ -2377,6 +2377,8 @@ be added to \"References\" field. (if (listp message-indent-citation-function) message-indent-citation-function (list message-indent-citation-function))))) + ;; Allow undoing. + (undo-boundary) (goto-char end) (when (re-search-backward message-signature-separator start t) ;; Also peel off any blank lines before the signature. @@ -3838,7 +3840,7 @@ Headers already prepared in the buffer are not modified." ;; The element is a symbol. We insert the value ;; of this symbol, if any. (symbol-value header)) - (t + ((not (message-check-element header)) ;; We couldn't generate a value for this header, ;; so we just ask the user. (read-from-minibuffer @@ -4596,9 +4598,10 @@ that further discussion should take place only in " cur))) ;;;###autoload -(defun message-cancel-news () - "Cancel an article you posted." - (interactive) +(defun message-cancel-news (&optional arg) + "Cancel an article you posted. +If ARG, allow editing of the cancellation message." + (interactive "P") (unless (message-news-p) (error "This is not a news article; canceling is impossible")) (when (yes-or-no-p "Do you really want to cancel this article? ") @@ -4624,7 +4627,9 @@ that further discussion should take place only in " (message-make-from)))))) (error "This article is not yours")) ;; Make control message. - (setq buf (set-buffer (get-buffer-create " *message cancel*"))) + (if arg + (message-news) + (setq buf (set-buffer (get-buffer-create " *message cancel*")))) (erase-buffer) (insert "Newsgroups: " newsgroups "\n" "From: " (message-make-from) "\n" @@ -4637,13 +4642,14 @@ that further discussion should take place only in " message-cancel-message) (run-hooks 'message-cancel-hook) (message "Canceling your article...") - (if (let ((message-syntax-checks - 'dont-check-for-anything-just-trust-me) - (message-encoding-buffer (current-buffer)) - (message-edit-buffer (current-buffer))) - (message-send-news)) - (message "Canceling your article...done")) - (kill-buffer buf))))) + (unless arg + (if (let ((message-syntax-checks + 'dont-check-for-anything-just-trust-me) + (message-encoding-buffer (current-buffer)) + (message-edit-buffer (current-buffer))) + (message-send-news)) + (message "Canceling your article...done")) + (kill-buffer buf)))))) (defun message-supersede-setup-for-mime-edit () (set (make-local-variable 'message-setup-hook) nil) diff --git a/lisp/mm-decode.el b/lisp/mm-decode.el index c34921f..d1ba3d4 100644 --- a/lisp/mm-decode.el +++ b/lisp/mm-decode.el @@ -28,6 +28,8 @@ (require 'gnus-mailcap) (require 'mm-bodies) +(defvar mm-xemacs-p (string-match "XEmacs" (emacs-version))) + (defgroup mime-display () "Display of MIME in mail and news articles." :link '(custom-manual "(emacs-mime)Customization") @@ -732,7 +734,37 @@ external if displayed external." "Return the handle(s) referred to by ID." (cdr (assoc id mm-content-id-alist))) -(defun mm-get-image (handle) +(defun mm-get-image-emacs (handle) + "Return an image instance based on HANDLE." + (let ((type (mm-handle-media-subtype handle)) + spec) + ;; Allow some common translations. + (setq type + (cond + ((equal type "x-pixmap") + "xpm") + ((equal type "x-xbitmap") + "xbm") + (t type))) + (or (mm-handle-cache handle) + (mm-with-unibyte-buffer + (mm-insert-part handle) + (prog1 + (setq spec + (ignore-errors + (cond + ((equal type "xbm") + ;; xbm images require special handling, since + ;; the only way to create glyphs from these + ;; (without a ton of work) is to write them + ;; out to a file, and then create a file + ;; specifier. + (error "Don't know what to do for XBMs right now.")) + (t + (list 'image :type (intern type) :data (buffer-string)))))) + (mm-handle-set-cache handle spec)))))) + +(defun mm-get-image-xemacs (handle) "Return an image instance based on HANDLE." (let ((type (mm-handle-media-subtype handle)) spec) @@ -771,17 +803,37 @@ external if displayed external." (vector (intern type) :data (buffer-string))))))) (mm-handle-set-cache handle spec)))))) +(defun mm-get-image (handle) + (if mm-xemacs-p + (mm-get-image-xemacs handle) + (mm-get-image-emacs handle))) + (defun mm-image-fit-p (handle) "Say whether the image in HANDLE will fit the current window." (let ((image (mm-get-image handle))) - (or mm-inline-large-images - (and (< (glyph-width image) (window-pixel-width)) - (< (glyph-height image) (window-pixel-height)))))) + (if (fboundp 'glyph-width) + ;; XEmacs' glyphs can actually tell us about their width, so + ;; lets be nice and smart about them. + (or mm-inline-large-images + (and (< (glyph-width image) (window-pixel-width)) + (< (glyph-height image) (window-pixel-height)))) + ;; Let's just inline everything under Emacs 21, since the image + ;; specification there doesn't actually get the width/height + ;; until you render the image. + t))) (defun mm-valid-image-format-p (format) "Say whether FORMAT can be displayed natively by Emacs." - (and (fboundp 'valid-image-instantiator-format-p) - (valid-image-instantiator-format-p format))) + (cond + ;; Handle XEmacs + ((fboundp 'valid-image-instantiator-format-p) + (valid-image-instantiator-format-p format)) + ;; Handle Emacs 21 + ((fboundp 'image-type-available-p) + (image-type-available-p format)) + ;; Nobody else can do images yet. + (t + nil))) (defun mm-valid-and-fit-image-p (format handle) "Say whether FORMAT can be displayed natively and HANDLE fits the window." diff --git a/lisp/mm-uu.el b/lisp/mm-uu.el index d5bbaac..984999b 100644 --- a/lisp/mm-uu.el +++ b/lisp/mm-uu.el @@ -165,10 +165,16 @@ To disable dissecting shar codes, for instance, add (setq end-char-1 (match-beginning 0)) (forward-line) (setq end-char (point)) - (when (or (not (eq type 'binhex)) - (setq file-name - (ignore-errors - (binhex-decode-region start-char end-char t)))) + (when (cond + ((eq type 'binhex) + (setq file-name + (ignore-errors + (binhex-decode-region start-char end-char t)))) + ((eq type 'forward) + (save-excursion + (goto-char start-char-1) + (looking-at "[\r\n]*[a-zA-Z][a-zA-Z0-9-]*:"))) + (t t)) (if (> start-char text-start) (push (mm-make-handle (mm-uu-copy-to-buffer text-start start-char) diff --git a/lisp/mm-view.el b/lisp/mm-view.el index fed099b..5e60146 100644 --- a/lisp/mm-view.el +++ b/lisp/mm-view.el @@ -42,8 +42,26 @@ ;;; ;;; Functions for displaying various formats inline ;;; +(defun mm-inline-image-emacs (handle) + (let ((b (point)) + (overlay nil) + (string (copy-sequence "[MM-INLINED-IMAGE]")) + buffer-read-only) + (insert "\n") + (buffer-name) + (setq overlay (make-overlay (point) (point) (current-buffer))) + (put-text-property 0 (length string) 'display (mm-get-image handle) string) + (overlay-put overlay 'before-string string) -(defun mm-inline-image (handle) + (mm-handle-set-undisplayer + handle + `(lambda () + (let (buffer-read-only) + (delete-overlay ,overlay) + (delete-region ,(set-marker (make-marker) b) + ,(set-marker (make-marker) (point)))))))) + +(defun mm-inline-image-xemacs (handle) (let ((b (point)) (annot (make-annotation (mm-get-image handle) nil 'text)) buffer-read-only) @@ -58,6 +76,11 @@ (set-extent-property annot 'mm t) (set-extent-property annot 'duplicable t))) +(defun mm-inline-image (handle) + (if mm-xemacs-p + (mm-inline-image-xemacs handle) + (mm-inline-image-emacs handle))) + (defvar mm-w3-setup nil) (defun mm-setup-w3 () (unless mm-w3-setup diff --git a/lisp/nnmail.el b/lisp/nnmail.el index b86aedb..de29d6a 100644 --- a/lisp/nnmail.el +++ b/lisp/nnmail.el @@ -174,6 +174,13 @@ Eg.: :type '(choice (const :tag "nnmail-expiry-wait" nil) (function :format "%v" nnmail-))) +(defcustom nnmail-expiry-target 'delete + "*Variable that says where expired messages should end up." + :group 'nnmail-expire + :type '(choice (const delete) + (function :format "%v" nnmail-) + string)) + (defcustom nnmail-cache-accepted-message-ids nil "If non-nil, put Message-IDs of Gcc'd articles into the duplicate cache." :group 'nnmail @@ -1529,6 +1536,12 @@ See the documentation for the variable `nnmail-split-fancy' for documentation." ;; Compare the time with the current time. (ignore-errors (time-less-p days (time-since time)))))))) +(defun nnmail-expiry-target-group (target group) + (when (nnheader-functionp target) + (setq target (funcall target group))) + (unless (eq target 'delete) + (gnus-request-accept-article target))) + (defun nnmail-check-syntax () "Check (and modify) the syntax of the message in the current buffer." (save-restriction diff --git a/lisp/nnml.el b/lisp/nnml.el index d512cd2..f4ab37d 100644 --- a/lisp/nnml.el +++ b/lisp/nnml.el @@ -287,6 +287,13 @@ all. This may very well take some time.") (nnmail-expired-article-p group mod-time force nnml-inhibit-expiry))) (progn + ;; Allow a special target group. + (unless (eq nnmail-expiry-target 'delete) + (with-temp-buffer + (nnml-request-article article group server + (current-buffer)) + (nnmail-expiry-target-group + nnmail-expiry-target group))) (nnheader-message 5 "Deleting article %s in %s" article group) (condition-case () diff --git a/texi/ChangeLog b/texi/ChangeLog index ad588ba..7b9c52e 100644 --- a/texi/ChangeLog +++ b/texi/ChangeLog @@ -1,3 +1,11 @@ +2000-04-20 20:37:48 Pavel Janik + + * gnus.texi (Limiting): Fix. + +2000-04-20 20:32:40 Dmitry Yaitskov + + * gnus.texi (Charsets): Typo fix. + 2000-03-19 Simon Josefsson * gnus.texi (IMAP): Addition. diff --git a/texi/gnus-ja.texi b/texi/gnus-ja.texi index 94089ba..e5331c7 100644 --- a/texi/gnus-ja.texi +++ b/texi/gnus-ja.texi @@ -5238,7 +5238,7 @@ Prefixes})$(B!#(B @kindex / x ($(B35N,(B) @findex gnus-summary-limit-to-extra ``$(BDI2C(B'' $(B$N%X%C%@!<$N0l$D$K9gCW$9$k5-;v$K35N,%P%C%U%!$r@)8B$7$^$9(B -(@pxref{To From Newsgroups}) (@code{gnus-summary-limit-to-author}). +(@pxref{To From Newsgroups}) (@code{gnus-summary-limit-to-extra}). @item / u @itemx x @@ -5260,7 +5260,7 @@ Prefixes})$(B!#(B @kindex / t $(B!J35N,!K(B @findex gnus-summary-limit-to-age $(B?t;z$r?R$M$F!"35N,%P%C%U%!$r$=$N?t;z$NF|$h$j8E$$!J$b$7$/$OF1$8!K5-;v$K@)8B(B -$(B$7$^$9(B (@code{gnus-summary-limit-to-marks})$(B!#$b$7@\F,0z?t$,M?$($i$l$l$P!"(B +$(B$7$^$9(B (@code{gnus-summary-limit-to-age})$(B!#$b$7@\F,0z?t$,M?$($i$l$l$P!"(B $(B$=$N?t;z$NF|$h$j$b?7$7$$5-;v$K@)8B$7$^$9!#(B @item / n @@ -11295,6 +11295,16 @@ Gnus $(B$O5-;v$,$I$N%0%k!<%W$KB0$7$F$$$k$+$K4p$E$$$F!"$=$l$,$I$N$/$i$$@8B8(B $(B4|8B@Z$l4|4V$rA*BrE*$KJQ99$9$k$?$a$K%0%k!<%W%Q%i%a!<%?(B @code{expiry-wait} $(B$r;H$&;v$b$G$-$^$9(B (@pxref{Group Parameters})$(B!#(B +@vindex nnmail-expiry-target +$(B5-;v$N4|8B@Z$l>C5n$NIaDL$NF0:n$O$=$l$i$r>C5n$9$k$3$H$G$9!#$7$+$7!">l9g$K(B +$(B$h$C$F$O$=$l$i$r>C5n$9$k$h$j$bJL$N%0%k!<%W$K0\F0$7$?J}$,M-0U5A$+$b$7$l$^(B +$(B$;$s!#(B@code{nnmail-expiry-target} ($(B$H%0%k!<%W%Q%i%a!<%?(B +@code{expiry-target}) $(B$O$3$l$r@)8f$7$^$9!#%G%#%U%)%k%H$NCM$O(B +@code{delete} $(B$G$9$,!"J8;zNs(B ($(B5-;v$r0\F0$9$k@h$N%0%k!<%WL>(B) $(B$^$?$O0\F0@h(B +$(B$N%0%k!<%WL>$+(B @code{delete} $(B$rJV$94X?t(B ($(B5-;v$KHO0O$r69$a$?%P%C%U%!$G!"(B +$(B$=$N5-;v$,B8:_$7$F$$$k%0%k!<%WL>$,0z?t$H$7$FM?$($i$l$^$9(B) $(B$K$9$k$3$H$,$G(B +$(B$-$^$9!#(B + @vindex nnmail-keep-last-article @code{nnmail-keep-last-article} $(B$,(B @code{nil} $(B$G$J$$$H!"(Bgnus $(B$O%a!<%k%K%e!<(B $(B%9%0%k!<%W$N:G8e$N5-;v$r7h$7$F4|8B@Z$l>C5n$7$^$;$s!#$3$l$O(B procmail $(B$NMx(B diff --git a/texi/gnus.texi b/texi/gnus.texi index 01a6e82..2cb8e37 100644 --- a/texi/gnus.texi +++ b/texi/gnus.texi @@ -5240,7 +5240,7 @@ Limit the summary buffer to articles that match some author @findex gnus-summary-limit-to-extra Limit the summary buffer to articles that match one of the ``extra'' headers (@pxref{To From Newsgroups}) -(@code{gnus-summary-limit-to-author}). +(@code{gnus-summary-limit-to-extra}). @item / u @itemx x @@ -5262,7 +5262,7 @@ with that mark (@code{gnus-summary-limit-to-marks}). @kindex / t (Summary) @findex gnus-summary-limit-to-age Ask for a number and then limit the summary buffer to articles older than (or equal to) that number of days -(@code{gnus-summary-limit-to-marks}). If given a prefix, limit to +(@code{gnus-summary-limit-to-age}). If given a prefix, limit to articles younger than that number of days. @item / n @@ -7684,7 +7684,9 @@ the same manner: @table @kbd @item K b @kindex K b (Summary) -Make all the @sc{mime} parts have buttons in from of them. +Make all the @sc{mime} parts have buttons in from of them. This is +mostly useful if you wish to save (or perform other actions) on inlined +parts. @item K m @kindex K m (Summary) @@ -7818,8 +7820,7 @@ for posting. Each element of the alist has the form @code{(}@var{test header body-list}@code{)}, where: @table @var -@item -test +@item test is either a regular expression matching the newsgroup header or a variable to query, @item header @@ -11738,6 +11739,18 @@ necessarily an integer) or one of the symbols @code{immediate} or You can also use the @code{expiry-wait} group parameter to selectively change the expiry period (@pxref{Group Parameters}). +@vindex nnmail-expiry-target +The normal action taken when expiring articles is to delete them. +However, in some circumstances it might make more sense to move them to +other groups instead of deleting them. The @code{nnmail-expiry-target} +(and the @code{expiry-target} group parameter) controls this. The +default value is @code{delete}, but this can also be a string (which +should be the name of the group the message should be moved to), or a +function (which will be called in a buffer narrowed to the message in +question, and with the name of the group being moved from as its +parameter) which should return a target -- either a group name or +@code{delete}. + @vindex nnmail-keep-last-article If @code{nnmail-keep-last-article} is non-@code{nil}, Gnus will never expire the final article in a mail newsgroup. This is to make life -- 1.7.10.4