From be26b04ff09e0608006afff7be1063216042c22c Mon Sep 17 00:00:00 2001 From: Andreas Gerler Date: Wed, 7 Sep 2022 18:54:59 +0200 Subject: [PATCH] adding german holidays Signed-off-by: Andreas Gerler --- bba.org | 13 +- .../german-holidays-autoloads.el | 23 +++ .../german-holidays-pkg.el | 2 + .../german-holidays.el | 157 ++++++++++++++++++ 4 files changed, 193 insertions(+), 2 deletions(-) create mode 100644 elpa/german-holidays-20181213.644/german-holidays-autoloads.el create mode 100644 elpa/german-holidays-20181213.644/german-holidays-pkg.el create mode 100644 elpa/german-holidays-20181213.644/german-holidays.el diff --git a/bba.org b/bba.org index f5ab9814..bb34e4e5 100644 --- a/bba.org +++ b/bba.org @@ -1513,9 +1513,9 @@ Your notes are more useful if you can easily search them! ** search last miliseconds and convert to hours at point [2022-04-21 Thu 13:17] -#+begin_src emacs-lisp :eval never +#+begin_src emacs-lisp (defun bba-ms-to-h () - "search for last miliseconds and conver tto hours at point. + "search for last miliseconds and convert to hours at point. Useful for Vertica timing output." (interactive) (save-mark-and-excursion @@ -1572,6 +1572,15 @@ Your notes are more useful if you can easily search them! #+END_SRC +** holidays +[2022-09-06 Tue 18:32] + +#+begin_src emacs-lisp + (add-to-list 'load-path "~/.emacs.d/elpa/german-holidays-20181213.644") + (require 'german-holidays) + (setq holiday-local-holidays holiday-german-HH-holidays) +#+end_src + ** open current directory in finder [2017-01-09 Mon 15:18] diff --git a/elpa/german-holidays-20181213.644/german-holidays-autoloads.el b/elpa/german-holidays-20181213.644/german-holidays-autoloads.el new file mode 100644 index 00000000..a5ca9ba3 --- /dev/null +++ b/elpa/german-holidays-20181213.644/german-holidays-autoloads.el @@ -0,0 +1,23 @@ +;;; german-holidays-autoloads.el --- automatically extracted autoloads -*- lexical-binding: t -*- +;; +;;; Code: + +(add-to-list 'load-path (directory-file-name + (or (file-name-directory #$) (car load-path)))) + + +;;;### (autoloads nil "german-holidays" "german-holidays.el" (0 0 +;;;;;; 0 0)) +;;; Generated autoloads from german-holidays.el + +(register-definition-prefixes "german-holidays" '("holiday-german-")) + +;;;*** + +;; Local Variables: +;; version-control: never +;; no-byte-compile: t +;; no-update-autoloads: t +;; coding: utf-8 +;; End: +;;; german-holidays-autoloads.el ends here diff --git a/elpa/german-holidays-20181213.644/german-holidays-pkg.el b/elpa/german-holidays-20181213.644/german-holidays-pkg.el new file mode 100644 index 00000000..2720840e --- /dev/null +++ b/elpa/german-holidays-20181213.644/german-holidays-pkg.el @@ -0,0 +1,2 @@ +;;; Generated package description from german-holidays.el -*- no-byte-compile: t -*- +(define-package "german-holidays" "20181213.644" "German holidays for Emacs calendar" 'nil :commit "a8462dffccaf2b665f2032e646b5370e993a386a" :authors '(("Sebastian Christ" . "rudolfo.christ@gmail.com")) :maintainer '("Sebastian Christ" . "rudolfo.christ@gmail.com") :url "https://github.com/rudolfochrist/german-holidays") diff --git a/elpa/german-holidays-20181213.644/german-holidays.el b/elpa/german-holidays-20181213.644/german-holidays.el new file mode 100644 index 00000000..f25b693b --- /dev/null +++ b/elpa/german-holidays-20181213.644/german-holidays.el @@ -0,0 +1,157 @@ +;;; german-holidays.el --- German holidays for Emacs calendar + +;; Author: Sebastian Christ +;; URL: https://github.com/rudolfochrist/german-holidays +;; Package-Version: 20181213.644 +;; Package-Commit: a8462dffccaf2b665f2032e646b5370e993a386a +;; Version: 0.2.1 + +;; This file is not part of GNU Emacs + +;; This file is free software; you can redistribute it and/or modify +;; it under the terms of the GNU General Public License as published by +;; the Free Software Foundation; either version 3, or (at your option) +;; any later version. + +;; This program is distributed in the hope that it will be useful, +;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;; GNU General Public License for more details. + +;; For a full copy of the GNU General Public License +;; see . + +;;; Commentary: +;; +;; Installation: +;; +;; To use `german-holidays' exclusively +;; +;; (setq calendar-holidays holiday-german-holidays) +;; +;; To use 'german-holidays' additionally +;; +;; (setq calendar-holidays (append calendar-holidays holiday-german-holidays)) +;; +;; If you'd like to show holidays for Rhineland Palatinate only, you can use +;; +;; (setq calendar-holidays holiday-german-RP-holidays) +;; +;; This works for for all states: +;; +;; `holiday-german-BW-holidays' +;; `holiday-german-HE-holidays' +;; `holiday-german-HH-holidays' +;; etc. +;; +;;; Credits +;; +;; inspired by https://github.com/abo-abo/netherlands-holidays + +;;; Code: +(eval-when-compile + (require 'calendar) + (require 'holidays)) + +(defvar holiday-german--national-holidays + '((holiday-fixed 1 1 "Neujahr") + (holiday-easter-etc -2 "Karfreitag") + (holiday-easter-etc 1 "Ostermontag") + (holiday-fixed 5 1 "Tag der Arbeit") + (holiday-easter-etc 39 "Christi Himmelfahrt") + (holiday-easter-etc 50 "Pfingstmontag") + (holiday-fixed 10 3 "Tag der Deutschen Einheit") + (holiday-fixed 12 25 "1. Weihnachtstag") + (holiday-fixed 12 26 "2. Weihnachtstag")) + "Holidays valid in all German states, called 'bundeseinheitlich'.") + +(defvar holiday-german--holiday-alist + '((epiphany (holiday-fixed 1 6 "Heilige Drei Könige")) + (easter (holiday-easter-etc 0 "Ostersonntag")) + (whit-sunday (holiday-easter-etc 49 "Pfingstsonntag")) + (corpus-christi (holiday-easter-etc 60 "Fronleichnam")) + (assumption-day (holiday-fixed 8 15 "Mariä Himmelfahrt")) + (reformation-day (holiday-fixed 10 31 "Reformationstag")) + (all-saints-day (holiday-fixed 11 1 "Allerheiligen")) + (penance-day (holiday-float 11 3 -1 "Buß- und Bettag" 22))) + "Alist of German holidays with state-specific validity.") + +(defun holiday-german--state-holidays (includes) + "Constructs a state-specific list of holidays. + +INCLUDES are holidays added to the `holiday-german--national-holidays'." + (append holiday-german--national-holidays + (mapcar (lambda (key) + (cadr (assoc key holiday-german--holiday-alist))) + includes))) + +(defvar holiday-german-BW-holidays + (holiday-german--state-holidays '(epiphany corpus-christi all-saints-day)) + "Holidays for Baden Wuerttemberg.") + +(defvar holiday-german-BY-holidays + (holiday-german--state-holidays + '(epiphany corpus-christi assumption-day all-saints-day)) + "Holidays for Bavaria.") + +(defvar holiday-german-BE-holidays holiday-german--national-holidays + "Holidays for Berlin.") + +(defvar holiday-german-BB-holidays + (holiday-german--state-holidays '(easter whit-sunday reformation-day)) + "Holidays for Brandenburg.") + +(defvar holiday-german-HB-holidays holiday-german--national-holidays + "Holidays for Bremen.") + +(defvar holiday-german-HH-holidays holiday-german--national-holidays + "Holidays for Hamburg.") + +(defvar holiday-german-HE-holidays + (holiday-german--state-holidays '(corpus-christi)) + "Holidays for Hesse.") + +(defvar holiday-german-MV-holidays + (holiday-german--state-holidays '(reformation-day)) + "Holidays for Mecklenburg West Pomerania.") + +(defvar holiday-german-NI-holidays + (holiday-german--state-holidays '(reformation-day)) + "Holidays for Lower Saxony.") + +(defvar holiday-german-NW-holidays + (holiday-german--state-holidays '(corpus-christi all-saints-day)) + "Holidays for Northrhine Westphalia.") + +(defvar holiday-german-RP-holidays + (holiday-german--state-holidays '(corpus-christi all-saints-day)) + "Holidays for Rhineland Palatinate.") + +(defvar holiday-german-SL-holidays + (holiday-german--state-holidays + '(corpus-christi assumption-day all-saints-day)) + "Holidays for Saarland.") + +(defvar holiday-german-SN-holidays + (holiday-german--state-holidays '(reformation-day penance-day)) + "Holidays for Saxony.") + +(defvar holiday-german-ST-holidays + (holiday-german--state-holidays '(epiphany reformation-day)) + "Holidays for Saxony Anhalt.") + +(defvar holiday-german-SH-holidays holiday-german--national-holidays + "Holidays for Schleswig Holstein.") + +(defvar holiday-german-TH-holidays + (holiday-german--state-holidays '(reformation-day)) + "Holidays for Thuringia.") + +(defvar holiday-german-holidays + (holiday-german--state-holidays + (mapcar #'car holiday-german--holiday-alist)) + "All legal holidays in Germany.") + +(provide 'german-holidays) + +;;; german-holidays.el ends here -- 2.47.3