From: Po Lu <luangruo@yahoo.com>
Date: Tue, 5 Dec 2023 10:37:11 +0000 (+0800)
Subject: ; * lisp/loadup.el: Don't prohibit advice when ls-lisp is loaded.
X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=19a3b499f84b70019f0316c85c19a6a808516d80;p=emacs.git

; * lisp/loadup.el: Don't prohibit advice when ls-lisp is loaded.
---

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,