Gnus development mailing list
 help / color / mirror / Atom feed
From: Kai.Grossjohann@CS.Uni-Dortmund.DE (Kai Großjohann)
Cc: ding@gnus.org
Subject: Re: Summary format - the `u' spec
Date: 04 Mar 2001 18:54:33 +0100	[thread overview]
Message-ID: <vafd7bxh12e.fsf@lucy.cs.uni-dortmund.de> (raw)
In-Reply-To: <m3hf19ld2y.fsf@gnus.cvs.983032537> (Harry Putnam's message of "04 Mar 2001 08:21:59 -0800")

On 04 Mar 2001, Harry Putnam wrote:

> Hopefully I'm, correct in thinking the line that says:
> "...The function will be passed the current header as argument."
> Means that all header lines get scanned.

Hm, no, not really.  `Mail header' in this context (oh, how I love the
inconsistent terminology in Gnus!) is a structure which contains the
information from the NOV (or overview) file/data in a Lisp-predigested
form.  For example, if X is such a header, then (mail-header-subject
X) returns a string, the subject of the message.

Such a header contains only those bits of information that are present
in the overview file.  For nnml, you can put more information into the
overview file using the variables gnus-extra-headers and
nnmail-extra-headers.  Not sure if this works with NNTP (news) servers.

> I want to use this option to cause gnus to scan the headers for this
> pattern `^Keywords: \\[A\\] '.  And if found, to insert the capital
> letter found inside the [] into th summary display.

Ah.  Yes.  Hm.  What you want is to

    (add-to-list 'nnmail-extra-headers 'Keywords)
    (add-to-list 'gnus-extra-headers 'Keywords)

And then you can do:

    (defun gnus-user-format-function-H (header)
      (let* ((xtra (mail-header-extra header))
             (kw (cdr (assq 'Keywords xtra))))
        (if (and kw (stringp kw))
            (substring kw 0 5)
          "    ")))

This is untested.  Not sure if it works.  It tries to print the first
5 or 6 characters of the Keywords header, or spaces (if there is no
Keywords header).

Does this work, and can you take it from here?

kai
-- 
Be indiscrete.  Do it continuously.



  reply	other threads:[~2001-03-04 17:54 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-03-04 16:21 Harry Putnam
2001-03-04 17:54 ` Kai Großjohann [this message]
2001-03-04 21:52   ` Harry Putnam
2001-03-05  0:39     ` Alex Schroeder
2001-03-05  1:07       ` Harry Putnam
2001-03-05 20:52         ` Alex Schroeder
2001-03-05 23:59           ` Harry Putnam
2001-03-05  9:29       ` Kai Großjohann
2001-03-04 21:21 ` Pavel Janík ml.

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=vafd7bxh12e.fsf@lucy.cs.uni-dortmund.de \
    --to=kai.grossjohann@cs.uni-dortmund.de \
    --cc=ding@gnus.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).