From 19a3b499f84b70019f0316c85c19a6a808516d80 Mon Sep 17 00:00:00 2001 From: Po Lu Date: Tue, 5 Dec 2023 18:37:11 +0800 Subject: [PATCH] ; * lisp/loadup.el: Don't prohibit advice when ls-lisp is loaded. --- lisp/loadup.el | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/lisp/loadup.el b/lisp/loadup.el index 3b58d5fb9b7..d447523dc42 100644 --- a/lisp/loadup.el +++ b/lisp/loadup.el @@ -393,14 +393,18 @@ ;; from the repository. It is generated just after temacs is built. (load "leim/leim-list.el" t) -;; 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). -(mapatoms - (lambda (f) - (and (advice--p (symbol-function f)) - (error "Preload advice on %s" f)))) +(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, -- 2.39.2