The default behavior in emacs-25 for the following code is for message citation lines to display the time in UTC, even if (current-time-zone) returns a local time zone such as (-18000 "EST"), and even though (current-time-string) correctly returns a result in local time, and even though my "TZ" environment variable and /etc/localtime are properly set to my local time zone ...
(setq message-citation-line-format "On %a %d-%b-%Y at %T %Z, %f wrote:\n") (setq message-citation-line-function 'message-insert-formatted-citation-line)
If I want the citation line to show the time in local time instead of UTC, I have to wrap message-insert-formatted-citation-line as follows ...
(defun my-message-insert-formatted-citation-line () (message-insert-formatted-citation-line nil nil (car (current-time-zone)))) (setq message-citation-line-function 'my-message-insert-formatted-citation-line)
However, even with this hack, the citation line shows the time zone as a number (e.g., "-0500") for both the %Z and %z format characters.
I'd like the citation line to show the time zone using the actual timezone ID from (cdr (current-time-zone)) instead of a number. In my case, that would be "EST".
In other words, I'd like the citation lines to look something like this:
On Thu 04-Jul-1776 at 12:34:56 EST, Thomas Jefferson <email@example.com> wrote:
Note the "EST", which now can only appear as "-0500".
If I pass (cdr (current-time-zone)) as the final argument to message-insert-formatted-citation-line, it is ignored, and the time is once again displayed in UTC.
Does anyone know of an already-existing alternative function for creating citation lines, which doesn't default to UTC, and which properly shows the local time with the actual name of the time zone?
I know I could copy the message-insert-formatted-citation-line function from gnus/message.el to a new function called my-message-insert-formatted-citation-line and change how it handles its "tz" parameter. However, that is a long, complicated function, and I'd rather make use of something that has already been written, if such a function exists anywhere, than to hack this existing function.
Does anyone know of a pre-existing alternative to message-insert-formatted-citation-line that works the way I'd like?
Thank you very much, in advance.