Gnus development mailing list
 help / color / mirror / Atom feed
From: Jonas Steverud <tvrud@bredband.net>
Subject: Re: Adulterate summary lines
Date: Mon, 16 Aug 2004 17:40:09 +0200	[thread overview]
Message-ID: <m2oelb5bxi.fsf@c-ed5372d5.036-4-67626721.cust.bredbandsbolaget.se> (raw)
In-Reply-To: <m3pt5rl4kg.fsf@newsguy.com> (Harry Putnam's message of "Mon, 16 Aug 2004 06:12:31 -0500")

Harry Putnam <reader@newsguy.com> writes:

> Maybe something as simple as setting group summary line there.

I think that is the way to go, with the %u specifier.

> Where I loose it is where it says the function would be passed the
> current header.  Does that mean all headers in rotation or what.
> Could it be parts of the body too?

I wrote some test code:

(defun gnus-user-format-function-x (STR)
    (message (prin1-to-string STR))
  "test")

(setq gnus-summary-line-format "%U%R%z%I%(%[%4L: %ux%]%) %s\n") ;;
slight modification of my summary-line-format. Observe the %ux part.

The Message buffer:

[1841 "Adulterate summary lines" "Harry Putnam <reader@newsguy.com>"
"Mon, 16 Aug 2004 06:12:31 -0500" "<m3pt5rl4kg.fsf@newsguy.com>" ""
4863 59 "c-ed5372d5.036-4-67626721.cust.bredbandsbolaget.se Ding:1841"
((To . "ding@gnus.org") (User-Agent . "Gnus/5.110003 (No Gnus v0.3)
Emacs/21.3.50 (gnu/linux)"))]

I leave to others to interpret if that makes any sense or not. :-)

> Using this option how would one make the Keywords line appear in
> summary buffer or maybe the Date: line?

Let the gnus-user-format-function-x above return what you want to add
as a string.

> I see a specifier `o' that already comes close... with:
>
>   `o'
>      The `Date' in YYYYMMDD`T'HHMMSS format.
>
> But I'm finding that format too hard to read quickly.  I'd like to have
> my own function that produces MM/DD/YY HH:MM:SS and displays it in
> summary buffer.

Try to find the code for that and see if you wan write a
gnus-user-format-function-x which uses format-time-string to produce
what you want.

I did some search in gnus-sum.el and found
gnus-summary-line-format-alist. The line for 'd' was interesting:
    (?d (gnus-dd-mmm (mail-header-date gnus-tmp-header)) ?s)

In gnus-util.el:
(defun gnus-dd-mmm (messy-date)
  "Return a string like DD-MMM from a big messy string."
  (condition-case ()
      (format-time-string "%d-%b" (safe-date-to-time messy-date))
    (error "  -   ")))

I then did:

(defun gnus-user-format-function-x (STR)
    (condition-case ()
      (format-time-string "%d/%m/%y %H:%M:%S"
                 (safe-date-to-time (mail-header-date STR)))
    (error "  -   ")))


I when I enter the Ding group, your message looks like this:
   [  59: 16/08/04 13:12:31] Adulterate summary lines

How to change to an 12-hour clock with AM/PM is left as an exercise to
the reader but C-h f format-time-string is a big step in the right direction.

> I'm thinking it would then be possible to close group call `G p'
>
> Change the letter following %u and call a different function.  So one
> could close and reopen with a series of homemade functions if need be.

Sorry, but I don't understand those two paragraphs... :-(


This, I think, should get you going. HTH.

-- 
(        http://hem.bredband.net/steverud/        !     Wei Wu Wei     )
(        Meaning of U2 Lyrics, Roleplaying        !  To Do Without Do  )




  reply	other threads:[~2004-08-16 15:40 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-08-16 11:12 Harry Putnam
2004-08-16 15:40 ` Jonas Steverud [this message]
2004-08-17  0:15   ` Harry Putnam
2004-08-17  1:14   ` Harry Putnam
2004-08-17  7:41     ` Jonas Steverud
2004-08-17 11:29       ` Harry Putnam
2004-08-16 15:52 ` Gnus for information storage (Was: Adulterate summary lines) Robert Epprecht

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=m2oelb5bxi.fsf@c-ed5372d5.036-4-67626721.cust.bredbandsbolaget.se \
    --to=tvrud@bredband.net \
    /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).