summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiles Bader <miles@gnu.org>2008-07-04 00:07:47 +0000
committerMiles Bader <miles@gnu.org>2008-07-04 00:07:47 +0000
commit89167438cbdca06a305318039911d4c791bcbe31 (patch)
treeadd0ca67b677045c229f6acd5c457acfa22a139b
parent92439579f3a00655358f48ea64b8fb142bfda1b6 (diff)
downloademacs-89167438cbdca06a305318039911d4c791bcbe31.tar.gz
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
@kindex O p (Summary)
@kindex | (Summary)
@findex gnus-summary-pipe-output
+@vindex gnus-summary-pipe-output-default-command
Save the current article in a pipe. Uhm, like, what I mean is---Pipe
the current article to a process (@code{gnus-summary-pipe-output}).
If given a symbolic prefix (@pxref{Symbolic Prefixes}), include the
-complete headers in the piped output.
+complete headers in the piped output. The
+@code{gnus-summary-pipe-output-default-command} variable can be set to a
+string containing the default command and options (default @code{nil}).
@item O P
@kindex O P (Summary)
@@ -8613,6 +8616,17 @@ to get a file name to save the article in. The default is
@findex gnus-summary-save-in-vm
Save the article in a VM folder. You have to have the VM mail
reader to use this setting.
+
+@item gnus-summary-save-in-pipe
+@findex gnus-summary-save-in-pipe
+Pipe the article to a shell command. This function takes optional one
+argument; if it is a string, it is used as the command; if it is
+@code{nil} or omitted, you will be prompted for the command; if it is
+the symbol @code{default}, the command which the
+@code{gnus-summary-pipe-output-default-command} variable holds or the
+command last used for saving will be used if it is non-@code{nil}. The
+command should be a string that the shell can interpret (e.g. the
+executable command name and the arguments).
@end table
The symbol of each function may have the following properties:
@@ -8622,8 +8636,9 @@ The symbol of each function may have the following properties:
The value non-@code{nil} means save decoded articles. This is
meaningful only with @code{gnus-summary-save-in-file},
@code{gnus-summary-save-body-in-file},
-@code{gnus-summary-write-to-file}, and
-@code{gnus-summary-write-body-to-file}.
+@code{gnus-summary-write-to-file},
+@code{gnus-summary-write-body-to-file}, and
+@code{gnus-summary-save-in-pipe}.
@item :function
The 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 @@
+2008-07-02 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * gnus-art.el (gnus-default-article-saver): Add
+ gnus-summary-save-in-pipe to choices.
+ (gnus-summary-save-in-pipe): Add :decode and :headers properties; use
+ gnus-summary-pipe-output-default-command as the default command.
+ (gnus-summary-pipe-to-muttprint): Update gnus-summary-muttprint-program
+ instead of gnus-last-shell-command.
+
+ * gnus-sum.el (gnus-summary-pipe-output-default-command): New user
+ option.
+ (gnus-summary-muttprint-program): Mention the value will be changed.
+ (gnus-summary-save-article): Force showing of all headers.
+ (gnus-summary-pipe-output): Work with the 2nd argument HEADERS.
+
+2008-07-01 Rupert Swarbrick <rswarbrick@googlemail.com> (tiny change)
+
+ * gnus-score.el (gnus-score-find-trace): Add "Total score" line.
+
2008-07-02 Juanma Barranquero <lekktu@gmail.com>
* 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:
* gnus-summary-save-in-vm (use VM's folder format)
* gnus-summary-write-to-file (article format -- overwrite)
* gnus-summary-write-body-to-file (article body -- overwrite)
+* gnus-summary-save-in-pipe (article format)
The symbol of each function may have the following properties:
* :decode
The value non-nil means save decoded articles. This is meaningful
only with `gnus-summary-save-in-file', `gnus-summary-save-body-in-file',
-`gnus-summary-write-to-file', and `gnus-summary-write-body-to-file'.
+`gnus-summary-write-to-file', `gnus-summary-write-body-to-file', and
+`gnus-summary-save-in-pipe'.
* :function
The value specifies an alternative function which appends, not
@@ -581,6 +583,7 @@ headers should be saved."
(function-item gnus-summary-save-in-vm)
(function-item gnus-summary-write-to-file)
(function-item gnus-summary-write-body-to-file)
+ (function-item gnus-summary-save-in-pipe)
(function)))
(defcustom gnus-article-save-coding-system
@@ -3936,39 +3939,43 @@ The directory to save in defaults to `gnus-article-save-directory'."
gnus-current-headers nil 'gnus-newsgroup-last-directory))
(gnus-summary-save-body-in-file filename t))
+(put 'gnus-summary-save-in-pipe :decode t)
+(put 'gnus-summary-save-in-pipe :headers 'gnus-saved-headers)
(defun gnus-summary-save-in-pipe (&optional command)
"Pipe this article to subprocess."
- (setq command
- (cond ((and (eq command 'default)
- gnus-last-shell-command)
- gnus-last-shell-command)
- ((stringp command)
- command)
- (t (gnus-read-shell-command
- (format
- "Shell command on %s: "
- (if (and gnus-number-of-articles-to-be-saved
- (> gnus-number-of-articles-to-be-saved 1))
- (format "these %d articles"
- gnus-number-of-articles-to-be-saved)
- "this article"))
- gnus-last-shell-command))))
- (when (string-equal command "")
- (if gnus-last-shell-command
- (setq command gnus-last-shell-command)
- (error "A command is required")))
- (gnus-eval-in-buffer-window gnus-article-buffer
+ (let ((default (or gnus-summary-pipe-output-default-command
+ gnus-last-shell-command)))
+ (unless (stringp command)
+ (setq command
+ (if (and (eq command 'default) default)
+ default
+ (gnus-read-shell-command
+ (format
+ "Shell command on %s: "
+ (if (and gnus-number-of-articles-to-be-saved
+ (> gnus-number-of-articles-to-be-saved 1))
+ (format "these %d articles"
+ gnus-number-of-articles-to-be-saved)
+ "this article"))
+ default))))
+ (when (string-equal command "")
+ (if default
+ (setq command default)
+ (error "A command is required"))))
+ (gnus-eval-in-buffer-window gnus-save-article-buffer
(save-restriction
(widen)
(shell-command-on-region (point-min) (point-max) command nil)))
- (setq gnus-last-shell-command command))
+ (setq gnus-summary-pipe-output-default-command command))
(defun gnus-summary-pipe-to-muttprint (&optional command)
"Pipe this article to muttprint."
(setq command (read-string
"Print using command: " gnus-summary-muttprint-program
nil gnus-summary-muttprint-program))
- (gnus-summary-save-in-pipe command))
+ (let ((gnus-last-shell-command gnus-last-shell-command))
+ (gnus-summary-save-in-pipe command)
+ (setq gnus-summary-muttprint-program gnus-last-shell-command)))
;;; Article file names when saving.
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."
(file-name-nondirectory file)
(abbreviate-file-name file))))
(insert
+ (format "\nTotal score: %d"
+ (apply '+ (mapcar 'caddr trace))))
+ (insert
"\n\nQuick help:
Type `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."
:group 'gnus-summary
:type '(choice boolean regexp))
+(defcustom gnus-summary-pipe-output-default-command nil
+ "Command (and optional arguments) used to pipe article to subprocess.
+This will be used as the default command if it is non-nil. The value
+will be updated if you modify it when executing the command
+`gnus-summary-pipe-output' or the function `gnus-summary-save-in-pipe'."
+ :version "23.1" ;; No Gnus
+ :group 'gnus-summary
+ :type '(radio (const :tag "None" nil) (string :tag "Command")))
+
(defcustom gnus-summary-muttprint-program "muttprint"
- "Command (and optional arguments) used to run Muttprint."
+ "Command (and optional arguments) used to run Muttprint.
+The value will be updated if you modify it when executing the command
+`gnus-summary-muttprint'."
:version "22.1"
:group 'gnus-summary
:type 'string)
@@ -11583,7 +11594,7 @@ will not be marked as saved."
gnus-display-mime-function))
(gnus-article-prepare-hook (when decode
gnus-article-prepare-hook)))
- (gnus-summary-select-article t nil nil article)
+ (gnus-summary-select-article t t nil article)
(gnus-summary-goto-subject article)))
(with-current-buffer save-buffer
(erase-buffer)
@@ -11608,12 +11619,19 @@ If N is a positive number, pipe the N next articles.
If N is a negative number, pipe the N previous articles.
If N is nil and any articles have been marked with the process mark,
pipe those articles instead.
-If HEADERS (the symbolic prefix), include the headers, too."
+If HEADERS (the symbolic prefix) is given, force including all headers."
(interactive (gnus-interactive "P\ny"))
(require 'gnus-art)
- (let ((gnus-default-article-saver 'gnus-summary-save-in-pipe)
- (gnus-save-all-headers (or headers gnus-save-all-headers)))
- (gnus-summary-save-article arg t))
+ (let ((gnus-default-article-saver 'gnus-summary-save-in-pipe))
+ (if headers
+ (let ((gnus-save-all-headers t)
+ (headers (get gnus-default-article-saver :headers)))
+ (unwind-protect
+ (progn
+ (put gnus-default-article-saver :headers nil)
+ (gnus-summary-save-article arg t))
+ (put gnus-default-article-saver :headers headers)))
+ (gnus-summary-save-article arg t)))
(let ((buffer (get-buffer "*Shell Command Output*")))
(when (and buffer
(not (zerop (buffer-size buffer))))