all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* gnus-user-format-function extract header
@ 2014-05-01 14:11 David Hume
  2014-05-01 14:21 ` Emanuel Berg
  0 siblings, 1 reply; 6+ messages in thread
From: David Hume @ 2014-05-01 14:11 UTC (permalink / raw)
  To: help-gnu-emacs

I have defined a function gnus-user-format-function-Q which is called
when the group summary is displayed, because I have placed %uQ in the
group-summary-line-format variable. This function appears to get passed
a sequence. What I would like is to get the headers of the current
article being listed into this function. Is that possible? I.e. I would
like to display on the summary line some information from the article
headers.


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

* Re: gnus-user-format-function extract header
  2014-05-01 14:11 gnus-user-format-function extract header David Hume
@ 2014-05-01 14:21 ` Emanuel Berg
  2014-05-01 14:33   ` David Hume
  0 siblings, 1 reply; 6+ messages in thread
From: Emanuel Berg @ 2014-05-01 14:21 UTC (permalink / raw)
  To: help-gnu-emacs

David Hume <David.Hume@example.com> writes:

> I have placed %uQ in the group-summary-line-format

Should that be gnus-...?

> This function appears to get passed a sequence. What
> I would like is to get the headers of the current
> article being listed into this function. Is that
> possible? I.e. I would like to display on the summary
> line some information from the article headers.

If you check out the gnus-summary-line-format help, you
see a long list of what to put in it, and almost every
option is related to headers - what header information
do you want to show, that isn't possible to show
already the built-in way?

-- 
underground experts united:
http://user.it.uu.se/~embe8573


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

* Re: gnus-user-format-function extract header
  2014-05-01 14:21 ` Emanuel Berg
@ 2014-05-01 14:33   ` David Hume
  2014-05-01 14:46     ` Emanuel Berg
  2014-05-02 23:54     ` Emanuel Berg
  0 siblings, 2 replies; 6+ messages in thread
From: David Hume @ 2014-05-01 14:33 UTC (permalink / raw)
  To: help-gnu-emacs

Emanuel Berg <embe8573@student.uu.se> writes:

>> I have placed %uQ in the group-summary-line-format
>
> Should that be gnus-...?

Yes. I have typed it several thousand times but still get it wrong.


> If you check out the gnus-summary-line-format help, you
> see a long list of what to put in it, and almost every
> option is related to headers - what header information
> do you want to show, that isn't possible to show
> already the built-in way?

I have checked it out, that's how I found out about %uQ. But the
information I want is from a non-standard header.


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

* Re: gnus-user-format-function extract header
  2014-05-01 14:33   ` David Hume
@ 2014-05-01 14:46     ` Emanuel Berg
  2014-05-02 23:54     ` Emanuel Berg
  1 sibling, 0 replies; 6+ messages in thread
From: Emanuel Berg @ 2014-05-01 14:46 UTC (permalink / raw)
  To: help-gnu-emacs

David Hume <David.Hume@example.com> writes:

> I have checked it out, that's how I found out about
> %uQ. But the information I want is from a
> non-standard header.

Aha! Clear.

-- 
underground experts united:
http://user.it.uu.se/~embe8573


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

* Re: gnus-user-format-function extract header
  2014-05-01 14:33   ` David Hume
  2014-05-01 14:46     ` Emanuel Berg
@ 2014-05-02 23:54     ` Emanuel Berg
  2014-05-03 10:19       ` David Hume
  1 sibling, 1 reply; 6+ messages in thread
From: Emanuel Berg @ 2014-05-02 23:54 UTC (permalink / raw)
  To: help-gnu-emacs

David Hume <David.Hume@example.com> writes:

>> If you check out the gnus-summary-line-format help,
>> you see a long list of what to put in it, and almost
>> every option is related to headers - what header
>> information do you want to show, that isn't possible
>> to show already the built-in way?
>
> I have checked it out, that's how I found out about
> %uQ. But the information I want is from a
> non-standard header.

Try this:

(defun gnus-user-format-function-A (header)
  (format "%s" header))

(setq gnus-summary-line-format "%2{%U%} %0{%I%a%} %1{%s%}%uA\n")

As you see, the header argument doesn't seem to be
*all* headers. If you add a goofy header, it doesn't
appear.

But: you have a mean of identifying the message, so I
take it you can hit the disk, extract the goofy header
with a grep (and cut), and return it.

-- 
underground experts united:
http://user.it.uu.se/~embe8573


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

* Re: gnus-user-format-function extract header
  2014-05-02 23:54     ` Emanuel Berg
@ 2014-05-03 10:19       ` David Hume
  0 siblings, 0 replies; 6+ messages in thread
From: David Hume @ 2014-05-03 10:19 UTC (permalink / raw)
  To: help-gnu-emacs

Emanuel Berg <embe8573@student.uu.se> writes:

> Try this:
>
> (defun gnus-user-format-function-A (header)
>   (format "%s" header))
>
> (setq gnus-summary-line-format "%2{%U%} %0{%I%a%} %1{%s%}%uA\n")
>
> As you see, the header argument doesn't seem to be
> *all* headers. If you add a goofy header, it doesn't
> appear.
>
> But: you have a mean of identifying the message, so I
> take it you can hit the disk, extract the goofy header
> with a grep (and cut), and return it.

I wrote some code to output all of the items in the sequence provided
(header) into the message buffer. As you say, what I wanted wasn't
there. But you have given me an idea. Somewhere I think I read that you
can define what information is in an article summary. Maybe I can
configure that to include the extra headers...

I don't know how to go about getting the article, it probably isn't on
the disk because it only gets them from the server when I select
them. Probably loading all the articles in the summary list would be a
waste of time with too much internet access.


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

end of thread, other threads:[~2014-05-03 10:19 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-05-01 14:11 gnus-user-format-function extract header David Hume
2014-05-01 14:21 ` Emanuel Berg
2014-05-01 14:33   ` David Hume
2014-05-01 14:46     ` Emanuel Berg
2014-05-02 23:54     ` Emanuel Berg
2014-05-03 10:19       ` David Hume

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.