From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Emanuel Berg Newsgroups: gmane.emacs.help Subject: Re: Calendar: Highlight certain holidays Date: Fri, 05 May 2017 03:39:33 +0200 Message-ID: <87lgqcgjzc.fsf@debian.uxu> References: <87shkk9m0j.fsf@pointsman.de> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1493948431 797 195.159.176.226 (5 May 2017 01:40:31 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Fri, 5 May 2017 01:40:31 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri May 05 03:40:24 2017 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1d6SEI-0008Uh-7q for geh-help-gnu-emacs@m.gmane.org; Fri, 05 May 2017 03:40:22 +0200 Original-Received: from localhost ([::1]:44545 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d6SEN-0005R5-VI for geh-help-gnu-emacs@m.gmane.org; Thu, 04 May 2017 21:40:27 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:43368) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d6SDx-0005Qr-31 for help-gnu-emacs@gnu.org; Thu, 04 May 2017 21:40:02 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1d6SDs-0002kA-Mo for help-gnu-emacs@gnu.org; Thu, 04 May 2017 21:40:01 -0400 Original-Received: from [195.159.176.226] (port=48763 helo=blaine.gmane.org) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1d6SDs-0002jk-Gj for help-gnu-emacs@gnu.org; Thu, 04 May 2017 21:39:56 -0400 Original-Received: from list by blaine.gmane.org with local (Exim 4.84_2) (envelope-from ) id 1d6SDk-0007w8-0H for help-gnu-emacs@gnu.org; Fri, 05 May 2017 03:39:48 +0200 X-Injected-Via-Gmane: http://gmane.org/ Mail-Followup-To: help-gnu-emacs@gnu.org Original-Lines: 61 Original-X-Complaints-To: usenet@blaine.gmane.org Mail-Copies-To: never Cancel-Lock: sha1:jddvua7c5sfki90DkRLxgPEQyFU= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 195.159.176.226 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.org gmane.emacs.help:112958 Archived-At: Rolf Ade 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 -