Gnus development mailing list
 help / color / mirror / Atom feed
* Display something besides Subject line on request
@ 2001-11-02 19:07 Harry Putnam
  2001-11-02 19:56 ` Paul Jarc
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Harry Putnam @ 2001-11-02 19:07 UTC (permalink / raw)


I've successfully confused myself beyond all reason while reading the
gnus manual again...

First the wanted functionality:

To be able to cause the display of a different header in summary lines
on request.  Or on group parameter basis.

I think this is different than the To From stuff delt with at:

(How do those cool urls work again?)
info://gnus/To_From_Newsgroup     <== naa

C-h i m gnus g To From Newsgroups <RET>

I don't want to call this on the basis of From or other header.

Imagine this proceedure:

Assume I sometimes edit messages and add my own Keywords: header.
Later, to find messages based on info in that header I might say 
`& Keywords <RET> REGEXP <RET>' and at the command prompt: `#'. 

Gnus will dutifully tear thru the summary buffer marking any messages
with a keywords header containing REGEXP with `#'.  I can then view
those messages with `/ n'

At this point I want that limited buffer to display the Keywords
header instead of the Subject header.
When I pop that limit I want the Subject back.  Either by
M-x <something> or by hooking into the limiting some how.
I guess M-x <something> is the more reasonable.
One could say M-x <something> to  toggle Keywords and M-x <something>
again to go back to Subject.

This is different than making gnus display the Keywords header in the
visible headers when a message is opened.  I know how to do that.

This snippet from the above cited info section seems to be close to
what I'm looking for:

  2. The value of these extra headers can be accessed via the
     `gnus-extra-header' function.  Here's a format line spec that will
     access the `X-Newsreader' header:

          "%~(form (gnus-extra-header 'X-Newsreader))@"

But it doesn't really indicate where this goes.  The summary format
strings given as examples contain nothing like this.  Nor is it clear
if the `access' can be done at will or if it is a permanent part of
format string or what.

Further the Keywords line I may have added by gnus-edit-article will
not be in the nov file.  Unless I've run nnml-generate-nov... after
adding it and have code in .gnus to include keywords in the nov file.
This I also know how to do, but its not really what is necessary to get
the results described above.  Or at least not a very practicle way. 

Can something like this be done short of 8127 lines of complex lisp
code? And wearing out two keyboard getting the right lines?



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

* Re: Display something besides Subject line on request
  2001-11-02 19:07 Display something besides Subject line on request Harry Putnam
@ 2001-11-02 19:56 ` Paul Jarc
  2001-11-02 21:14   ` Harry Putnam
  2001-11-02 22:24 ` ShengHuo ZHU
  2001-11-02 22:40 ` Kai Großjohann
  2 siblings, 1 reply; 7+ messages in thread
From: Paul Jarc @ 2001-11-02 19:56 UTC (permalink / raw)


Harry Putnam <reader@newsguy.com> wrote:
> Further the Keywords line I may have added by gnus-edit-article will
> not be in the nov file.  Unless I've run nnml-generate-nov... after
> adding it and have code in .gnus to include keywords in the nov file.

Mostly unrelated to your problem, but nnmaildir stores article
modtimes along with NOV data, so if an article has been edited, its
NOV data is automatically updated as well.  Maybe this could be added
to nnml.

Speaking of nnmaildir, my paperwork is on file with the FSF, but I
haven't heard from Lars about CVS access, so if someone else wants to
commit it, feel free.


paul



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

* Re: Display something besides Subject line on request
  2001-11-02 19:56 ` Paul Jarc
@ 2001-11-02 21:14   ` Harry Putnam
  2001-11-02 21:37     ` Paul Jarc
  0 siblings, 1 reply; 7+ messages in thread
From: Harry Putnam @ 2001-11-02 21:14 UTC (permalink / raw)


prj@po.cwru.edu (Paul Jarc) writes:

> Harry Putnam <reader@newsguy.com> wrote:
>> Further the Keywords line I may have added by gnus-edit-article will
>> not be in the nov file.  Unless I've run nnml-generate-nov... after
>> adding it and have code in .gnus to include keywords in the nov file.
>
> Mostly unrelated to your problem, but nnmaildir stores article
> modtimes along with NOV data, so if an article has been edited, its
> NOV data is automatically updated as well.  Maybe this could be added
> to nnml.

Thanks for the info Paul,

You noted it isn't really related to what I want to do.  For example:
Even if the nov was updated that would have nothing to do with making
keywords header appear instead of Subject header in summary lines.

Unless you mean it would be more available since it is in .overview.
That may be a factor especially for speed.  But I'm thinking this
would be better if it was not required to be in .overview.  That is,
this function would plow thru the messages in the limited buffer, and
find the Keywords lines in real time.  Then display that instead of
Subject.

Not in the displayed message but in the summary lines. Over time that
would probably be faster since it would lack the overhead of having to
find and keep another field in .overview.  It would only happen on
demand. 

Now about on tap switching of summary lines.... any body have a
comment or advice? 

