bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#26412: 26.0.50; Minibuffer completion for "C-h f" probes unrelated s


From: npostavs
Subject: bug#26412: 26.0.50; Minibuffer completion for "C-h f" probes unrelated stuff
Date: Tue, 11 Apr 2017 10:13:34 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.2 (gnu/linux)

Eli Zaretskii <eliz@gnu.org> writes:

>> Which comes from these macros in lisp/mh/mh-acros.el:
>> 
>>     (defmacro defun-mh (name function arg-list &rest body)
>> 
>>     (defmacro defmacro-mh (name macro arg-list &rest body)
>
> Can we modify autoloads such that "def" is not collected here?  It
> could collect defun-mh and defmacro-mh instead, couldn't it?

This seems to work.

--- i/lisp/emacs-lisp/autoload.el
+++ w/lisp/emacs-lisp/autoload.el
@@ -546,9 +546,10 @@ autoload--make-defs-autoload
     ;; "cc-helper" and "c-mode", you'll get "c" in the root prefixes.
     (dolist (pair (prog1 prefixes (setq prefixes nil)))
       (let ((s (car pair)))
-        (if (or (> (length s) 2)                  ;Long enough!
-                (string-match ".[[:punct:]]\\'" s) ;A real (tho short) prefix?
-                (radix-tree-lookup (cdr pair) "")) ;Nothing to expand!
+        (if (and (not (string= "def" s)) ; Don't use "def" in deffoo-pkg-thing.
+                 (or (> (length s) 2)    ;Long enough!
+                     (string-match ".[[:punct:]]\\'" s) ;A real (tho short) 
prefix?
+                     (radix-tree-lookup (cdr pair) ""))) ;Nothing to expand!
             (push pair prefixes) ;Keep it as is.
           (radix-tree-iter-subtrees
            (cdr pair) (lambda (prefix subtree)

Here is the resulting diff for loaddefs:

--- loaddefs.el    2017-04-10 13:26:10.404737000 -0400
+++ loaddefs-nodef.el    2017-04-10 13:24:32.000000000 -0400
@@ -4732,7 +4732,7 @@
 ;;;### (autoloads nil "cl" "emacs-lisp/cl.el" (0 0 0 0))
 ;;; Generated autoloads from emacs-lisp/cl.el
 
-(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "cl" 
'("cl-" "def" "lexical-let" "labels" "flet")))
+(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "cl" 
'("cl-" "defsetf" "define-" "lexical-let" "labels" "flet")))
 
 ;;;***
 
@@ -20261,7 +20261,7 @@
 ;;;### (autoloads nil "mh-acros" "mh-e/mh-acros.el" (0 0 0 0))
 ;;; Generated autoloads from mh-e/mh-acros.el
 
-(if (fboundp 'register-definition-prefixes) (register-definition-prefixes 
"mh-acros" '("mh-" "with-mh-folder-updating" "def")))
+(if (fboundp 'register-definition-prefixes) (register-definition-prefixes 
"mh-acros" '("mh-" "with-mh-folder-updating" "defun-mh" "defmacro-mh")))
 
 ;;;***
 
@@ -20393,7 +20393,7 @@
 
 \(fn)" t nil)
 
-(if (fboundp 'register-definition-prefixes) (register-definition-prefixes 
"mh-e" '("mh-" "def")))
+(if (fboundp 'register-definition-prefixes) (register-definition-prefixes 
"mh-e" '("mh-" "defgroup-mh" "defcustom-mh" "defface-mh")))
 
 ;;;***
 
@@ -22035,7 +22035,7 @@
 ;;;### (autoloads nil "nnoo" "gnus/nnoo.el" (0 0 0 0))
 ;;; Generated autoloads from gnus/nnoo.el
 
-(if (fboundp 'register-definition-prefixes) (register-definition-prefixes 
"nnoo" '("nnoo-" "def")))
+(if (fboundp 'register-definition-prefixes) (register-definition-prefixes 
"nnoo" '("nnoo-" "defvoo" "deffoo")))
 
 ;;;***





reply via email to

[Prev in Thread] Current Thread [Next in Thread]