Hello everyone,

The org manual recommends to configure the variables parse-time-months
and parse-time-weekdays in order to use another language than English in
the time/date prompt. However, this can create conflict with other
functionality. For instance, it conflicts with the elfeed news reader
package.

Maybe, the org manual could also recommand to limit the effect of the
configuration of the parse-time variables by advising certain org
functions for the date prompt? (Looking at the code it seems that is
enough to advise the function org-read-date. Currently, I have the code
attached to this mail in my init file which seems to do the trick.)

Or, there could exist org specific variables org-parse-time-months and
org-parse-time-weekdays.

What do you all think?

All the best,
Gautier.
(require 'parse-time)

(defun parse-time-fr (f &rest args)
  "Call the function F with arguments ARGS with `parse-time-months' and
`parse-time-weekdays' set to unaccented French."
  (let ((parse-time-months '(("jan" . 1)
                             ("fev" . 2)
                             ("mar" . 3)
                             ("avr" . 4)
                             ("mai" . 5)
                             ("jun" . 6)
                             ("jul" . 7)
                             ("aou" . 8)
                             ("sep" . 9)
                             ("oct" . 10)
                             ("nov" . 11)
                             ("dec" . 12)
                             ("janvier" . 1)
                             ("fevrier" . 2)
                             ("mars" . 3)
                             ("avril" . 4)
                             ("mai" . 5)
                             ("juin" . 6)
                             ("juillet" . 7)
                             ("aout" . 8)
                             ("septembre" . 9)
                             ("octobre" . 10)
                             ("novembre" . 11)
                             ("decembre" . 12)))
        (parse-time-weekdays '(("dim" . 0)
                               ("lun" . 1)
                               ("mar" . 2)
                               ("mer" . 3)
                               ("jeu" . 4)
                               ("ven" . 5)
                               ("sam" . 6)
                               ("dimanche" . 0)
                               ("lundi" . 1)
                               ("mardi" . 2)
                               ("mercredi" . 3)
                               ("jeudi" . 4)
                               ("vendredi" . 5)
                               ("samedi" . 6))))
    (apply f args)))

(advice-add 'org-read-date :around #'parse-time-fr)

Reply via email to