Gnus development mailing list
 help / color / mirror / Atom feed
* headers argument in gnus-summary-pipe-output is ignored
@ 2003-10-22 13:31 Reiner Steib
  2004-01-02 22:49 ` Lars Magne Ingebrigtsen
  0 siblings, 1 reply; 4+ messages in thread
From: Reiner Steib @ 2003-10-22 13:31 UTC (permalink / raw)


Hi,

according to the doc-string, `M-: (gnus-summary-pipe-output 1 t) RET'
should pipe the current article to a command, _including_ the headers:

,----[ C-h f gnus-summary-pipe-output RET ]
| gnus-summary-pipe-output is an interactive Lisp function in `gnus-sum'.
| (gnus-summary-pipe-output &optional ARG HEADERS)
| 
| Pipe the current article to a subprocess.
| 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.
`----

But, when I enter "xless" as a command, I see that only the usual
visible headers (as displayed in the article buffer) are used.

`gnus-summary-pipe-output' calls `gnus-summary-save-article' with
`gnus-default-article-saver' let-bound to `gnus-summary-save-in-pipe'.
`gnus-summary-save-article' calls `gnus-article-save', which finally
calls "(funcall gnus-default-article-saver filename)",
i.e. `gnus-summary-save-in-pipe'.  But the latter unconditionally uses 
`gnus-article-buffer' and ignores `gnus-save-article-buffer'.

(defun gnus-summary-save-in-pipe (&optional command)
  "Pipe this article to subprocess."
  [...]
  (gnus-eval-in-buffer-window gnus-article-buffer [...]))

The following patch fixes this.  But I'm not sure if it's the
best/correct fix.  Comments?

--8<---------------cut here---------------start------------->8---
@@ -3270,7 +3289,8 @@
     (if gnus-last-shell-command
 	(setq command gnus-last-shell-command)
       (error "A command is required")))
-  (gnus-eval-in-buffer-window gnus-article-buffer
+  (gnus-eval-in-buffer-window (or gnus-save-article-buffer
+				  gnus-article-buffer)
     (save-restriction
       (widen)
       (shell-command-on-region (point-min) (point-max) command nil)))
--8<---------------cut here---------------end--------------->8---

Bye, Reiner.
-- 
       ,,,
      (o o)
---ooO-(_)-Ooo--- PGP key available via WWW   http://rsteib.home.pages.de/




^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: headers argument in gnus-summary-pipe-output is ignored
  2003-10-22 13:31 headers argument in gnus-summary-pipe-output is ignored Reiner Steib
@ 2004-01-02 22:49 ` Lars Magne Ingebrigtsen
  2004-01-04 15:37   ` Reiner Steib
  0 siblings, 1 reply; 4+ messages in thread
From: Lars Magne Ingebrigtsen @ 2004-01-02 22:49 UTC (permalink / raw)


Reiner Steib <4.uce.03.r.s@nurfuerspam.de> writes:

> according to the doc-string, `M-: (gnus-summary-pipe-output 1 t) RET'
> should pipe the current article to a command, _including_ the headers:

[...]

> | If HEADERS (the symbolic prefix), include the headers, too.

[...]

> The following patch fixes this.  But I'm not sure if it's the
> best/correct fix.  Comments?

Well, it should take the symbolic prefix into account...

-- 
(domestic pets only, the antidote for overdose, milk.)
  larsi@gnus.org * Lars Magne Ingebrigtsen




^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: headers argument in gnus-summary-pipe-output is ignored
  2004-01-02 22:49 ` Lars Magne Ingebrigtsen
@ 2004-01-04 15:37   ` Reiner Steib
  2004-01-04 20:43     ` Lars Magne Ingebrigtsen
  0 siblings, 1 reply; 4+ messages in thread
From: Reiner Steib @ 2004-01-04 15:37 UTC (permalink / raw)


On Fri, Jan 02 2004, Lars Magne Ingebrigtsen wrote:

> Reiner Steib <4.uce.03.r.s@nurfuerspam.de> writes:
>
>> according to the doc-string, `M-: (gnus-summary-pipe-output 1 t) RET'
>> should pipe the current article to a command, _including_ the headers:
> [...]
>> | If HEADERS (the symbolic prefix), include the headers, too.
> [...]
>
>> The following patch fixes this.  But I'm not sure if it's the
>> best/correct fix.  Comments?
>
> Well, it should take the symbolic prefix into account...

Hm.  With my patch (see below), when I did `M-i a | xless RET' it
worked as expected (headers are included).  But then, it always
included them, also with a simple `|'.  Dunno why.  I don't really
understand the code.

Bye, Reiner.

--8<---------------cut here---------------start------------->8---
--- gnus-art.el.~6.380.~	Wed Dec 31 17:27:37 2003
+++ gnus-art.el	Sat Jan  3 21:05:19 2004
@@ -3279,7 +3279,8 @@
     (if gnus-last-shell-command
 	(setq command gnus-last-shell-command)
       (error "A command is required")))
-  (gnus-eval-in-buffer-window gnus-article-buffer
+  (gnus-eval-in-buffer-window (or gnus-save-article-buffer
+				  gnus-article-buffer)
     (save-restriction
       (widen)
       (shell-command-on-region (point-min) (point-max) command nil)))
--8<---------------cut here---------------end--------------->8---
-- 
       ,,,
      (o o)
---ooO-(_)-Ooo--- PGP key available via WWW   http://rsteib.home.pages.de/




^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: headers argument in gnus-summary-pipe-output is ignored
  2004-01-04 15:37   ` Reiner Steib
@ 2004-01-04 20:43     ` Lars Magne Ingebrigtsen
  0 siblings, 0 replies; 4+ messages in thread
From: Lars Magne Ingebrigtsen @ 2004-01-04 20:43 UTC (permalink / raw)


Reiner Steib <4.uce.03.r.s@nurfuerspam.de> writes:

> Hm.  With my patch (see below), when I did `M-i a | xless RET' it
> worked as expected (headers are included).  But then, it always
> included them, also with a simple `|'.  Dunno why.  I don't really
> understand the code.

If HEADERS is set, `gnus-save-all-headers' is bound, and that's
supposed to be used further down in the code...

-- 
(domestic pets only, the antidote for overdose, milk.)
  larsi@gnus.org * Lars Magne Ingebrigtsen




^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2004-01-04 20:43 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-10-22 13:31 headers argument in gnus-summary-pipe-output is ignored Reiner Steib
2004-01-02 22:49 ` Lars Magne Ingebrigtsen
2004-01-04 15:37   ` Reiner Steib
2004-01-04 20:43     ` Lars Magne Ingebrigtsen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).