From 4a1ba81848ba228b388671d846d1099ea1652390 Mon Sep 17 00:00:00 2001 From: yamaoka Date: Wed, 18 Nov 1998 07:18:01 +0000 Subject: [PATCH] Importing Pterodactyl Gnus v0.50. --- lisp/ChangeLog | 56 ++++++++++++++++++++++++++++++++++++++++++++++ lisp/gnus-sum.el | 63 +++++++++++++++++++++++++++------------------------- lisp/gnus-topic.el | 14 ++++++++++++ lisp/gnus.el | 3 ++- lisp/mm-decode.el | 5 +++-- lisp/mml.el | 46 +++++++++++++++++++++++++++++--------- texi/ChangeLog | 1 + texi/gnus.texi | 39 ++++++++++++++++++++------------ texi/message.texi | 6 ++--- 9 files changed, 173 insertions(+), 60 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index b969ad0..28b6c47 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,59 @@ +Wed Nov 18 05:06:44 1998 Lars Magne Ingebrigtsen + + * gnus.el: Pterodactyl Gnus v0.50 is released. + +1998-11-18 04:42:01 Lars Magne Ingebrigtsen + + * mm-decode.el (mm-inline-media-tests): Check that device-type is + fbound. + + * gnus-sum.el (gnus-summary-sort): Didn't do reverse. + +1998-11-07 23:39:48 Simon Josefsson + + * gnus.el (gnus-similar-server-opened): Compare backend. + +1998-11-08 03:37:42 Simon Josefsson + + * gnus-topic.el (gnus-topic-expire-articles): New function. + (gnus-topic-mode-map): Bind it. + + * gnus.texi (Topic Commands): New expiry command. Reordered. + +1998-11-10 Miles Bader + + * gnus-sum.el + (gnus-auto-expirable-marks): New variable. + (gnus-inhibit-user-auto-expire): New variable. + (gnus-summary-mark-article-as-read, gnus-summary-mark-article): + When looking to see if we should expire instead, check + gnus-auto-expirable-marks instead of using a hard-wired list. + (gnus-summary-mark-as-read-forward, + gnus-summary-mark-as-read-backward): + Pass gnus-inhibit-user-auto-expire for the no-expire argument to + gnus-summary-mark-forward, instead of `t'. + +1998-11-18 03:30:26 Lars Magne Ingebrigtsen + + * mml.el (mml-compute-boundary): New function. + (mml-compute-boundary-1): New function. + (mml-generate-mime-1): Use it. + +1998-11-18 Hrvoje Niksic + + * mml.el (mml-generate-mime-1): Always precede closing boundary + with newline. + +1998-11-18 02:36:37 Lars Magne Ingebrigtsen + + * mml.el (mml-generate-mime-1): Do right boundaries when several + multiparts. + + * mm-decode.el (mm-user-automatic-display): Default to inline + jpeg. + + * mml.el (mml-generate-mime-1): Encode non-text parts. + Wed Nov 18 02:22:23 1998 Lars Magne Ingebrigtsen * gnus.el: Pterodactyl Gnus v0.49 is released. diff --git a/lisp/gnus-sum.el b/lisp/gnus-sum.el index 89b3940..8be8168 100644 --- a/lisp/gnus-sum.el +++ b/lisp/gnus-sum.el @@ -475,6 +475,19 @@ It uses the same syntax as the `gnus-split-methods' variable." :group 'gnus-extract-view :type 'boolean) +(defcustom gnus-auto-expirable-marks + (list gnus-killed-mark gnus-del-mark gnus-catchup-mark + gnus-low-score-mark gnus-ancient-mark gnus-read-mark + gnus-souped-mark gnus-duplicate-mark) + "*The list of marks converted into expiration if a group is auto-expirable." + :group 'gnus-summary + :type '(repeat character)) + +(defcustom gnus-inhibit-user-auto-expire nil + "*If non-nil, user marking commands will not mark an article as expirable, even if the group has auto-expire turned on." + :group 'gnus-summary + :type 'boolean) + (defcustom gnus-view-pseudos nil "*If `automatic', pseudo-articles will be viewed automatically. If `not-confirm', pseudos will be viewed automatically, and the user @@ -7775,11 +7788,7 @@ returned." (setq mark (gnus-request-update-mark gnus-newsgroup-name article mark)) ;; Check for auto-expiry. (when (and gnus-newsgroup-auto-expire - (or (= mark gnus-killed-mark) (= mark gnus-del-mark) - (= mark gnus-catchup-mark) (= mark gnus-low-score-mark) - (= mark gnus-ancient-mark) - (= mark gnus-read-mark) (= mark gnus-souped-mark) - (= mark gnus-duplicate-mark))) + (memq mark gnus-auto-expirable-marks)) (setq mark gnus-expirable-mark) ;; Let the backend know about the mark change. (setq mark (gnus-request-update-mark gnus-newsgroup-name article mark)) @@ -7830,25 +7839,21 @@ returned." "Mark ARTICLE with MARK. MARK can be any character. Four MARK strings are reserved: `? ' (unread), `?!' (ticked), `??' (dormant) and `?E' (expirable). -If MARK is nil, then the default character `?D' is used. +If MARK is nil, then the default character `?r' is used. If ARTICLE is nil, then the article on the current line will be marked." ;; The mark might be a string. (when (stringp mark) (setq mark (aref mark 0))) ;; If no mark is given, then we check auto-expiring. - (and (not no-expire) - gnus-newsgroup-auto-expire - (or (not mark) - (and (gnus-characterp mark) - (or (= mark gnus-killed-mark) (= mark gnus-del-mark) - (= mark gnus-catchup-mark) (= mark gnus-low-score-mark) - (= mark gnus-read-mark) (= mark gnus-souped-mark) - (= mark gnus-duplicate-mark)))) - (setq mark gnus-expirable-mark)) - (let* ((mark (or mark gnus-del-mark)) - (article (or article (gnus-summary-article-number))) - (old-mark (gnus-summary-article-mark article))) + (when (null mark) + (setq mark gnus-del-mark)) + (when (and (not no-expire) + gnus-newsgroup-auto-expire + (memq mark gnus-auto-expirable-marks)) + (setq mark gnus-expirable-mark)) + (let ((article (or article (gnus-summary-article-number))) + (old-mark (gnus-summary-article-mark article))) ;; Allow the backend to change the mark. (setq mark (gnus-request-update-mark gnus-newsgroup-name article mark)) (if (eq mark old-mark) @@ -7993,14 +7998,14 @@ If N is negative, mark backwards instead. The difference between N and the actual number of articles marked is returned." (interactive "p") - (gnus-summary-mark-forward n gnus-del-mark t)) + (gnus-summary-mark-forward n gnus-del-mark gnus-inhibit-user-auto-expire)) (defun gnus-summary-mark-as-read-backward (n) "Mark the N articles as read backwards. The difference between N and the actual number of articles marked is returned." (interactive "p") - (gnus-summary-mark-forward (- n) gnus-del-mark t)) + (gnus-summary-mark-forward (- n) gnus-del-mark gnus-inhibit-user-auto-expire)) (defun gnus-summary-mark-as-read (&optional article mark) "Mark current article as read. @@ -8545,17 +8550,15 @@ Argument REVERSE means reverse order." (let* ((thread (intern (format "gnus-thread-sort-by-%s" predicate))) (article (intern (format "gnus-article-sort-by-%s" predicate))) (gnus-thread-sort-functions - (list - (if (not reverse) - thread - `(lambda (t1 t2) - (,thread t2 t1))))) + (if (not reverse) + thread + `(lambda (t1 t2) + (,thread t2 t1)))) (gnus-article-sort-functions - (list - (if (not reverse) - article - `(lambda (t1 t2) - (,article t2 t1))))) + (if (not reverse) + article + `(lambda (t1 t2) + (,article t2 t1)))) (buffer-read-only) (gnus-summary-prepare-hook nil)) ;; We do the sorting by regenerating the threads. diff --git a/lisp/gnus-topic.el b/lisp/gnus-topic.el index c3dd816..03bb313 100644 --- a/lisp/gnus-topic.el +++ b/lisp/gnus-topic.el @@ -907,6 +907,7 @@ articles in the topic and its subtopics." "=" gnus-topic-select-group "\r" gnus-topic-select-group " " gnus-topic-read-group + "\C-c\C-x" gnus-topic-expire-articles "\C-k" gnus-topic-kill-group "\C-y" gnus-topic-yank-group "\M-g" gnus-topic-get-new-news-this-topic @@ -1040,6 +1041,19 @@ If performed over a topic line, toggle folding the topic." (mouse-set-point e) (gnus-topic-read-group nil)) +(defun gnus-topic-expire-articles (topic) + "Expire articles in this topic or group." + (interactive (list (gnus-group-topic-name))) + (if (not topic) + (call-interactively 'gnus-group-expire-articles) + (save-excursion + (gnus-message 5 "Expiring groups in %s..." topic) + (let ((gnus-group-marked + (mapcar (lambda (entry) (car (nth 2 entry))) + (gnus-topic-find-groups topic gnus-level-killed t)))) + (gnus-group-expire-articles nil)) + (gnus-message 5 "Expiring groups in %s...done" topic)))) + (defun gnus-topic-read-group (&optional all no-article group) "Read news in this newsgroup. If the prefix argument ALL is non-nil, already read articles become diff --git a/lisp/gnus.el b/lisp/gnus.el index 3ad4925..245a41e 100644 --- a/lisp/gnus.el +++ b/lisp/gnus.el @@ -254,7 +254,7 @@ is restarted, and sometimes reloaded." :link '(custom-manual "(gnus)Exiting Gnus") :group 'gnus) -(defconst gnus-version-number "0.49" +(defconst gnus-version-number "0.50" "Version number for this version of Gnus.") (defconst gnus-version (format "Pterodactyl Gnus v%s" gnus-version-number) @@ -2684,6 +2684,7 @@ If NEWSGROUP is nil, return the global kill file name instead." (let ((opened gnus-opened-servers)) (while (and method opened) (when (and (equal (cadr method) (cadaar opened)) + (equal (car method) (caaar opened)) (not (equal method (caar opened)))) (setq method nil)) (pop opened)) diff --git a/lisp/mm-decode.el b/lisp/mm-decode.el index ab07f8d..6a2b789 100644 --- a/lisp/mm-decode.el +++ b/lisp/mm-decode.el @@ -50,7 +50,8 @@ ("image/png" mm-inline-image (featurep 'png)) ("image/gif" mm-inline-image (featurep 'gif)) ("image/tiff" mm-inline-image (featurep 'tiff)) - ("image/xbm" mm-inline-image (eq (device-type) 'x)) + ("image/xbm" mm-inline-image (and (fboundp 'device-type) + (eq (device-type) 'x))) ("image/xpm" mm-inline-image (featurep 'xpm)) ("image/bmp" mm-inline-image (featurep 'bmp)) ("text/plain" mm-inline-text t) @@ -73,7 +74,7 @@ (defvar mm-user-automatic-display '("text/plain" "text/enriched" "text/richtext" "text/html" "image/gif" - "message/delivery-status" "multipart/.*")) + "image/jpeg" "message/delivery-status" "multipart/.*")) (defvar mm-alternative-precedence '("text/plain" "text/enriched" "text/richtext" "text/html") diff --git a/lisp/mml.el b/lisp/mml.el index fab6be2..3920f9a 100644 --- a/lisp/mml.el +++ b/lisp/mml.el @@ -97,11 +97,13 @@ (buffer-substring beg (goto-char (point-max)))))) (defvar mml-boundary nil) +(defvar mml-multipart-number 0) (defun mml-generate-mime () "Generate a MIME message based on the current MML document." - (setq mml-boundary "=-=-=") - (let ((cont (mml-parse))) + (setq mml-boundary "-=-=") + (let ((cont (mml-parse)) + (mml-multipart-number 0)) (with-temp-buffer (if (and (consp (car cont)) (= (length cont) 1)) @@ -134,7 +136,8 @@ (if (setq filename (cdr (assq 'filename cont))) (insert-file-contents-literally filename) (insert (cdr (assq 'contents cont)))) - (setq coded (buffer-string)))) + (setq encoding (mm-encode-buffer type) + coded (buffer-string)))) (when (or charset (not (equal type "text/plain"))) (insert "Content-Type: " type) @@ -146,23 +149,46 @@ (insert "\n") (insert coded))) ((eq (car cont) 'multipart) - (let ((mml-boundary (concat "=" mml-boundary))) + (let ((mml-boundary (mml-compute-boundary cont))) (insert (format "Content-Type: multipart/%s; boundary=\"%s\"\n" (or (cdr (assq 'type cont)) "mixed") mml-boundary)) (insert "\n") (setq cont (cddr cont)) (while cont - (unless (bolp) - (insert "\n")) - (insert "--" mml-boundary "\n") + (insert "\n--" mml-boundary "\n") (mml-generate-mime-1 (pop cont))) - (unless (bolp) - (insert "\n")) - (insert "--" mml-boundary "--\n"))) + (insert "\n--" mml-boundary "--\n"))) (t (error "Invalid element: %S" cont)))) +(defun mml-compute-boundary (cont) + "Return a unique boundary that does not exist in CONT." + (let ((mml-boundary (concat (make-string (incf mml-multipart-number) ?=) + mml-boundary))) + ;; This function tries again and again until it has found + ;; a unique boundary. + (while (not (catch 'not-unique + (mml-compute-boundary-1 cont)))) + mml-boundary)) + +(defun mml-compute-boundary-1 (cont) + (cond + ((eq (car cont) 'part) + (with-temp-buffer + (if (setq filename (cdr (assq 'filename cont))) + (insert-file-contents-literally filename) + (insert (cdr (assq 'contents cont)))) + (goto-char (point-min)) + (when (re-search-forward (concat "^--" mml-boundary) nil t) + (setq mml-boundary + (concat (make-string (incf mml-multipart-number) ?=) + mml-boundary)) + (throw 'not-unique nil)))) + ((eq (car cont) 'multipart) + (mapcar 'mml-compute-boundary-1 (cddr cont)))) + t) + (provide 'mml) ;;; mml.el ends here diff --git a/texi/ChangeLog b/texi/ChangeLog index bdd0655..783ad52 100644 --- a/texi/ChangeLog +++ b/texi/ChangeLog @@ -1,6 +1,7 @@ 1998-11-18 00:52:46 Lars Magne Ingebrigtsen * gnus.texi (MIME Commands): Addition. + (Expiring Mail): Addition. 1998-11-07 17:18:07 Lars Magne Ingebrigtsen diff --git a/texi/gnus.texi b/texi/gnus.texi index 5134631..4375168 100644 --- a/texi/gnus.texi +++ b/texi/gnus.texi @@ -1,7 +1,7 @@ \input texinfo @c -*-texinfo-*- @setfilename gnus -@settitle Pterodactyl Gnus 0.49 Manual +@settitle Pterodactyl Gnus 0.50 Manual @synindex fn cp @synindex vr cp @synindex pg cp @@ -318,7 +318,7 @@ into another language, under the above conditions for modified versions. @tex @titlepage -@title Pterodactyl Gnus 0.49 Manual +@title Pterodactyl Gnus 0.50 Manual @author by Lars Magne Ingebrigtsen @page @@ -354,7 +354,7 @@ can be gotten by any nefarious means you can think of---@sc{nntp}, local spool or your mbox file. All at the same time, if you want to push your luck. -This manual corresponds to Pterodactyl Gnus 0.49. +This manual corresponds to Pterodactyl Gnus 0.50. @end ifinfo @@ -2738,17 +2738,6 @@ Mark all groups in the current topic with the process mark Remove the process mark from all groups in the current topic (@code{gnus-topic-unmark-topic}). -@item RET -@kindex RET (Topic) -@findex gnus-topic-select-group -@itemx SPACE -Either select a group or fold a topic (@code{gnus-topic-select-group}). -When you perform this command on a group, you'll enter the group, as -usual. When done on a topic line, the topic will be folded (if it was -visible) or unfolded (if it was folded already). So it's basically a -toggling command on topics. In addition, if you give a numerical -prefix, group on that level (and lower) will be displayed. - @item T TAB @itemx TAB @kindex T TAB (Topic) @@ -2764,6 +2753,23 @@ previous topic (@code{gnus-topic-indent}). If given a prefix, ``Un-indent'' the current topic so that it becomes a sub-topic of the parent of its current parent (@code{gnus-topic-unindent}). +@item RET +@kindex RET (Topic) +@findex gnus-topic-select-group +@itemx SPACE +Either select a group or fold a topic (@code{gnus-topic-select-group}). +When you perform this command on a group, you'll enter the group, as +usual. When done on a topic line, the topic will be folded (if it was +visible) or unfolded (if it was folded already). So it's basically a +toggling command on topics. In addition, if you give a numerical +prefix, group on that level (and lower) will be displayed. + +@item C-c C-x +@kindex C-c C-x (Topic) +@findex gnus-topic-expire-articles +Run all expirable articles in the current group or topic through the expiry +process (if any) (@code{gnus-topic-expire-articles}). + @item C-k @kindex C-k (Topic) @findex gnus-topic-kill-group @@ -10249,6 +10255,11 @@ with! So there! Most people make most of their mail groups total-expirable, though. +@vindex gnus-inhibit-user-auto-expire +If @code{gnus-inhibit-user-auto-expire} is non-@code{nil}, user marking +commands will not mark an article as expirable, even if the group has +auto-expire turned on. + @node Washing Mail @subsection Washing Mail diff --git a/texi/message.texi b/texi/message.texi index 6493963..6276281 100644 --- a/texi/message.texi +++ b/texi/message.texi @@ -1,7 +1,7 @@ \input texinfo @c -*-texinfo-*- @setfilename message -@settitle Pterodactyl Message 0.49 Manual +@settitle Pterodactyl Message 0.50 Manual @synindex fn cp @synindex vr cp @synindex pg cp @@ -42,7 +42,7 @@ into another language, under the above conditions for modified versions. @tex @titlepage -@title Pterodactyl Message 0.49 Manual +@title Pterodactyl Message 0.50 Manual @author by Lars Magne Ingebrigtsen @page @@ -83,7 +83,7 @@ Message mode buffers. * Key Index:: List of Message mode keys. @end menu -This manual corresponds to Pterodactyl Message 0.49. Message is +This manual corresponds to Pterodactyl Message 0.50. Message is distributed with the Gnus distribution bearing the same version number as this manual. -- 1.7.10.4