gnus and parse-time.el

20 views
Skip to first unread message

Prof. Dr. Rainer Thiel

unread,
Mar 15, 2012, 6:23:43 PM3/15/12
to
I am configuring the variables parse-time-months and parse-time-weekdays
(to use German names to insert dates in org-mode). Since I upgraded to
Emacs 24 (GNU Emacs 24.0.93.1), this results in an error when starting
up gnus. The error message runs:

-->
Reading d:/gnus/.newsrc.eld...
byte-code: Invalid date: Thu, 15 Mar 2012 22:27:41 +0100
<--

This did not happen in Emacs 23 with the same configuration.

Can anyone help me solve or work around this behaviour?
--
Prof. Dr. Rainer Thiel
Institut für Altertumswissenschaften
07737 Jena, Germany (EU)
r.t...@uni-jena.de

Brendan Halpin

unread,
Mar 16, 2012, 6:27:48 AM3/16/12
to
(parse-time-string "Thu, 15 Mar 2012 22:27:41 +0100")
=> (41 27 22 15 3 2012 4 nil 3600)

(emacs-version)
=> "GNU Emacs 24.0.94.1 (i486-pc-linux-gnu, GTK+ Version 3.2.3)
of 2012-03-12 on zelenka, modified by Debian"

Have you perhaps some byte-compiled gnus files in your path that come
from the earlier installation?

Brendan
--
Brendan Halpin, Department of Sociology, University of Limerick, Ireland
Tel: w +353-61-213147 f +353-61-202569 h +353-61-338562; Room F1-009 x 3147
mailto:brendan...@ul.ie ULSociology on Facebook: http://on.fb.me/fjIK9t
http://teaching.sociology.ul.ie/bhalpin/wordpress twitter:@ULSociology

Prof. Dr. Rainer Thiel

unread,
Mar 16, 2012, 10:23:26 AM3/16/12
to
brendan...@ul.ie (Brendan Halpin) writes:

> Have you perhaps some byte-compiled gnus files in your path that come
> from the earlier installation?

I think I can exclude that, unfortunately, but it was definitely a guess
worth tracking, thank you.

Perhaps I should have added that I am running Emacs 24 under WIndows 32
(XP and Vista).

Lars Magne Ingebrigtsen

unread,
Mar 22, 2012, 2:54:01 PM3/22/12
to
r.t...@uni-jena.de (Prof. Dr. Rainer Thiel) writes:

> Reading d:/gnus/.newsrc.eld...
> byte-code: Invalid date: Thu, 15 Mar 2012 22:27:41 +0100

`(setq debug-on-error t)', repeat the bug and post the resulting
backtrace.

--
(domestic pets only, the antidote for overdose, milk.)
bloggy blog http://lars.ingebrigtsen.no/

Michael Heerdegen

unread,
Mar 18, 2012, 4:18:25 PM3/18/12
to info-gnu...@gnu.org, Prof. Dr. Rainer Thiel
r.t...@uni-jena.de (Prof. Dr. Rainer Thiel) writes:

> I am configuring the variables parse-time-months and parse-time-weekdays
> (to use German names to insert dates in org-mode). Since I upgraded to
> Emacs 24 (GNU Emacs 24.0.93.1), this results in an error when starting
> up gnus. The error message runs:

What values of `parse-time-months' and `parse-time-weekdays' do you use?


Michael

Rainer Thiel

unread,
Mar 18, 2012, 5:01:57 PM3/18/12
to Michael Heerdegen, info-gnu...@gnu.org
Am 18. März 2012 21:18 schrieb Michael Heerdegen <michael_...@web.de>:
> What values of `parse-time-months' and `parse-time-weekdays' do you use?

This is the configuration I am using:

(defvar parse-time-months '(("jan" . 1) ("feb" . 2) ("mär" . 3)
("apr" . 4) ("mai" . 5) ("jun" . 6)
("jul" . 7) ("aug" . 8) ("sep" . 9)
("okt" . 10) ("nov" . 11) ("dez" . 12)
("Januar" . 1) ("Februar" . 2)
("März" . 3) ("April" . 4) ("Juni" . 6)
("Juli" . 7) ("August" . 8)
("September" . 9) ("Oktober" . 10)
("November" . 11) ("Dezember" . 12)))
(defvar parse-time-weekdays '(("so" . 0) ("mo" . 1) ("di" . 2)
("mi" . 3) ("do" . 4) ("fr" . 5)
("sa" . 6) ("Sonntag" . 0) ("Montag" . 1)
("Dienstag" . 2) ("Mittwoch" . 3)
("Donnerstag" . 4) ("Freitag" . 5)
("Sonnabend" . 6)))

Thanks for any idea that might help

Rainer


Am 18. März 2012 21:18 schrieb Michael Heerdegen <michael_...@web.de>:
> r.t...@uni-jena.de (Prof. Dr. Rainer Thiel) writes:
>
>> I am configuring the variables parse-time-months and parse-time-weekdays
>> (to use German names to insert dates in org-mode).  Since I upgraded to
>> Emacs 24 (GNU Emacs 24.0.93.1), this results in an error when starting
>> up gnus.  The error message runs:
>
> What values of `parse-time-months' and `parse-time-weekdays' do you use?
>
>
> Michael



Michael Heerdegen

unread,
Mar 18, 2012, 8:35:04 PM3/18/12
to r.t...@uni-jena.de, info-gnu...@gnu.org
Rainer Thiel <r.t...@uni-jena.de> writes:

