unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Christopher Dimech <dimech@gmx.com>
To: Jean Louis <bugs@gnu.support>
Cc: Help Gnu Emacs <help-gnu-emacs@gnu.org>
Subject: Re: Emacs Calendar - Removing holidays
Date: Thu, 19 Nov 2020 17:38:20 +0100	[thread overview]
Message-ID: <trinity-f7e0cfe3-ddf0-4052-a46d-a1734f567a0e-1605803900456@3c-app-mailcom-bs05> (raw)
In-Reply-To: <X7aXs1mAudseB1Ak@protected.rcdrun.com>

> Sent: Thursday, November 19, 2020 at 5:05 PM
> 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
>
> 
> 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'.

Sure as long as it works.  I just want markings for work related dates,
without any other dates when using Emacs for a particular project.
 
> 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:38 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
2020-11-19 16:38           ` Christopher Dimech [this message]
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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=trinity-f7e0cfe3-ddf0-4052-a46d-a1734f567a0e-1605803900456@3c-app-mailcom-bs05 \
    --to=dimech@gmx.com \
    --cc=bugs@gnu.support \
    --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.
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).