Gnus development mailing list
 help / color / mirror / Atom feed
* gnus-treat-date-lapsed + gnus-treat-date-user-defined
@ 2005-08-19  9:08 Karl Chen
  2005-08-22 12:46 ` Katsumi Yamaoka
  0 siblings, 1 reply; 2+ messages in thread
From: Karl Chen @ 2005-08-19  9:08 UTC (permalink / raw)



I use both `gnus-treat-date-user-defined' and
`gnus-treat-date-lapsed', with `(setq
gnus-article-date-lapsed-new-header t)'.  This combination used to
work, but recently something changed (I couldn't find anything
relevant in cvs diffs or ChangeLog).

The problem is `gnus-article-date-lapsed' is run after
`gnus-treat-date-user', and `gnus-treat-date-user' deletes both
the Date: and X-Sent: headers when writing the new Date: header.
I imagine the date-{original,iso8601} have the same problem.  The
below patch fixes it by simply reordering them.

In the long term, a better solution would be:
- `gnus-treat-date-lapsed' only adds X-Sent:; never deletes Date:
- A new `gnus-treat-delete-date' deletes Date:
- Un-combine the X-Sent: and Date: reformatting functions


diff -u /usr/local/stow/emacs-cvs-20050817/share/emacs/22.0.50/lisp/gnus/.backup/gnus-art.el.\~1\~ /usr/local/stow/emacs-cvs-20050817/share/emacs/22.0.50/lisp/gnus/gnus-art.el
--- /usr/local/stow/emacs-cvs-20050817/share/emacs/22.0.50/lisp/gnus/.backup/gnus-art.el.~1~	2005-08-06 12:51:41.000000000 -0700
+++ /usr/local/stow/emacs-cvs-20050817/share/emacs/22.0.50/lisp/gnus/gnus-art.el	2005-08-19 01:57:12.000000000 -0700
@@ -1481,10 +1481,10 @@
     (gnus-treat-date-ut gnus-article-date-ut)
     (gnus-treat-date-local gnus-article-date-local)
     (gnus-treat-date-english gnus-article-date-english)
-    (gnus-treat-date-lapsed gnus-article-date-lapsed)
     (gnus-treat-date-original gnus-article-date-original)
     (gnus-treat-date-user-defined gnus-article-date-user)
     (gnus-treat-date-iso8601 gnus-article-date-iso8601)
+    (gnus-treat-date-lapsed gnus-article-date-lapsed)
     (gnus-treat-display-x-face gnus-article-display-x-face)
     (gnus-treat-display-face gnus-article-display-face)
     (gnus-treat-hide-headers gnus-article-maybe-hide-headers)


-- 
Karl 2005-08-19 02:00



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

* Re: gnus-treat-date-lapsed + gnus-treat-date-user-defined
  2005-08-19  9:08 gnus-treat-date-lapsed + gnus-treat-date-user-defined Karl Chen
@ 2005-08-22 12:46 ` Katsumi Yamaoka
  0 siblings, 0 replies; 2+ messages in thread
From: Katsumi Yamaoka @ 2005-08-22 12:46 UTC (permalink / raw)
  Cc: ding

>>>>> In <quack.20050819T0208.lthk6iiwayf@roar.cs.berkeley.edu> Karl Chen wrote:

> I use both `gnus-treat-date-user-defined' and
> `gnus-treat-date-lapsed', with `(setq
> gnus-article-date-lapsed-new-header t)'.  This combination used to
> work, but recently something changed (I couldn't find anything
> relevant in cvs diffs or ChangeLog).

I did it, sorry.  I was not aware those who use
`gnus-treat-date-user-defined' also use other date treatments.
Because it is possible to insert any date headers using
`gnus-article-time-format'.  For example:

(setq gnus-treat-date-user-defined 'head
      gnus-article-time-format
      (lambda (time)
	(let ((date (message-make-date time)))
	  (format "Date: %s\nX-Sent: %s"
		  (article-make-date-line date 'ut)
		  (article-make-date-line date 'lapsed)))))

(The code is inefficient, so it's no more than an example,
though.)

> The problem is `gnus-article-date-lapsed' is run after
> `gnus-treat-date-user', and `gnus-treat-date-user' deletes both
> the Date: and X-Sent: headers when writing the new Date: header.
> I imagine the date-{original,iso8601} have the same problem.  The
> below patch fixes it by simply reordering them.

The patch seems good anyway, and I cannot imagine any obstacle
occurring with it.  So, I'd like to install it, later.

> In the long term, a better solution would be:
> - `gnus-treat-date-lapsed' only adds X-Sent:; never deletes Date:
> - A new `gnus-treat-delete-date' deletes Date:
> - Un-combine the X-Sent: and Date: reformatting functions

I think it's worth to make a study of them.  Thanks.



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

end of thread, other threads:[~2005-08-22 12:46 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-08-19  9:08 gnus-treat-date-lapsed + gnus-treat-date-user-defined Karl Chen
2005-08-22 12:46 ` Katsumi Yamaoka

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).