aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMiles Bader2008-07-04 00:07:47 +0000
committerMiles Bader2008-07-04 00:07:47 +0000
commit89167438cbdca06a305318039911d4c791bcbe31 (patch)
treeadd0ca67b677045c229f6acd5c457acfa22a139b
parent92439579f3a00655358f48ea64b8fb142bfda1b6 (diff)
downloademacs-89167438cbdca06a305318039911d4c791bcbe31.tar.gz
emacs-89167438cbdca06a305318039911d4c791bcbe31.zip
Merge from gnus--devo--0
Revision: emacs@sv.gnu.org/emacs--devo--0--patch-1309
-rw-r--r--doc/misc/gnus.texi21
-rw-r--r--lisp/gnus/ChangeLog19
-rw-r--r--lisp/gnus/gnus-art.el53
-rw-r--r--lisp/gnus/gnus-score.el3
-rw-r--r--lisp/gnus/gnus-sum.el30
5 files changed, 94 insertions, 32 deletions
diff --git a/doc/misc/gnus.texi b/doc/misc/gnus.texi
index dcdb5540ee1..3ce96ee181b 100644
--- a/doc/misc/gnus.texi
+++ b/doc/misc/gnus.texi
@@ -8514,10 +8514,13 @@ Save the current article in a VM folder
8514@kindex O p (Summary) 8514@kindex O p (Summary)
8515@kindex | (Summary) 8515@kindex | (Summary)
8516@findex gnus-summary-pipe-output 8516@findex gnus-summary-pipe-output
8517@vindex gnus-summary-pipe-output-default-command
8517Save the current article in a pipe. Uhm, like, what I mean is---Pipe 8518Save the current article in a pipe. Uhm, like, what I mean is---Pipe
8518the current article to a process (@code{gnus-summary-pipe-output}). 8519the current article to a process (@code{gnus-summary-pipe-output}).
8519If given a symbolic prefix (@pxref{Symbolic Prefixes}), include the 8520If given a symbolic prefix (@pxref{Symbolic Prefixes}), include the
8520complete headers in the piped output. 8521complete headers in the piped output. The
8522@code{gnus-summary-pipe-output-default-command} variable can be set to a
8523string containing the default command and options (default @code{nil}).
8521 8524
8522@item O P 8525@item O P
8523@kindex O P (Summary) 8526@kindex O P (Summary)
@@ -8613,6 +8616,17 @@ to get a file name to save the article in. The default is
8613@findex gnus-summary-save-in-vm 8616@findex gnus-summary-save-in-vm
8614Save the article in a VM folder. You have to have the VM mail 8617Save the article in a VM folder. You have to have the VM mail
8615reader to use this setting. 8618reader to use this setting.
8619
8620@item gnus-summary-save-in-pipe
8621@findex gnus-summary-save-in-pipe
8622Pipe the article to a shell command. This function takes optional one
8623argument; if it is a string, it is used as the command; if it is
8624@code{nil} or omitted, you will be prompted for the command; if it is
8625the symbol @code{default}, the command which the
8626@code{gnus-summary-pipe-output-default-command} variable holds or the
8627command last used for saving will be used if it is non-@code{nil}. The
8628command should be a string that the shell can interpret (e.g. the
8629executable command name and the arguments).
8616@end table 8630@end table
8617 8631
8618The symbol of each function may have the following properties: 8632The symbol of each function may have the following properties:
@@ -8622,8 +8636,9 @@ The symbol of each function may have the following properties:
8622The value non-@code{nil} means save decoded articles. This is 8636The value non-@code{nil} means save decoded articles. This is
8623meaningful only with @code{gnus-summary-save-in-file}, 8637meaningful only with @code{gnus-summary-save-in-file},
8624@code{gnus-summary-save-body-in-file}, 8638@code{gnus-summary-save-body-in-file},
8625@code{gnus-summary-write-to-file}, and 8639@code{gnus-summary-write-to-file},
8626@code{gnus-summary-write-body-to-file}. 8640@code{gnus-summary-write-body-to-file}, and
8641@code{gnus-summary-save-in-pipe}.
8627 8642
8628@item :function 8643@item :function
8629The value specifies an alternative function which appends, not 8644The value specifies an alternative function which appends, not
diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog
index ab38653fd5d..271d33f562b 100644
--- a/lisp/gnus/ChangeLog
+++ b/lisp/gnus/ChangeLog
@@ -1,3 +1,22 @@
12008-07-02 Katsumi Yamaoka <yamaoka@jpl.org>
2
3 * gnus-art.el (gnus-default-article-saver): Add
4 gnus-summary-save-in-pipe to choices.
5 (gnus-summary-save-in-pipe): Add :decode and :headers properties; use
6 gnus-summary-pipe-output-default-command as the default command.
7 (gnus-summary-pipe-to-muttprint): Update gnus-summary-muttprint-program
8 instead of gnus-last-shell-command.
9
10 * gnus-sum.el (gnus-summary-pipe-output-default-command): New user
11 option.
12 (gnus-summary-muttprint-program): Mention the value will be changed.
13 (gnus-summary-save-article): Force showing of all headers.
14 (gnus-summary-pipe-output): Work with the 2nd argument HEADERS.
15
162008-07-01 Rupert Swarbrick <rswarbrick@googlemail.com> (tiny change)
17
18 * gnus-score.el (gnus-score-find-trace): Add "Total score" line.
19
12008-07-02 Juanma Barranquero <lekktu@gmail.com> 202008-07-02 Juanma Barranquero <lekktu@gmail.com>
2 21
3 * nnimap.el (nnimap-id): 22 * nnimap.el (nnimap-id):
diff --git a/lisp/gnus/gnus-art.el b/lisp/gnus/gnus-art.el
index 2dc95ea49f6..a8db53f682c 100644
--- a/lisp/gnus/gnus-art.el
+++ b/lisp/gnus/gnus-art.el
@@ -552,13 +552,15 @@ Gnus provides the following functions:
552* gnus-summary-save-in-vm (use VM's folder format) 552* gnus-summary-save-in-vm (use VM's folder format)
553* gnus-summary-write-to-file (article format -- overwrite) 553* gnus-summary-write-to-file (article format -- overwrite)
554* gnus-summary-write-body-to-file (article body -- overwrite) 554* gnus-summary-write-body-to-file (article body -- overwrite)
555* gnus-summary-save-in-pipe (article format)
555 556
556The symbol of each function may have the following properties: 557The symbol of each function may have the following properties:
557 558
558* :decode 559* :decode
559The value non-nil means save decoded articles. This is meaningful 560The value non-nil means save decoded articles. This is meaningful
560only with `gnus-summary-save-in-file', `gnus-summary-save-body-in-file', 561only with `gnus-summary-save-in-file', `gnus-summary-save-body-in-file',
561`gnus-summary-write-to-file', and `gnus-summary-write-body-to-file'. 562`gnus-summary-write-to-file', `gnus-summary-write-body-to-file', and
563`gnus-summary-save-in-pipe'.
562 564
563* :function 565* :function
564The value specifies an alternative function which appends, not 566The value specifies an alternative function which appends, not
@@ -581,6 +583,7 @@ headers should be saved."
581 (function-item gnus-summary-save-in-vm) 583 (function-item gnus-summary-save-in-vm)
582 (function-item gnus-summary-write-to-file) 584 (function-item gnus-summary-write-to-file)
583 (function-item gnus-summary-write-body-to-file) 585 (function-item gnus-summary-write-body-to-file)
586 (function-item gnus-summary-save-in-pipe)
584 (function))) 587 (function)))
585 588
586(defcustom gnus-article-save-coding-system 589(defcustom gnus-article-save-coding-system
@@ -3936,39 +3939,43 @@ The directory to save in defaults to `gnus-article-save-directory'."
3936 gnus-current-headers nil 'gnus-newsgroup-last-directory)) 3939 gnus-current-headers nil 'gnus-newsgroup-last-directory))
3937 (gnus-summary-save-body-in-file filename t)) 3940 (gnus-summary-save-body-in-file filename t))
3938 3941
3942(put 'gnus-summary-save-in-pipe :decode t)
3943(put 'gnus-summary-save-in-pipe :headers 'gnus-saved-headers)
3939(defun gnus-summary-save-in-pipe (&optional command) 3944(defun gnus-summary-save-in-pipe (&optional command)
3940 "Pipe this article to subprocess." 3945 "Pipe this article to subprocess."
3941 (setq command 3946 (let ((default (or gnus-summary-pipe-output-default-command
3942 (cond ((and (eq command 'default) 3947 gnus-last-shell-command)))
3943 gnus-last-shell-command) 3948 (unless (stringp command)
3944 gnus-last-shell-command) 3949 (setq command
3945 ((stringp command) 3950 (if (and (eq command 'default) default)
3946 command) 3951 default
3947 (t (gnus-read-shell-command 3952 (gnus-read-shell-command
3948 (format 3953 (format
3949 "Shell command on %s: " 3954 "Shell command on %s: "
3950 (if (and gnus-number-of-articles-to-be-saved 3955 (if (and gnus-number-of-articles-to-be-saved
3951 (> gnus-number-of-articles-to-be-saved 1)) 3956 (> gnus-number-of-articles-to-be-saved 1))
3952 (format "these %d articles" 3957 (format "these %d articles"
3953 gnus-number-of-articles-to-be-saved) 3958 gnus-number-of-articles-to-be-saved)
3954 "this article")) 3959 "this article"))
3955 gnus-last-shell-command)))) 3960 default))))
3956 (when (string-equal command "") 3961 (when (string-equal command "")
3957 (if gnus-last-shell-command 3962 (if default
3958 (setq command gnus-last-shell-command) 3963 (setq command default)
3959 (error "A command is required"))) 3964 (error "A command is required"))))
3960 (gnus-eval-in-buffer-window gnus-article-buffer 3965 (gnus-eval-in-buffer-window gnus-save-article-buffer
3961 (save-restriction 3966 (save-restriction
3962 (widen) 3967 (widen)
3963 (shell-command-on-region (point-min) (point-max) command nil))) 3968 (shell-command-on-region (point-min) (point-max) command nil)))
3964 (setq gnus-last-shell-command command)) 3969 (setq gnus-summary-pipe-output-default-command command))
3965 3970
3966(defun gnus-summary-pipe-to-muttprint (&optional command) 3971(defun gnus-summary-pipe-to-muttprint (&optional command)
3967 "Pipe this article to muttprint." 3972 "Pipe this article to muttprint."
3968 (setq command (read-string 3973 (setq command (read-string
3969 "Print using command: " gnus-summary-muttprint-program 3974 "Print using command: " gnus-summary-muttprint-program
3970 nil gnus-summary-muttprint-program)) 3975 nil gnus-summary-muttprint-program))
3971 (gnus-summary-save-in-pipe command)) 3976 (let ((gnus-last-shell-command gnus-last-shell-command))
3977 (gnus-summary-save-in-pipe command)
3978 (setq gnus-summary-muttprint-program gnus-last-shell-command)))
3972 3979
3973;;; Article file names when saving. 3980;;; Article file names when saving.
3974 3981
diff --git a/lisp/gnus/gnus-score.el b/lisp/gnus/gnus-score.el
index 599c8b0195e..1390db3acd0 100644
--- a/lisp/gnus/gnus-score.el
+++ b/lisp/gnus/gnus-score.el
@@ -2468,6 +2468,9 @@ score in `gnus-newsgroup-scored' by SCORE."
2468 (file-name-nondirectory file) 2468 (file-name-nondirectory file)
2469 (abbreviate-file-name file)))) 2469 (abbreviate-file-name file))))
2470 (insert 2470 (insert
2471 (format "\nTotal score: %d"
2472 (apply '+ (mapcar 'caddr trace))))
2473 (insert
2471 "\n\nQuick help: 2474 "\n\nQuick help:
2472 2475
2473Type `e' to edit score file corresponding to the score rule on current line, 2476Type `e' to edit score file corresponding to the score rule on current line,
diff --git a/lisp/gnus/gnus-sum.el b/lisp/gnus/gnus-sum.el
index ba29ba6bc15..7efd9d7595c 100644
--- a/lisp/gnus/gnus-sum.el
+++ b/lisp/gnus/gnus-sum.el
@@ -1242,8 +1242,19 @@ that were fetched. Say, for nnultimate groups."
1242 :group 'gnus-summary 1242 :group 'gnus-summary
1243 :type '(choice boolean regexp)) 1243 :type '(choice boolean regexp))
1244 1244
1245(defcustom gnus-summary-pipe-output-default-command nil
1246 "Command (and optional arguments) used to pipe article to subprocess.
1247This will be used as the default command if it is non-nil. The value
1248will be updated if you modify it when executing the command
1249`gnus-summary-pipe-output' or the function `gnus-summary-save-in-pipe'."
1250 :version "23.1" ;; No Gnus
1251 :group 'gnus-summary
1252 :type '(radio (const :tag "None" nil) (string :tag "Command")))
1253
1245(defcustom gnus-summary-muttprint-program "muttprint" 1254(defcustom gnus-summary-muttprint-program "muttprint"
1246 "Command (and optional arguments) used to run Muttprint." 1255 "Command (and optional arguments) used to run Muttprint.
1256The value will be updated if you modify it when executing the command
1257`gnus-summary-muttprint'."
1247 :version "22.1" 1258 :version "22.1"
1248 :group 'gnus-summary 1259 :group 'gnus-summary
1249 :type 'string) 1260 :type 'string)
@@ -11583,7 +11594,7 @@ will not be marked as saved."
11583 gnus-display-mime-function)) 11594 gnus-display-mime-function))
11584 (gnus-article-prepare-hook (when decode 11595 (gnus-article-prepare-hook (when decode
11585 gnus-article-prepare-hook))) 11596 gnus-article-prepare-hook)))
11586 (gnus-summary-select-article t nil nil article) 11597 (gnus-summary-select-article t t nil article)
11587 (gnus-summary-goto-subject article))) 11598 (gnus-summary-goto-subject article)))
11588 (with-current-buffer save-buffer 11599 (with-current-buffer save-buffer
11589 (erase-buffer) 11600 (erase-buffer)
@@ -11608,12 +11619,19 @@ If N is a positive number, pipe the N next articles.
11608If N is a negative number, pipe the N previous articles. 11619If N is a negative number, pipe the N previous articles.
11609If N is nil and any articles have been marked with the process mark, 11620If N is nil and any articles have been marked with the process mark,
11610pipe those articles instead. 11621pipe those articles instead.
11611If HEADERS (the symbolic prefix), include the headers, too." 11622If HEADERS (the symbolic prefix) is given, force including all headers."
11612 (interactive (gnus-interactive "P\ny")) 11623 (interactive (gnus-interactive "P\ny"))
11613 (require 'gnus-art) 11624 (require 'gnus-art)
11614 (let ((gnus-default-article-saver 'gnus-summary-save-in-pipe) 11625 (let ((gnus-default-article-saver 'gnus-summary-save-in-pipe))
11615 (gnus-save-all-headers (or headers gnus-save-all-headers))) 11626 (if headers
11616 (gnus-summary-save-article arg t)) 11627 (let ((gnus-save-all-headers t)
11628 (headers (get gnus-default-article-saver :headers)))
11629 (unwind-protect
11630 (progn
11631 (put gnus-default-article-saver :headers nil)
11632 (gnus-summary-save-article arg t))
11633 (put gnus-default-article-saver :headers headers)))
11634 (gnus-summary-save-article arg t)))
11617 (let ((buffer (get-buffer "*Shell Command Output*"))) 11635 (let ((buffer (get-buffer "*Shell Command Output*")))
11618 (when (and buffer 11636 (when (and buffer
11619 (not (zerop (buffer-size buffer)))) 11637 (not (zerop (buffer-size buffer))))