Gnus development mailing list
 help / color / mirror / Atom feed
* Piping article + header
@ 2002-07-03 16:40 Vin Shelton
  2002-07-03 16:49 ` Kai Großjohann
  0 siblings, 1 reply; 12+ messages in thread
From: Vin Shelton @ 2002-07-03 16:40 UTC (permalink / raw)


I need to be able to save an article as a file with a name based on
its message-id.  In order to do this, I wrote a simple filter (in
*gasp* perl - I know, I should probably turn in my XEmacs decoder ring
for not using elisp, but I thought it would be cool to have something
that worked from the shell command line).  The filter extracts the
message-id from the header and saves the message to a file name based
on the message-id.  This works fine standalone, but when I try to use
gnus-summary-pipe-output, the Message-id: header has been elided from
the article.  If I add 'Message-id' to gnus-visible-headers, my filter
works fine, but that's a pretty yucky solution, 'cause most of the
time I don't want to see the message-id.

Basically what I need is a way to make all headers visible before
calling gnus-summary-pipe-output.  I tried using advice to do this:

  (defadvice gnus-summary-pipe-output
    (around acs::show-all-headers-visible activate)
    "Make all headers visible before piping the message to a program"
    (let ((gnus-show-all-headers t))
          ad-do-it))

but it appears that gnus-show-all-headers must be non-nil _at the time
the article is displayed_.  Essentially, my advice had no effect.

Is there any way to make the entire article (header + body) available
to my filter?  Does anyone have any thoughts, comments or suggestions?

TIA,
  Vin

-- 
In a minute there is time
For decisions and revisions which a minute will reverse.         T.S. Eliot
[URL: http://www.cs.amherst.edu/~ccm/prufrock.html]



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

* Re: Piping article + header
  2002-07-03 16:40 Piping article + header Vin Shelton
@ 2002-07-03 16:49 ` Kai Großjohann
  2002-07-03 17:07   ` Vin Shelton
  0 siblings, 1 reply; 12+ messages in thread
From: Kai Großjohann @ 2002-07-03 16:49 UTC (permalink / raw)
  Cc: ding

Can you type `t |' instead of `|'?
kai
-- 
A large number of young women don't trust men with beards.  (BFBS Radio)



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

* Re: Piping article + header
  2002-07-03 16:49 ` Kai Großjohann
@ 2002-07-03 17:07   ` Vin Shelton
  2002-07-03 20:59     ` Kai Großjohann
  0 siblings, 1 reply; 12+ messages in thread
From: Vin Shelton @ 2002-07-03 17:07 UTC (permalink / raw)


D'oh! Yes, that seems pretty simple.

TIA,
  vin

Kai.Grossjohann@CS.Uni-Dortmund.DE (Kai Großjohann) writes:
> Can you type `t |' instead of `|'?

