* patch: gnus-article-time-format; extending customization
@ 1998-02-09 12:04 jari.aalto
0 siblings, 0 replies; only message in thread
From: jari.aalto @ 1998-02-09 12:04 UTC (permalink / 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
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~1998-02-09 12:04 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1998-02-09 12:04 patch: gnus-article-time-format; extending customization jari.aalto
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).