emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[O] calendar day face incorrect when Monday first day?


From: David Belohrad
Subject: [O] calendar day face incorrect when Monday first day?
Date: Mon, 17 Mar 2014 09:58:40 +0100
User-agent: Notmuch/0.17+54~g9ac863c (http://notmuchmail.org) Emacs/24.3.50.1 (x86_64-unknown-linux-gnu)

Dear All,
this might be out for this group, but maybe there will be some help, as
calendar is used extensively in org mode.

In Czech Rep, the week starts always by monday, so I do

(setq calendar-week-start-day 1)

This perfectly sets the monday in the calendar view (so M-x calendar) as
first day of the week. Trouble is, that in the header it still uses face
'as if it was a weekend day'. So I've been browsing through the code to
see how to repair it, and to my surprise I did not find any way how to
do it. So I dug into the code more and I've found this piece of code in
calendar.el (emacs 24git):

(dotimes (i 7)
     (insert
      (truncate-string-to-width
       (propertize (calendar-day-name (mod (+ calendar-week-start-day i) 7)
                                      'header t)
                   'font-lock-face (if (memq i '(0 6))
                                       'calendar-weekend-header
                                     'calendar-weekday-header))
       calendar-day-header-width nil ?\s)
      (make-string (- calendar-column-width calendar-day-header-width)
     ?\s)))


hidden in calendar-generate-month. Now it seems, that font-lock-face is
assigned to weekend header *only* for first and last day of week, which
for Czech Rep. is not really correct, as correct should be (imho)
saturday/sunday, which would mean, that the (memq... should be:

(memq i '(5 6))

Is the hard-wired face for weekend days intentional? I would propose to
declare those days in an external variable so user could actually choose
what he considers as weekend...


any comments on this? eventually proposals to who to send this email to
propose this functionality?

NB: I've checked with (memq i '(5 6)) and it works correctly.


Cheers

.d.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]