[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
master 3b1fd42732f: * lisp/loadup.el: Check advice after `rmc.el`; turn
From: |
Stefan Monnier |
Subject: |
master 3b1fd42732f: * lisp/loadup.el: Check advice after `rmc.el`; turn error into warning |
Date: |
Thu, 7 Dec 2023 13:14:35 -0500 (EST) |
branch: master
commit 3b1fd42732f7ca5b2db6ad6e75af1c037e1c54e4
Author: Stefan Monnier <monnier@iro.umontreal.ca>
Commit: Stefan Monnier <monnier@iro.umontreal.ca>
* lisp/loadup.el: Check advice after `rmc.el`; turn error into warning
---
lisp/loadup.el | 25 ++++++++++++-------------
1 file changed, 12 insertions(+), 13 deletions(-)
diff --git a/lisp/loadup.el b/lisp/loadup.el
index ef4203917d4..03ed2186392 100644
--- a/lisp/loadup.el
+++ b/lisp/loadup.el
@@ -391,19 +391,6 @@
;; from the repository. It is generated just after temacs is built.
(load "leim/leim-list.el" t)
-(unless (featurep 'ls-lisp)
- ;; Actively disallow advised functions during preload since:
- ;; - advices in Emacs's core are generally considered bad style;
- ;; - `Snarf-documentation' looses docstrings of primitives advised
- ;; during preload (bug#66032#20).
- ;;
- ;; Don't verify this under MS-Windows and Android, both systems that
- ;; load ls-lisp, which advises insert-directory.
- (mapatoms
- (lambda (f)
- (and (advice--p (symbol-function f))
- (error "Advice installed on preloaded function %s" f)))))
-
;; If you want additional libraries to be preloaded and their
;; doc strings kept in the DOC file rather than in core,
;; you may load them with a "site-load.el" file.
@@ -422,6 +409,18 @@ lost after dumping")))
;; Used by `kill-buffer', for instance.
(load "emacs-lisp/rmc")
+;; Actively check for advised functions during preload since:
+;; - advices in Emacs's core are generally considered bad style;
+;; - `Snarf-documentation' looses docstrings of primitives advised
+;; during preload (bug#66032#20).
+(mapatoms
+ (lambda (f)
+ (and (advice--p (symbol-function f))
+ ;; Don't make it an error because it's not serious enough and
+ ;; it can be annoying during development. Also there are still
+ ;; circumstances where we use advice on preloaded functions.
+ (message "Warning: Advice installed on preloaded function %S" f))))
+
;; Make sure default-directory is unibyte when dumping. This is
;; because we cannot decode and encode it correctly (since the locale
;; environment is not, and should not be, set up). default-directory
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- master 3b1fd42732f: * lisp/loadup.el: Check advice after `rmc.el`; turn error into warning,
Stefan Monnier <=