If it can't be done with existing functions... then I will donate the
two keyboards that will be worn out finding the right 8000+ lines of
code.. . .he he.  Anybody want a keyboard?



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

* Re: Display something besides Subject line on request
  2001-11-02 21:14   ` Harry Putnam
@ 2001-11-02 21:37     ` Paul Jarc
  2001-11-03  1:53       ` Harry Putnam
  0 siblings, 1 reply; 7+ messages in thread
From: Paul Jarc @ 2001-11-02 21:37 UTC (permalink / raw)


Harry Putnam <reader@newsguy.com> wrote:
> Unless you mean it would be more available since it is in .overview.
> That may be a factor especially for speed.  But I'm thinking this
> would be better if it was not required to be in .overview.  That is,
> this function would plow thru the messages in the limited buffer, and
> find the Keywords lines in real time.

I would view that as a hack to compensate for backends that allow
their NOV data to become stale.  Better to keep the NOV data up to
date, since it matters for *all* uses of NOV data, not just this one.
But maybe I'm biased. :)

> Over time that would probably be faster since it would lack the
> overhead of having to find and keep another field in .overview.  It
> would only happen on demand.

Hm, maybe.  More generally, we occasionally want to operate on
information which is normally not of interest, and thus not stored
with the NOV data - so it should be possible to do that without too
much trouble.  OTOH, when the information we want to operate on is
stored with the NOV data, we shouldn't have to pay the penalty of
rescanning the original message header; that should be done only when
necessary.  Maybe it could be determined automatically by looking at
gnus-extra-headers.  NOV data still ought to be kept up to date in any
case, IMO.


paul



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

* Re: Display something besides Subject line on request
  2001-11-02 19:07 Display something besides Subject line on request Harry Putnam
  2001-11-02 19:56 ` Paul Jarc
@ 2001-11-02 22:24 ` ShengHuo ZHU
  2001-11-02 22:40 ` Kai Großjohann
  2 siblings, 0 replies; 7+ messages in thread
From: ShengHuo ZHU @ 2001-11-02 22:24 UTC (permalink / raw)


Harry Putnam <reader@newsguy.com> writes:

> I've successfully confused myself beyond all reason while reading the
> gnus manual again...
>
> First the wanted functionality:
>
> To be able to cause the display of a different header in summary lines
> on request.  Or on group parameter basis.
>
> I think this is different than the To From stuff delt with at:
>
> (How do those cool urls work again?)
> info://gnus/To_From_Newsgroup     <== naa

Try <info://gnus/To+From+Newsgroup>


[...]

> At this point I want that limited buffer to display the Keywords
> header instead of the Subject header.
> When I pop that limit I want the Subject back.  Either by
> M-x <something> or by hooking into the limiting some how.
> I guess M-x <something> is the more reasonable.
> One could say M-x <something> to  toggle Keywords and M-x <something>
> again to go back to Subject.

You can write a user-defined spec function with a switch variable, and
write another function to toggle the variable and update the summary
lines.

> Further the Keywords line I may have added by gnus-edit-article will
> not be in the nov file.  Unless I've run nnml-generate-nov... after
> adding it and have code in .gnus to include keywords in the nov file.
> This I also know how to do, but its not really what is necessary to get
> the results described above.  Or at least not a very practicle way. 

The NOV updating code is in nnml.el and works for me. And also after
you g-e-a, the summary line is updated.  What are the values of your
gnus-extra-headers and nnmail-extra-headers?

ShengHuo



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

* Re: Display something besides Subject line on request
  2001-11-02 19:07 Display something besides Subject line on request Harry Putnam
  2001-11-02 19:56 ` Paul Jarc
  2001-11-02 22:24 ` ShengHuo ZHU
@ 2001-11-02 22:40 ` Kai Großjohann
  2 siblings, 0 replies; 7+ messages in thread
From: Kai Großjohann @ 2001-11-02 22:40 UTC (permalink / raw)
  Cc: ding

Harry Putnam <reader@newsguy.com> writes:

> At this point I want that limited buffer to display the Keywords
> header instead of the Subject header.

Whee.  Maybe it's easiest to make a %k entry in
gnus-summary-line-format-alist which shows the Keywords header, and
then you write a little function which limits, changes
gnus-summary-line-format to include %k instead of %f, and then a
similar function which pops the limit and sets
gnus-summary-line-format back.

Ick.

Is there a way to find out if the current summary is limited and what
that limit is?

Then Harry could write a function which does like %f unless the
current summary buffer is limited based on Keywords.

Harry, do you know that you can use `/ x' to limit based on extra
headers?  You could add Keywords to gnus-extra-headers and
nnmail-extra-headers.  Then you don't need the `& Keywords ...' thing.

kai
-- 
Lisp is kinda like tpircstsoP



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

* Re: Display something besides Subject line on request
  2001-11-02 21:37     ` Paul Jarc
@ 2001-11-03  1:53       ` Harry Putnam
  0 siblings, 0 replies; 7+ messages in thread
From: Harry Putnam @ 2001-11-03  1:53 UTC (permalink / raw)