> Am 18. März 2012 21:18 schrieb Michael Heerdegen
> <michael_...@web.de>:
> > What values of `parse-time-months' and `parse-time-weekdays' do you
> > use?
>
> This is the configuration I am using:
>
> (defvar parse-time-months '(("jan" . 1) ("feb" . 2) ("mär" . 3)
> ("apr" . 4) ("mai" . 5) ("jun" . 6)
> ("jul" . 7) ("aug" . 8) ("sep" . 9)
> ("okt" . 10) ("nov" . 11) ("dez" . 12)
> ("Januar" . 1) ("Februar" . 2)
> ("März" . 3) ("April" . 4) ("Juni" . 6)
> ("Juli" . 7) ("August" . 8)
> ("September" . 9) ("Oktober" . 10)
> ("November" . 11) ("Dezember" . 12)))
> (defvar parse-time-weekdays '(("so" . 0) ("mo" . 1) ("di" . 2)
> ("mi" . 3) ("do" . 4) ("fr" . 5)
> ("sa" . 6) ("Sonntag" . 0) ("Montag" . 1)
> ("Dienstag" . 2) ("Mittwoch" . 3)
> ("Donnerstag" . 4) ("Freitag" . 5)
> ("Sonnabend" . 6)))

I think it is a bad idea to overwrite the default values.
"parse-time.el" seems to be a widely used library, it's not part of
org-mode. With your settings, gnus can't parse dates in message headers
which are in the English format.

Can you please replace your setting with that and try if it works for
you?


(eval-after-load "parse-time"
'(progn
(dolist (entry '(("jan" . 1) ("feb" . 2) ("mär" . 3)
("apr" . 4) ("mai" . 5) ("jun" . 6)
("jul" . 7) ("aug" . 8) ("sep" . 9)
("okt" . 10) ("nov" . 11) ("dez" . 12)
("Januar" . 1) ("Februar" . 2)
("März" . 3) ("April" . 4) ("Juni" . 6)
("Juli" . 7) ("August" . 8)
("September" . 9) ("Oktober" . 10)
("November" . 11) ("Dezember" . 12)))
(add-to-list 'parse-time-months entry))

(dolist (entry '(("so" . 0) ("mo" . 1) ("di" . 2)
("mi" . 3) ("do" . 4) ("fr" . 5)
("sa" . 6) ("Sonntag" . 0) ("Montag" . 1)
("Dienstag" . 2) ("Mittwoch" . 3)
("Donnerstag" . 4) ("Freitag" . 5)
("Sonnabend" . 6)))
(add-to-list 'parse-time-weekdays entry))))


It adds your entries to the variable values instead of overwriting
them.


Michael

Rainer Thiel

unread,
Mar 19, 2012, 5:51:48 AM3/19/12
to Michael Heerdegen, info-gnu...@gnu.org
Am 19. März 2012 01:35 schrieb Michael Heerdegen <michael_...@web.de>:
> Can you please replace your setting with that and try if it works for
> you?
>
>
> (eval-after-load "parse-time"
>  '(progn
>    (dolist (entry '(("jan" . 1) ("feb" . 2) ("mär" . 3)
>                     ("apr" . 4) ("mai" . 5) ("jun" . 6)
>                     ("jul" . 7) ("aug" . 8) ("sep" . 9)
>                     ("okt" . 10) ("nov" . 11) ("dez" . 12)
>                     ("Januar" . 1) ("Februar" . 2)
>                     ("März" . 3) ("April" . 4) ("Juni" . 6)
>                     ("Juli" . 7) ("August" . 8)
>                     ("September" . 9) ("Oktober" . 10)
>                     ("November" . 11) ("Dezember" . 12)))
>      (add-to-list 'parse-time-months entry))
>
>    (dolist (entry '(("so" . 0) ("mo" . 1) ("di" . 2)
>                     ("mi" . 3) ("do" . 4) ("fr" . 5)
>                     ("sa" . 6) ("Sonntag" . 0) ("Montag" . 1)
>                     ("Dienstag" . 2) ("Mittwoch" . 3)
>                     ("Donnerstag" . 4) ("Freitag" . 5)
>                     ("Sonnabend" . 6)))
>      (add-to-list 'parse-time-weekdays entry))))
>
>
> It adds your entries to the variable values instead of overwriting
> them.

Thank you very much, Michael, this seems to work perfectly. It also
means I can use either English or German names/abbreviations which is
an advantage.

Many thanks again

Rainer

Michael Heerdegen

unread,
Mar 21, 2012, 7:58:26 PM3/21/12
to info-gnu...@gnu.org
Important addition:

Names starting with a capital letter are not ok - they don't work when
entering dates in the minibuffer (e.g. for C-c .) with org.

Something like this works perfectly:

(eval-after-load "parse-time"
'(progn
(dolist (entry '(("jan" . 1) ("feb" . 2) ("mär" . 3)
("apr" . 4) ("mai" . 5) ("jun" . 6)
("jul" . 7) ("aug" . 8) ("sep" . 9)
("okt" . 10) ("nov" . 11) ("dez" . 12)
("januar" . 1) ("februar" . 2)
("märz" . 3) ("april" . 4) ("juni" . 6)
("juli" . 7) ("august" . 8)
("september" . 9) ("oktober" . 10)
("november" . 11) ("dezember" . 12)))
(add-to-list 'parse-time-months entry))

(dolist (entry '(("so" . 0) ("mo" . 1) ("di" . 2)
("mi" . 3) ("do" . 4) ("fr" . 5)
("sa" . 6) ("sonntag" . 0) ("montag" . 1)
("dienstag" . 2) ("mittwoch" . 3)
("donnerstag" . 4) ("freitag" . 5)
("sonnabend" . 6) ("samstag" . 6)))
(add-to-list 'parse-time-weekdays entry))))

even if you enter a weekday starting with a capital letter.

Reply all
Reply to author
Forward
0 new messages