all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: David Belohrad <david@belohrad.ch>
To: org-mode <emacs-orgmode@gnu.org>
Subject: calendar day face incorrect when Monday first day?
Date: Mon, 17 Mar 2014 09:58:40 +0100	[thread overview]
Message-ID: <uaxzjkprykf.fsf@beesknees.cern.ch> (raw)


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	other threads:[~2014-03-17  8:59 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-17  8:58 David Belohrad [this message]
2014-03-17  9:09 ` calendar day face incorrect when Monday first day? Bastien
2014-03-17 10:02   ` David Belohrad

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=uaxzjkprykf.fsf@beesknees.cern.ch \
    --to=david@belohrad.ch \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.