]> git.eshelyaron.com Git - emacs.git/commitdiff
Be more lax when picking up prefixes for loaddefs
authorStefan Kangas <stefan@marxist.se>
Thu, 4 Aug 2022 20:58:59 +0000 (22:58 +0200)
committerStefan Kangas <stefan@marxist.se>
Thu, 4 Aug 2022 21:21:03 +0000 (23:21 +0200)
* lisp/emacs-lisp/loaddefs-gen.el
(loaddefs-generate--compute-prefixes): Allow tabs and spaces before
symbol name, so that "(defvar\tfoo-bar nil)" is properly picked up.
Before this change, such a definition would be wrongly picked up as
the symbol "nil".

lisp/emacs-lisp/loaddefs-gen.el

index 52ec5ef6809b542282e6819887da1d1a24840ea3..afba9f8fbc709d1dbf0677667834b0ccf7a71fc7 100644 (file)
@@ -456,7 +456,7 @@ don't include."
   (let ((prefs nil))
     ;; Avoid (defvar <foo>) by requiring a trailing space.
     (while (re-search-forward
-            "^(\\(def[^ ]+\\) ['(]*\\([^' ()\"\n]+\\)[\n \t]" nil t)
+            "^(\\(def[^ \t]+\\)[ \t]+['(]*\\([^' ()\"\n]+\\)[\n \t]" nil t)
       (unless (member (match-string 1) autoload-ignored-definitions)
         (let ((name (match-string-no-properties 2)))
           (when (save-excursion