emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] master 041e909: Obsolete calendar-load-hook in favor of ev


From: Glenn Morris
Subject: [Emacs-diffs] master 041e909: Obsolete calendar-load-hook in favor of eval-after-load
Date: Sun, 4 Dec 2016 03:22:56 +0000 (UTC)

branch: master
commit 041e90962b1309ff013c85ee9b537800a332a94c
Author: Glenn Morris <address@hidden>
Commit: Glenn Morris <address@hidden>

    Obsolete calendar-load-hook in favor of eval-after-load
    
    * lisp/calendar/calendar.el (calendar-load-hook): Make obsolete.
    (calendar): Doc fix - no longer mention calendar-load-hook.
    * doc/emacs/cal-xtra.texi (Calendar Customizing):
    No longer mention calendar-load-hook.
    * doc/lispintro/emacs-lisp-intro.texi (X11 Colors):
    Replace calendar-load-hook in example with with-eval-after-load.
---
 doc/emacs/cal-xtra.texi             |    5 -----
 doc/lispintro/emacs-lisp-intro.texi |    9 ++++-----
 lisp/calendar/calendar.el           |    3 ++-
 3 files changed, 6 insertions(+), 11 deletions(-)

diff --git a/doc/emacs/cal-xtra.texi b/doc/emacs/cal-xtra.texi
index 2dff8c9..842c079 100644
--- a/doc/emacs/cal-xtra.texi
+++ b/doc/emacs/cal-xtra.texi
@@ -62,11 +62,6 @@ uses @code{calendar-today-marker} to mark today's date.  By 
default,
 the calendar uses faces named @code{holiday}, @code{diary}, and
 @code{calendar-today} for these purposes.
 
address@hidden calendar-load-hook
-  The variable @code{calendar-load-hook} is a normal hook run when the
-calendar package is first loaded (before actually starting to display
-the calendar).
-
 @vindex calendar-initial-window-hook
   Starting the calendar runs the normal hook
 @code{calendar-initial-window-hook}.  Recomputation of the calendar
diff --git a/doc/lispintro/emacs-lisp-intro.texi 
b/doc/lispintro/emacs-lisp-intro.texi
index 958dba1..0a6b775 100644
--- a/doc/lispintro/emacs-lisp-intro.texi
+++ b/doc/lispintro/emacs-lisp-intro.texi
@@ -17584,11 +17584,10 @@ file that set values:
 
 @group
 ;; Set calendar highlighting colors
-(add-hook 'calendar-load-hook
-      (lambda ()
-        (set-face-foreground 'diary-face   "skyblue")
-        (set-face-background 'holiday-face "slate blue")
-        (set-face-foreground 'holiday-face "white")))
+(with-eval-after-load 'calendar
+  (set-face-foreground 'diary   "skyblue")
+  (set-face-background 'holiday "slate blue")
+  (set-face-foreground 'holiday "white"))
 @end group
 @end smallexample
 
diff --git a/lisp/calendar/calendar.el b/lisp/calendar/calendar.el
index 7a2b3fe..5cea46b 100644
--- a/lisp/calendar/calendar.el
+++ b/lisp/calendar/calendar.el
@@ -330,6 +330,8 @@ The marking symbol is specified by the variable 
`calendar-holiday-marker'."
 This is the place to add key bindings to `calendar-mode-map'."
   :type 'hook
   :group 'calendar-hooks)
+(make-obsolete-variable 'calendar-load-hook
+                        "use `with-eval-after-load' instead." "26.1")
 
 (defcustom calendar-initial-window-hook nil
   "List of functions to be called when the calendar window is created.
@@ -1257,7 +1259,6 @@ diary entries can also be marked on the calendar (see
 
 Runs the following hooks:
 
-`calendar-load-hook' - after loading calendar.el
 `calendar-today-visible-hook', `calendar-today-invisible-hook' - after
    generating a calendar, if today's date is visible or not, respectively
 `calendar-initial-window-hook' - after first creating a calendar



reply via email to

[Prev in Thread] Current Thread [Next in Thread]