all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Jean Louis <bugs@gnu.support>
To: Christopher Dimech <dimech@gmx.com>
Cc: Help Gnu Emacs <help-gnu-emacs@gnu.org>
Subject: Re: Emacs Calendar - Removing holidays
Date: Thu, 19 Nov 2020 19:05:07 +0300	[thread overview]
Message-ID: <X7aXs1mAudseB1Ak@protected.rcdrun.com> (raw)
In-Reply-To: <trinity-29233436-c986-4993-b3bd-e98140423655-1605800582897@3c-app-mailcom-bs05>


I understand you wish to highlight those days by your choice but not
holidays when you press `x', is it so?

Then maybe you do not need to erase holidays, you could maybe make a
function to mark those days you wish to mark and you can bind it to
any other key or even to `x'.

Holidays are in the list:

(((10 3 2020) "Sukkot") ((10 10 2020) "Shemini Atzeret") ((10 11 2020) "Simchat Torah") ((10 12 2020) "Columbus Day") ((10 20 2020) "Birth of the Báb") ((10 31 2020) "Halloween") ((11 11 2020) "Veteran's Day") ((11 12 2020) "Birth of Bahá’u’lláh") ((11 26 2020) "Thanksgiving") ((12 11 2020) "Hanukkah") ((12 21 2020) "Summer Solstice 1:02pm (EAT)") ((12 25 2020) "Christmas"))

One holiday is in this form:

((10 3 2020) "Sukkot")

So you could construct your list of holidays this way:

'((10 3 2020) "Sukkot")
  (11 29 2020) "Something else"))

And you put it in some function that returns such list or you can
simply construct that list and call it `my-important-dates'

Then copy this function `calendar-mark-holidays' to your file from holidays.el

(defun calendar-mark-holidays (&optional event)
  "Mark notable days in the calendar window.
If EVENT is non-nil, it's an event indicating the buffer position to
use instead of point."
  (interactive (list last-nonmenu-event))
  ;; If called from a menu, with the calendar window not selected.
  (with-current-buffer
      (if event (window-buffer (posn-window (event-start event)))
        (current-buffer))
    (setq calendar-mark-holidays-flag t)
    (message "Marking holidays...")
    (dolist (holiday (calendar-holiday-list))
      (calendar-mark-visible-date (car holiday) calendar-holiday-marker))
    (message "Marking holidays...done")))

Then change it little by:

(defun my-calendar-mark-my-days (&optional event)
  "Mark notable days in the calendar window.
  (interactive)
  ;; If called from a menu, with the calendar window not selected.
  (with-current-buffer
    (setq calendar-mark-holidays-flag t)
    (message "Marking my days...")
    (dolist (holiday (this-function-returns-my-days))
      (calendar-mark-visible-date (car holiday) calendar-holiday-marker))
    (message "Marking my days...done")))

Then you may bind that function to a key in calendar mode map.



  reply	other threads:[~2020-11-19 16:05 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-19 13:56 Emacs Calendar - Removing holidays Christopher Dimech
2020-11-19 14:02 ` Christopher Dimech
2020-11-19 14:09 ` Jean Louis
2020-11-19 15:21   ` Christopher Dimech
2020-11-19 15:32     ` Jean Louis
2020-11-19 15:37       ` Christopher Dimech
2020-11-19 15:43       ` Christopher Dimech
2020-11-19 16:05         ` Jean Louis [this message]
2020-11-19 16:38           ` Christopher Dimech
2020-11-19 16:26         ` Michael Heerdegen
2020-11-19 16:46           ` Christopher Dimech
2020-11-19 17:21           ` Christopher Dimech
2020-11-19 18:58             ` Michael Heerdegen
2020-11-19 19:06               ` Jean Louis
2020-11-19 19:40                 ` Michael Heerdegen
2020-11-19 19:52                   ` Jean Louis
2020-11-19 20:17                     ` Christopher Dimech
2020-11-19 20:50                       ` Michael Heerdegen
2020-11-19 20:59                         ` Christopher Dimech
2020-11-19 21:11                         ` Christopher Dimech
2020-11-21 19:47                           ` Michael Heerdegen
2020-11-21 20:16                             ` Christopher Dimech
2020-11-19 20:24                     ` Michael Heerdegen
2020-11-19 20:36                       ` Christopher Dimech
2020-11-19 19:52                   ` Christopher Dimech
2020-11-19 20:09                     ` Jean Louis

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=X7aXs1mAudseB1Ak@protected.rcdrun.com \
    --to=bugs@gnu.support \
    --cc=dimech@gmx.com \
    --cc=help-gnu-emacs@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.