prj@po.cwru.edu (Paul Jarc) writes:


[...]

>> Over time that would probably be faster since it would lack the
>> overhead of having to find and keep another field in .overview.  It
>> would only happen on demand.
>
> Hm, maybe.  More generally, we occasionally want to operate on
> information which is normally not of interest, and thus not stored
> with the NOV data - so it should be possible to do that without too
> much trouble.  OTOH, when the information we want to operate on is
> stored with the NOV data, we shouldn't have to pay the penalty of
> rescanning the original message header; that should be done only when

What I'm describing falls more in your first point there I think. If I
had said `X-Harry's special annotation once in a blue moon' It would
be clearer.  I actually would use it much more than that but still not
enough to add overhead to nov generation.  I used the extra header
Keywords and Message-id for many mnths, finally dropping the keywords
because I didn't use it that much.  However confined to specific
groups like groups where I might edit (add keywords) to articles
frequently.  So I still think this kind of usage would benefit from
not requiring nov data to work.  But like you say it should recognize
if the data is available and use it if so.

ShengHuo ZHU <zsh@cs.rochester.edu> writes:

> Try <info://gnus/To+From+Newsgroup>

Ahh cool .. thanks

> [...]
>
>> At this point I want that limited buffer to display the Keywords
>> header instead of the Subject header.
>> When I pop that limit I want the Subject back.  Either by
>> M-x <something> or by hooking into the limiting some how.
>> I guess M-x <something> is the more reasonable.
>> One could say M-x <something> to  toggle Keywords and M-x <something>
>> again to go back to Subject.

> You can write a user-defined spec function with a switch variable, and
> write another function to toggle the variable and update the summary
> lines.

This sounds like what I'm after.  You make it sound easy... If I only
had a brain.

>> Further the Keywords line I may have added by gnus-edit-article will
>> not be in the nov file.  Unless I've run nnml-generate-nov... after
>> adding it and have code in .gnus to include keywords in the nov file.
>> This I also know how to do, but its not really what is necessary to get
>> the results described above.  Or at least not a very practicle way. 
>
> The NOV updating code is in nnml.el and works for me. And also after
> you g-e-a, the summary line is updated.  What are the values of your
> gnus-extra-headers and nnmail-extra-headers?

Ohh cool... I wouldn't have seen that because I removed `keywords' some
time ago.  I am not having a problem understanding how to get keywords
into nov or to have it displayed in an open article as one of visible
headers.  But I didn't know about the update mechanism ... that is nifty.

My ambition here is as you've described, a switchable variable for
summary format line that can be toggled at will. Do you think that
would be mainline, usefull enough thing to be part of gnus?

Those two variables both say (To Newsgroups).  At one time I did have
keywords there.  But I notice entering large groups is really slow so
I dropped it.  I'm not really sure it helped though.

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

> Harry Putnam <reader@newsguy.com> writes:
>
>> At this point I want that limited buffer to display the Keywords
>> header instead of the Subject header.
>
> Whee.  Maybe it's easiest to make a %k entry in
> gnus-summary-line-format-alist which shows the Keywords header, and
> then you write a little function which limits, changes
> gnus-summary-line-format to include %k instead of %f, and then a
> similar function which pops the limit and sets
> gnus-summary-line-format back.

Yeah.. this sounds a lot like what ShengHuo suggested.
> Ick.

Why ick?  Too Kludgy?

> Is there a way to find out if the current summary is limited and what
> that limit is?

It might be as well to switch the whole group on and off.  Except in a
real large group that would be a time killer.

> Then Harry could write a function which does like %f unless the
> current summary buffer is limited based on Keywords.

Yeah yeah .. thats the ticket.

> Harry, do you know that you can use `/ x' to limit based on extra
> headers?  You could add Keywords to gnus-extra-headers and
> nnmail-extra-headers.  Then you don't need the `& Keywords ...' thing.

Yeah, I know about that but as I said I dropped the extra Keywords
header a while back.  So if I added it back `/ x' would come into
play.  Its cleaner and quicker with fewer steps.  I probably should
just keep `Keywords' in there.  I don't see a lot of improvement on
opening groups anyway.

The advantage of `& REGEXP', I think, is that you could search for any
header, not just ones in NOV, by using the `body' target.  You might
get a false hit once in while where someone has included some header
in the body but it would'nt be a big factor I don't think.

Using `& Body' target ` REGEXP' allows you to do cool things like
specify: 
`^User-Agent: [^G]' To catch any one cheating.. or
`^Received:.*[dorky.tw.spammer.IP]' To immediately find and delete all
that guff that shows up on the Texi list... he he.



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

end of thread, other threads:[~2001-11-03  1:53 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-11-02 19:07 Display something besides Subject line on request Harry Putnam
2001-11-02 19:56 ` Paul Jarc
2001-11-02 21:14   ` Harry Putnam
2001-11-02 21:37     ` Paul Jarc
2001-11-03  1:53       ` Harry Putnam
2001-11-02 22:24 ` ShengHuo ZHU
2001-11-02 22:40 ` 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).