]> code.delx.au - gnu-emacs/commitdiff
Merge from gnus--devo--0
authorMiles Bader <miles@gnu.org>
Sat, 26 Jul 2008 09:13:11 +0000 (09:13 +0000)
committerMiles Bader <miles@gnu.org>
Sat, 26 Jul 2008 09:13:11 +0000 (09:13 +0000)
Revision: emacs@sv.gnu.org/emacs--devo--0--patch-1355

doc/misc/ChangeLog
doc/misc/gnus.texi
lisp/gnus/ChangeLog
lisp/gnus/gnus-art.el

index 19be8135cdc7b4e2173b38224d7244c1bf2f5621..8fa35abc979781834666ba07e53ab23861c52aca 100644 (file)
@@ -1,3 +1,13 @@
+2008-07-24  Katsumi Yamaoka  <yamaoka@jpl.org>
+
+       * gnus.texi (Saving Articles): Describe the 2nd argument of
+       gnus-summary-save-in-pipe.
+       (SpamAssassin): Use it.
+
+2008-07-22  Katsumi Yamaoka  <yamaoka@jpl.org>
+
+       * gnus.texi (SpamAssassin): Fix gnus-summary-save-in-pipe usage.
+
 2008-07-25  Carsten Dominik  <dominik@science.uva.nl>
 
        * org.texi (Export options): Document the use of the creator flag.
index 3ce96ee181bbeab1945cb3d1f699c5a0934c3c66..15a0109d94d3d3f61cc22de968baba129f522323 100644 (file)
@@ -8619,14 +8619,23 @@ 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).
+Pipe the article to a shell command.  This function takes optional two
+arguments COMMAND and RAW.  Valid values for COMMAND include:
+
+@itemize @bullet
+@item a string@*
+The executable command name and possibly arguments.
+@item @code{nil}@*
+You will be prompted for the command in the minibuffer.
+@item the symbol @code{default}@*
+It will be replaced with the command which the variable
+@code{gnus-summary-pipe-output-default-command} holds or the command
+last used for saving.
+@end itemize
+
+Non-@code{nil} value for RAW overrides @code{:decode} and
+@code{:headers} properties (see below) and the raw article including all
+headers will be piped.
 @end table
 
 The symbol of each function may have the following properties:
@@ -24678,11 +24687,10 @@ might want to have a nifty function to call when you happen to read
 spam.  And here is the nifty function:
 
 @lisp
- (defun my-gnus-raze-spam ()
+(defun my-gnus-raze-spam ()
   "Submit SPAM to Vipul's Razor, then mark it as expirable."
   (interactive)
-  (gnus-summary-show-raw-article)
-  (gnus-summary-save-in-pipe "razor-report -f -d")
+  (gnus-summary-save-in-pipe "razor-report -f -d" t)
   (gnus-summary-mark-as-expirable 1))
 @end lisp
 
index 2db00ad59c242fdef72f20704914d015372360b7..4592f39cfc00578d278c15d398287877bdb7152e 100644 (file)
@@ -1,3 +1,12 @@
+2008-07-24  Katsumi Yamaoka  <yamaoka@jpl.org>
+
+       * gnus-art.el (gnus-summary-save-in-pipe): Add optional argument `raw'.
+
+2008-07-22  Katsumi Yamaoka  <yamaoka@jpl.org>
+
+       * gnus-art.el (gnus-summary-save-in-pipe): Consider
+       gnus-save-all-headers.
+
 2008-07-21  Dan Nicolaescu  <dann@ics.uci.edu>
 
        * gnus-util.el (ns-focus-frame): Remove declaration.
index 89dee7f0f56aaac7d385e829ba38f7db66c35b45..16e65a63e274c720d019486697c38d1503401ba2 100644 (file)
@@ -3942,8 +3942,19 @@ The directory to save in defaults to `gnus-article-save-directory'."
 
 (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."
+(defun gnus-summary-save-in-pipe (&optional command raw)
+  "Pipe this article to subprocess COMMAND.
+Valid values for COMMAND include:
+  a string
+    The executable command name and possibly arguments.
+  nil
+    You will be prompted for the command in the minibuffer.
+  the symbol `default'
+    It will be replaced with the command which the variable
+    `gnus-summary-pipe-output-default-command' holds or the command
+    last used for saving.
+Non-nil value for RAW overrides `:decode' and `:headers' properties
+and the raw article including all headers will be piped."
   (let ((save-buffer gnus-save-article-buffer)
        (default (or gnus-summary-pipe-output-default-command
                     gnus-last-shell-command)))
@@ -3953,7 +3964,8 @@ The directory to save in defaults to `gnus-article-save-directory'."
     ;; means this function is called independently.
     (unless (gnus-buffer-live-p save-buffer)
       (let ((article (gnus-summary-article-number))
-           (decode (get 'gnus-summary-save-in-pipe :decode)))
+           (decode (unless raw
+                     (get 'gnus-summary-save-in-pipe :decode))))
        (if article
            (if (vectorp (gnus-summary-article-header article))
                (save-window-excursion
@@ -3973,12 +3985,15 @@ The directory to save in defaults to `gnus-article-save-directory'."
                     (setq save-buffer
                           (nnheader-set-temp-buffer " *Gnus Save*"))))
                  ;; Remove unwanted headers.
-                 (let ((gnus-visible-headers
-                        (or (symbol-value (get gnus-default-article-saver
-                                               :headers))
-                            gnus-saved-headers gnus-visible-headers))
-                       (gnus-summary-buffer nil))
-                   (article-hide-headers 1 t)))
+                 (when (and (not raw)
+                            (or (get 'gnus-summary-save-in-pipe :headers)
+                                (not gnus-save-all-headers)))
+                   (let ((gnus-visible-headers
+                          (or (symbol-value (get 'gnus-summary-save-in-pipe
+                                                 :headers))
+                              gnus-saved-headers gnus-visible-headers))
+                         (gnus-summary-buffer nil))
+                     (article-hide-headers 1 t))))
              (error "%d is not a real article" article))
          (error "No article to pipe"))))
     (unless (stringp command)