* Calendar: Highlight certain holidays
@ 2017-05-05 0:37 Rolf Ade
2017-05-05 1:39 ` Emanuel Berg
0 siblings, 1 reply; 2+ messages in thread
From: Rolf Ade @ 2017-05-05 0:37 UTC (permalink / raw)
To: help-gnu-emacs
I use calendar and then its function holidays often enough, that I set
the variable calendar-holidays in my init.el.
It occurs with me, that I would be helpful, if the holiday list would be
colourful. The one added by me to calendar-holidays in another face than
the holidays coming out of the default. And then also different faces
for the holidays, I added (e.g. for distinction between public holidays
and memorial days (say Mothers Day)).
I looked into it, but there is nothing obvious. The user is able to
control, what holidays appear in the buffer, that lists it, but every
entry in this buffer is equal to each other in how it is displayed.
I was in the mood to accept some effort as a proof of concept, that you
can everything with emacs, I would have used a hook in
calendar-in-read-only-buffer, if there would be one.
I'm somewhat disapointed, that I'm not able to come up with a sane
concept, how that could be done. Do I miss something?
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: Calendar: Highlight certain holidays
2017-05-05 0:37 Calendar: Highlight certain holidays Rolf Ade
@ 2017-05-05 1:39 ` Emanuel Berg
0 siblings, 0 replies; 2+ messages in thread
From: Emanuel Berg @ 2017-05-05 1:39 UTC (permalink / raw)
To: help-gnu-emacs
Rolf Ade <rolf@pointsman.de> writes:
> I use calendar and then its function holidays often
> enough, that I set the variable calendar-holidays in
> my init.el.
>
> It occurs with me, that I would be helpful, if the
> holiday list would be colourful. The one added by me
> to calendar-holidays in another face than the holidays
> coming out of the default. And then also different
> faces for the holidays, I added (e.g. for distinction
> between public holidays and memorial days (say Mothers
> Day)).
>
> I looked into it, but there is nothing obvious.
> The user is able to control, what holidays appear in
> the buffer, that lists it, but every entry in this
> buffer is equal to each other in how it is displayed.
Put point at a holiday and use this function to
determine if there is a special face for holidays:
(defun what-face (pos)
(interactive "d")
(let((face (or (get-char-property pos 'face)
(get-char-property pos 'read-cf-name) )))
(message " Face: %s" (or face "(no face!)")) ))
If there isn't, you can add them manually for
whichever mode the calendar goes by, just as I did
here - see how it looks in the screenshot, last. [1]
(font-lock-add-keywords 'emacs-lisp-mode
'(
("(?interactive?)" . font-lock-builtin-face)
("font-lock-builtin-face" . font-lock-builtin-face)
("font-lock-comment-delimiter-face" . font-lock-comment-delimiter-face)
("font-lock-comment-face" . font-lock-comment-face)
("font-lock-constant-face" . font-lock-constant-face)
("font-lock-doc-face" . font-lock-doc-face)
("font-lock-function-name-face" . font-lock-function-name-face)
("font-lock-keyword-face" . font-lock-keyword-face)
("font-lock-negation-char-face" . font-lock-negation-char-face)
("font-lock-preprocessor-face" . font-lock-preprocessor-face)
("font-lock-reference-face" . font-lock-reference-face)
("font-lock-string-face" . font-lock-string-face)
("font-lock-syntactic-face-function" . font-lock-syntactic-face-function)
("font-lock-type-face" . font-lock-type-face)
("font-lock-variable-name-face" . font-lock-variable-name-face)
("font-lock-warning-face" . font-lock-warning-face)
("font-lock-regexp-grouping-construct" . 'font-lock-regexp-grouping-construct)
("font-lock-regexp-grouping-backslash" . 'font-lock-regexp-grouping-backslash)
)
t) ; HOW (append)
[1] http://user.it.uu.se/~embe8573/figures/emacs/emacs-lisp-faces.png
--
underground experts united .... http://user.it.uu.se/~embe8573
Emacs Gnus Blogomatic ......... http://user.it.uu.se/~embe8573/blogomatic
- so far: 26 Blogomatic articles -
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2017-05-05 1:39 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-05-05 0:37 Calendar: Highlight certain holidays Rolf Ade
2017-05-05 1:39 ` Emanuel Berg
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).