-- 
In a minute there is time
For decisions and revisions which a minute will reverse.         T.S. Eliot
[URL: http://www.cs.amherst.edu/~ccm/prufrock.html]



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

* Re: Piping article + header
  2002-07-03 17:07   ` Vin Shelton
@ 2002-07-03 20:59     ` Kai Großjohann
  2002-07-03 22:15       ` Frank Schmitt
       [not found]       ` <m24rffubnf.fsf@tnuctip.rychter.com>
  0 siblings, 2 replies; 12+ messages in thread
From: Kai Großjohann @ 2002-07-03 20:59 UTC (permalink / raw)
  Cc: ding

Vin Shelton <acs@xemacs.org> writes:

> D'oh! Yes, that seems pretty simple.

It's only a workaround, though.  Hm.  It's not clear to me whether
the headers should be there or not.  It seems easy enough to decide
what to pass to the shell command by hitting `t' or `C-u g' or
suchlike first, but it's so _manual_.  Hm.

Does anyone have an idea what should happen?

kai
-- 
A large number of young women don't trust men with beards.  (BFBS Radio)



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

* Re: Piping article + header
  2002-07-03 20:59     ` Kai Großjohann
@ 2002-07-03 22:15       ` Frank Schmitt
  2002-07-04  7:55         ` Sean Neakums
  2002-07-04 10:28         ` Kai Großjohann
       [not found]       ` <m24rffubnf.fsf@tnuctip.rychter.com>
  1 sibling, 2 replies; 12+ messages in thread
From: Frank Schmitt @ 2002-07-03 22:15 UTC (permalink / raw)


Kai.Grossjohann@CS.Uni-Dortmund.DE (Kai Großjohann) writes:

> It's only a workaround, though.  Hm.  It's not clear to me whether
> the headers should be there or not.  It seems easy enough to decide
> what to pass to the shell command by hitting `t' or `C-u g' or
> suchlike first, but it's so _manual_.  Hm.
>
> Does anyone have an idea what should happen?

Define a function pipe-with headers, which first toggles headers, then
pipes and then toggles headers again? Or make C-u | do it?

-- 
One Ring to rule them all, One Ring to find them,
One Ring to bring them all and in the darkness bind them
In the Land of Mordor where the Shadows lie.



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

* Re: Piping article + header
  2002-07-03 22:15       ` Frank Schmitt
@ 2002-07-04  7:55         ` Sean Neakums
  2002-07-04 10:28         ` Kai Großjohann
  1 sibling, 0 replies; 12+ messages in thread
From: Sean Neakums @ 2002-07-04  7:55 UTC (permalink / raw)


commence  Frank Schmitt quotation:

> Define a function pipe-with headers, which first toggles headers, then
> pipes and then toggles headers again? Or make C-u | do it?

I'd vote for `C-u |', if this were in fact a vote.

-- 
 /
[|] Sean Neakums
[|] <sneakums@zork.net>
 \



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

* Re: Piping article + header
  2002-07-03 22:15       ` Frank Schmitt
  2002-07-04  7:55         ` Sean Neakums
@ 2002-07-04 10:28         ` Kai Großjohann
  2002-07-04 10:34           ` Sean Neakums
  1 sibling, 1 reply; 12+ messages in thread
From: Kai Großjohann @ 2002-07-04 10:28 UTC (permalink / raw)
  Cc: ding

Frank Schmitt <usereplyto@Frank-Schmitt.net> writes:

> Define a function pipe-with headers, which first toggles headers, then
> pipes and then toggles headers again? Or make C-u | do it?

Let's talk about the user interface, not the implementation.

So C-u | should pipe with all headers.  But is an incompatible
change, it now pipes 4 articles.

How should we pipe the raw article?

kai
-- 
A large number of young women don't trust men with beards.  (BFBS Radio)



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

* Re: Piping article + header
       [not found]       ` <m24rffubnf.fsf@tnuctip.rychter.com>
@ 2002-07-04 10:29         ` Kai Großjohann
  0 siblings, 0 replies; 12+ messages in thread
From: Kai Großjohann @ 2002-07-04 10:29 UTC (permalink / raw)
  Cc: ding

Jan Rychter <jan@rychter.com> writes:

>>>>>> "Kai" == Kai Gro <Kai.Grossjohann@CS.Uni-Dortmund.DE>:
>  Kai> Vin Shelton <acs@xemacs.org> writes:
>  >> D'oh! Yes, that seems pretty simple.
>
>  Kai> It's only a workaround, though.  Hm.  It's not clear to me whether
>  Kai> the headers should be there or not.  It seems easy enough to
>  Kai> decide what to pass to the shell command by hitting `t' or `C-u g'
>  Kai> or suchlike first, but it's so _manual_.  Hm.
>
>  Kai> Does anyone have an idea what should happen?
>
> Why would you ever want to pipe an article *without* headers?

Note that `|' pipes the headers you see, instead of no headers at all.

People might have been doing `| lpr', and surely there it makes sense
to pipe only the displayed (presumably, the important) headers,
instead of all headers.

kai
-- 
A large number of young women don't trust men with beards.  (BFBS Radio)



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

* Re: Piping article + header
  2002-07-04 10:28         ` Kai Großjohann
@ 2002-07-04 10:34           ` Sean Neakums
  2002-07-04 11:44             ` Kai Großjohann
  0 siblings, 1 reply; 12+ messages in thread
From: Sean Neakums @ 2002-07-04 10:34 UTC (permalink / raw)
  Cc: ding

commence  Kai Großjohann quotation:

> Frank Schmitt <usereplyto@Frank-Schmitt.net> writes:
>
>> Define a function pipe-with headers, which first toggles headers,
>> then pipes and then toggles headers again? Or make C-u | do it?
>
> Let's talk about the user interface, not the implementation.
>
> So C-u | should pipe with all headers.  But is an incompatible
> change, it now pipes 4 articles.

Oops, I withdraw my vote.

> How should we pipe the raw article?

Negative prefix?

-- 
 /
[|] Sean Neakums
[|] <sneakums@zork.net>
 \



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

* Re: Piping article + header
  2002-07-04 10:34           ` Sean Neakums
@ 2002-07-04 11:44             ` Kai Großjohann
  2002-07-04 12:29               ` Sean Neakums
  0 siblings, 1 reply; 12+ messages in thread
From: Kai Großjohann @ 2002-07-04 11:44 UTC (permalink / raw)
  Cc: ding

Sean Neakums <sneakums@zork.net> writes:

> Negative prefix?

Heh, that pipes the previous N articles (instead of the next N, for a
positive prefix).

One _could_ use a prefix arg of 0...

kai
-- 
A large number of young women don't trust men with beards.  (BFBS Radio)



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

* Re: Piping article + header
  2002-07-04 11:44             ` Kai Großjohann
@ 2002-07-04 12:29               ` Sean Neakums
  2002-12-30 19:29                 ` Lars Magne Ingebrigtsen
  0 siblings, 1 reply; 12+ messages in thread
From: Sean Neakums @ 2002-07-04 12:29 UTC (permalink / raw)
  Cc: ding

commence  Kai Großjohann quotation:

> Sean Neakums <sneakums@zork.net> writes:
>
>> Negative prefix?
>
> Heh, that pipes the previous N articles (instead of the next N, for
> a positive prefix).
>
> One _could_ use a prefix arg of 0...

It'd be nice if the headers-or-not flag were orthogonal to the numeric
prefix entirely, so that one could pipe N articles with our without
full headers.  How about the symbolic prefix?  `M-i h |', perhaps?

-- 
 /
[|] Sean Neakums
[|] <sneakums@zork.net>
 \



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

* Re: Piping article + header
  2002-07-04 12:29               ` Sean Neakums
@ 2002-12-30 19:29                 ` Lars Magne Ingebrigtsen
  0 siblings, 0 replies; 12+ messages in thread
From: Lars Magne Ingebrigtsen @ 2002-12-30 19:29 UTC (permalink / raw)


Sean Neakums <sneakums@zork.net> writes:

> It'd be nice if the headers-or-not flag were orthogonal to the numeric
> prefix entirely, so that one could pipe N articles with our without
> full headers.  How about the symbolic prefix?  `M-i h |', perhaps?

I've now done this.

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



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

end of thread, other threads:[~2002-12-30 19:29 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-07-03 16:40 Piping article + header Vin Shelton
2002-07-03 16:49 ` Kai Großjohann
2002-07-03 17:07   ` Vin Shelton
2002-07-03 20:59     ` Kai Großjohann
2002-07-03 22:15       ` Frank Schmitt
2002-07-04  7:55         ` Sean Neakums
2002-07-04 10:28         ` Kai Großjohann
2002-07-04 10:34           ` Sean Neakums
2002-07-04 11:44             ` Kai Großjohann
2002-07-04 12:29               ` Sean Neakums
2002-12-30 19:29                 ` Lars Magne Ingebrigtsen
     [not found]       ` <m24rffubnf.fsf@tnuctip.rychter.com>
2002-07-04 10:29         ` Kai Großjohann

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).