jamescherti / minimal-emacs.d

Minimal ~/.emacs.d - Better Vanilla Emacs Defaults and Optimized Startup
https://github.com/jamescherti/minimal-emacs.d
153 stars 14 forks source link

Suggestion: help-enable-completion-autoload nil #11

Closed meedstrom closed 2 weeks ago

meedstrom commented 3 weeks ago

I have not understood exactly what help-enable-completion-autoload does or why, but in short, I managed to speed up my C-h f and C-h v quite significantly on Emacs 31.0.50 by setting this to nil, taking them from ~2 seconds to ~0.2 seconds. Only affected Emacs 29 a little bit.

I suspected something was weird because I ran into the following error while I tried to complete to the symbol org-node--series, which rests in the file "org-node.el", and the backtrace shows that it tried to load files "wip.el" and "wip2.el" that I have in the same directory which contain no autoloads nor provides, and that's where the void-variable error comes from. The code in there does not work, but I did not intend the files to be loaded by anything.

Debugger entered--Lisp error: (void-variable result-sets)
  byte-code("\303\304\305\304\306\10\"\"\307\310\311\312%@\21\n\313\314\10\"!\210\315\316\317\320\"\321\317\322\323#\210!\207" [result-sets org-node--time-at-last-child-done finalizer sort mapcar car last :lessp time-less-p :reverse t cl-reduce #f(compiled-function (a b) #<bytecode 0x145f9ceb90396651>) native-compile defalias org-node--per-visit #f(compiled-function (&rest rest) "Temporarily visit each file in FILES and run BODY.\n\nPresumes that FILES are abbreviated truenames.  This is a safe\nassumption when FILES are output by `org-node-list-files'.\n\nHandles the limit of 1024 open files." #<bytecode -0x18e7882140012017>) function-put lisp-indent-function defun] 6)
  load("wip2" noerror nomessage)
  help--load-prefixes((("org-node--" "wip2" "wip") ("org-node" "org-node") ("org-" "ess-tracebug" "ox-latex" "ox" "org-src" "org-refile" "org-protocol" "org-plot" "org-pcomplete" "org-mouse" "org-macs" "org-list" "org-keys" "org-habit" "org-faces" "org-ctags" "org-crypt" "org-compat" "org-colview" "org-clock" "org-agenda" "org" "ol-bibtex" "ol" "ob-table" "ob-plantuml" "ob-exp" "ob-ditaa" "ob-core") ("org" "org-table")))
  help--symbol-completion-table("org-node--series" #f(compiled-function (vv) #<bytecode 0x1071e296c8e4cd7a>) lambda)
  test-completion("org-node--series" help--symbol-completion-table #f(compiled-function (vv) #<bytecode 0x1071e296c8e4cd7a>))
  vertico--match-p("org-node--series")
  vertico-exit(nil)
  funcall-interactively(vertico-exit nil)
  command-execute(vertico-exit)
  #<subr completing-read-default>("Describe variable: " help--symbol-completion-table #f(compiled-function (vv) #<bytecode 0x1071e296c8e4cd7a>) t nil nil nil nil)
  apply((#<subr completing-read-default> "Describe variable: " help--symbol-completion-table #f(compiled-function (vv) #<bytecode 0x1071e296c8e4cd7a>) t nil nil nil nil))
  vertico--advice(#<subr completing-read-default> "Describe variable: " help--symbol-completion-table #f(compiled-function (vv) #<bytecode 0x1071e296c8e4cd7a>) t nil nil nil nil)
  apply(vertico--advice #<subr completing-read-default> ("Describe variable: " help--symbol-completion-table #f(compiled-function (vv) #<bytecode 0x1071e296c8e4cd7a>) t nil nil nil nil))
  completing-read-default("Describe variable: " help--symbol-completion-table #f(compiled-function (vv) #<bytecode 0x1071e296c8e4cd7a>) t nil nil nil nil)
  completing-read("Describe variable: " help--symbol-completion-table #f(compiled-function (vv) #<bytecode 0x1071e296c8e4cd7a>) t nil nil nil)
  byte-code("\301 \302p\303\2\30\304\305\306\6\69\205\22\0\6\6\"\307\310\311\6\6\"\302\303\211\6\n9\205&\0\312\6\13!&\7\262\1\211\313\232\2034\0\3\202..." [enable-recursive-minibuffers variable-at-point t nil completing-read format-prompt "Describe variable" help--symbol-completion-table make-closure #f(compiled-function (vv) #<bytecode -0xe8f863abbbe3288>) symbol-name "" intern] 13)
  command-execute(describe-variable)
jamescherti commented 2 weeks ago

Thank you for your suggestion. I will need to do some research and tests first. Just a few things to consider before possibly integrating this into minimal Emacs. I added your suggestion to the list of tasks.