From: Lars Ingebrigtsen Date: Wed, 27 Apr 2022 12:57:57 +0000 (+0200) Subject: Separate out the holiday lists into its own function X-Git-Tag: emacs-29.0.90~1931^2~272 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=7933775a1b98bd33daa438f13a843eac3326af56;p=emacs.git Separate out the holiday lists into its own function * lisp/calendar/holidays.el (holiday-lists): Separated out into its own function so that it can be altered (bug#55140). (list-holidays): Use it. --- diff --git a/lisp/calendar/holidays.el b/lisp/calendar/holidays.el index 2afa667a56c..ca7166c371a 100644 --- a/lisp/calendar/holidays.el +++ b/lisp/calendar/holidays.el @@ -400,6 +400,36 @@ This function is suitable for execution in an init file." (displayed-year (calendar-extract-year date))) (calendar-list-holidays)))) +(defun holiday-lists () + "Return a list of all holiday lists. +This is used by `list-holidays', and you can customize the return +value by using `add-function'." + (delq + nil + (list + (cons "All" calendar-holidays) + (cons "Equinoxes/Solstices" + (list (list 'solar-equinoxes-solstices))) + (if holiday-general-holidays + (cons "General" holiday-general-holidays)) + (if holiday-local-holidays + (cons "Local" holiday-local-holidays)) + (if holiday-other-holidays + (cons "Other" holiday-other-holidays)) + (if holiday-christian-holidays + (cons "Christian" holiday-christian-holidays)) + (if holiday-hebrew-holidays + (cons "Hebrew" holiday-hebrew-holidays)) + (if holiday-islamic-holidays + (cons "Islamic" holiday-islamic-holidays)) + (if holiday-bahai-holidays + (cons "Bahá’í" holiday-bahai-holidays)) + (if holiday-oriental-holidays + (cons "Oriental" holiday-oriental-holidays)) + (if holiday-solar-holidays + (cons "Solar" holiday-solar-holidays)) + (cons "Ask" nil)))) + ;; rms: "Emacs commands to display a list of something generally start ;; with `list-'. Please make `list-holidays' the principal name." ;;;###autoload @@ -421,7 +451,11 @@ documentation of `calendar-holidays' for a list of the variables that control the choices, as well as a description of the format of a holiday list. -The optional LABEL is used to label the buffer created." +The optional LABEL is used to label the buffer created. + +The list of holiday lists is computed by the `holiday-lists', and +you can alter the results by redefining that function, or use +`add-function' to all values." (interactive (let* ((start-year (calendar-read-sexp "Starting year of holidays (>0)" @@ -433,30 +467,7 @@ The optional LABEL is used to label the buffer created." start-year start-year)) (completion-ignore-case t) - (lists - (list - (cons "All" calendar-holidays) - (cons "Equinoxes/Solstices" - (list (list 'solar-equinoxes-solstices))) - (if holiday-general-holidays - (cons "General" holiday-general-holidays)) - (if holiday-local-holidays - (cons "Local" holiday-local-holidays)) - (if holiday-other-holidays - (cons "Other" holiday-other-holidays)) - (if holiday-christian-holidays - (cons "Christian" holiday-christian-holidays)) - (if holiday-hebrew-holidays - (cons "Hebrew" holiday-hebrew-holidays)) - (if holiday-islamic-holidays - (cons "Islamic" holiday-islamic-holidays)) - (if holiday-bahai-holidays - (cons "Bahá’í" holiday-bahai-holidays)) - (if holiday-oriental-holidays - (cons "Oriental" holiday-oriental-holidays)) - (if holiday-solar-holidays - (cons "Solar" holiday-solar-holidays)) - (cons "Ask" nil))) + (lists (holiday-lists)) (choice (capitalize (completing-read "List (TAB for choices): " lists nil t))) (which (if (string-equal choice "Ask") diff --git a/lisp/ldefs-boot.el b/lisp/ldefs-boot.el index 93e8e14d1f0..41a2b920b5f 100644 --- a/lisp/ldefs-boot.el +++ b/lisp/ldefs-boot.el @@ -16110,19 +16110,22 @@ If this produces no string either, return nil." nil nil) (autoload 'display-local-help "help-at-pt" "\ Display local help in the echo area. -This displays a short help message, namely the string produced by -the `kbd-help' property at point. If `kbd-help' does not produce -a string, but the `help-echo' property does, then that string is -printed instead. +This command, by default, displays a short help message, namely +the string produced by the `kbd-help' property at point. If +`kbd-help' does not produce a string, but the `help-echo' +property does, then that string is printed instead. The string is passed through `substitute-command-keys' before it is displayed. -A numeric argument ARG prevents display of a message in case -there is no help. While ARG can be used interactively, it is -mainly meant for use from Lisp. +If INHIBIT-WARNING is non-nil, this prevents display of a message +in case there is no help. -\(fn &optional ARG)" t nil) +If DESCRIBE-BUTTON in non-nil (interactively, the prefix arg), and +there's a button/widget at point, pop a buffer describing that +button/widget instead. + +\(fn &optional INHIBIT-WARNING DESCRIBE-BUTTON)" t nil) (autoload 'help-at-pt-cancel-timer "help-at-pt" "\ Cancel any timer set by `help-at-pt-set-timer'. @@ -17359,6 +17362,10 @@ of a holiday list. The optional LABEL is used to label the buffer created. +The list of holiday lists is computed by the `holiday-lists', and +you can alter the results by redefining that function, or use +`add-function' to all values. + \(fn Y1 &optional Y2 L LABEL)" t nil) (defalias 'holiday-list 'list-holidays) @@ -32771,6 +32778,14 @@ Major-mode for writing SRecode macros. (register-definition-prefixes "srecode/table" '("object-sort-list" "srecode-")) +;;;*** + +;;;### (autoloads nil "string-edit" "textmodes/string-edit.el" (0 +;;;;;; 0 0 0)) +;;; Generated autoloads from textmodes/string-edit.el + +(register-definition-prefixes "string-edit" '("read-string-from-buffer" "string-edit-")) + ;;;*** ;;;### (autoloads nil "strokes" "strokes.el" (0 0 0 0))