Gnus development mailing list
 help / color / mirror / Atom feed
From: <jari.aalto@poboxes.com>
Subject: patch: gnus-article-time-format; extending customization
Date: 09 Feb 1998 14:04:19 +0200	[thread overview]
Message-ID: <tbiuqpj870.fsf@pegasus.tele.nokia.fi> (raw)

[-- Attachment #1: Type: text/plain, Size: 677 bytes --]



    I follewed the discussion about the Date values and at the same
    time I noticed that the 'user option restricted to only formats
    known to `format-time-string' function. The following patch will
    extend the variable gnus-article-time-format to accept a function
    symbol as well, so that user can have complete control over
    generated Date: field.

    In my case I prefer seeing the both lapsed time (without seconds) and
    the ISO date in the same field, like this after hitting W t s

	Date: 1 hour, 45 minutes -- 1998-02-09 12:08 Mon EET

    The patch makes this possible. (I have signed and returned 
    the Gnus disclaimer)

    Cheers!
    jari


[-- Attachment #2: gnus-art.el.diff --]
[-- Type: application/octet-stream, Size: 1460 bytes --]

Prereq: 1.1

===================================================================
RCS file: RCS/gnus-art.el,v
retrieving revision 1.1
diff -u -bw -r1.1 gnus-art.el
--- 1.1	1998/02/09 11:39:48
+++ gnus-art.el	1998/02/09 11:56:00
@@ -247,8 +247,12 @@
 
 (defcustom gnus-article-time-format "%a, %b %d %Y %T %Z"
   "Format for display of Date headers in article bodies.
-See `format-time-string' for the possible values."
-  :type 'string
+See `format-time-string' for the possible values.
+
+The avalue can also be function symbol, which should return a complete
+'Date: ' header. Function is called with one argument, `date' which can
+be feed to `format-time-string'."
+  :type '(choice string symbol)
   :link '(custom-manual "(gnus)Article Date")
   :group 'gnus-article-washing)
 
@@ -1336,6 +1340,13 @@
     (concat "Date: " date))
    ;; Let the user define the format.
    ((eq type 'user)
+    (if (symbolp gnus-article-time-format)
+	(funcall
+	 gnus-article-time-format
+	 (ignore-errors
+	   (gnus-encode-date
+	    (timezone-make-date-arpa-standard
+	     date nil "UT"))))
     (concat
      "Date: "
      (format-time-string gnus-article-time-format
@@ -1342,7 +1353,7 @@
 			 (ignore-errors
 			   (gnus-encode-date
 			    (timezone-make-date-arpa-standard
-			     date nil "UT"))))))
+			       date nil "UT")))))))
    ;; Do an X-Sent lapsed format.
    ((eq type 'lapsed)
     ;; If the date is seriously mangled, the timezone functions are

                 reply	other threads:[~1998-02-09 12:04 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=tbiuqpj870.fsf@pegasus.tele.nokia.fi \
    --to=jari.aalto@poboxes.com \
    --cc=jari.aalto@ntc.nokia.com \
    /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).