emacs-elpa-diffs
[Top][All Lists]
Advanced

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

[elpa] externals/compat 1d25236892 4/7: Use with-eval-after-load (24.4)


From: ELPA Syncer
Subject: [elpa] externals/compat 1d25236892 4/7: Use with-eval-after-load (24.4)
Date: Wed, 4 Jan 2023 13:57:28 -0500 (EST)

branch: externals/compat
commit 1d25236892ac997cfa6d42e0dfae768b81474112
Author: Daniel Mendler <mail@daniel-mendler.de>
Commit: Daniel Mendler <mail@daniel-mendler.de>

    Use with-eval-after-load (24.4)
---
 compat-24.el   | 10 ----------
 compat-macs.el |  5 +++--
 compat.texi    | 35 -----------------------------------
 3 files changed, 3 insertions(+), 47 deletions(-)

diff --git a/compat-24.el b/compat-24.el
index 206240cc10..6c15c22249 100644
--- a/compat-24.el
+++ b/compat-24.el
@@ -226,16 +226,6 @@ return value from A's length."
 
 ;;;; Defined in subr.el
 
-(compat-defmacro with-eval-after-load (file &rest body)UNTESTED>
-  "Execute BODY after FILE is loaded.
-FILE is normally a feature name, but it can also be a file name,
-in case that file does not provide any feature.  See `eval-after-load'
-for more details about the different forms of FILE and their semantics."
-  (declare (indent 1) (debug (form def-body)))
-  ;; See https://nullprogram.com/blog/2018/02/22/ on how
-  ;; `eval-after-load' is used to preserve compatibility with 24.3.
-  `(eval-after-load ,file `(funcall ',,`(lambda () ,@body))))
-
 (compat-defun special-form-p (object) ;; <OK>
   "Non-nil if and only if OBJECT is a special form."
   (if (and (symbolp object) (fboundp object))
diff --git a/compat-macs.el b/compat-macs.el
index 1bd9c1cb09..5a034aff35 100644
--- a/compat-macs.el
+++ b/compat-macs.el
@@ -30,11 +30,12 @@
   nil)
 
 (defun compat--with-feature (feature &rest body)
-  "Protect BODY with `eval-after-load' if FEATURE is non-nil."
+  "Protect BODY with `with-eval-after-load' if FEATURE is non-nil."
   (declare (indent 1))
   (if feature
       ;; See https://nullprogram.com/blog/2018/02/22/:
-      `(eval-after-load ',feature `(funcall ',(lambda () ,@body)))
+      `(with-eval-after-load ',feature
+         ,@body)
     (macroexp-progn body)))
 
 (defun compat--generate (name def-fn install-fn check-fn attr)
diff --git a/compat.texi b/compat.texi
index 549f750b6a..baa38af716 100644
--- a/compat.texi
+++ b/compat.texi
@@ -219,41 +219,6 @@ manage to provide for each Emacs version.
 The following functions and macros implemented in 24.4, and are provided
 by Compat:
 
-@c copied from lispref/loading.texi
-@defmac with-eval-after-load library body@dots{}
-This macro arranges to evaluate @var{body} at the end of loading the
-file @var{library}, each time @var{library} is loaded.  If @var{library}
-is already loaded, it evaluates @var{body} right away.
-
-You don't need to give a directory or extension in the file name
-@var{library}.  Normally, you just give a bare file name, like this:
-
-@example
-(with-eval-after-load "js" (keymap-set js-mode-map "C-c C-c" 'js-eval))
-@end example
-
-To restrict which files can trigger the evaluation, include a directory
-or an extension or both in @var{library}.  Only a file whose absolute
-true name (i.e., the name with all symbolic links chased out) matches
-all the given name components will match.  In the following example,
-@file{my_inst.elc} or @file{my_inst.elc.gz} in some directory
-@code{..../foo/bar} will trigger the evaluation, but not
-@file{my_inst.el}:
-
-@example
-(with-eval-after-load "foo/bar/my_inst.elc" @dots{})
-@end example
-
-@var{library} can also be a feature (i.e., a symbol), in which case
-@var{body} is evaluated at the end of any file where @code{(provide
-@var{library})} is called.
-
-An error in @var{body} does not undo the load, but does prevent
-execution of the rest of @var{body}.
-
-@xref{Hooks for Loading,,,elisp}.
-@end defmac
-
 @c copied from lispref/eval.texi
 @defun special-form-p object
 This predicate tests whether its argument is a special form, and returns



reply via email to

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