From 0d383b592c2fd1d9b73ebd611d05d80089c7a3a6 Mon Sep 17 00:00:00 2001 From: Lars Ingebrigtsen Date: Wed, 15 Jun 2022 14:05:07 +0200 Subject: [PATCH] Fix ;;;###autoload scanning from (some) packages * lisp/emacs-lisp/loaddefs-gen.el (loaddefs-generate--parse-file): Fix autoloads scanning from packages. --- lisp/emacs-lisp/loaddefs-gen.el | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lisp/emacs-lisp/loaddefs-gen.el b/lisp/emacs-lisp/loaddefs-gen.el index 95666ddb2a0..86c776e3013 100644 --- a/lisp/emacs-lisp/loaddefs-gen.el +++ b/lisp/emacs-lisp/loaddefs-gen.el @@ -366,7 +366,11 @@ don't include." ;; We always return the package version (even for pre-dumped ;; files). - (when package-data + (if (not package-data) + ;; We have to switch `emacs-lisp-mode' when scanning + ;; loaddefs for packages so that `syntax-ppss' later gives + ;; correct results. + (emacs-lisp-mode) (let ((version (lm-header "version")) package) (when (and version -- 2.39.2