Closed srustamo closed 7 years ago
This is in keys.el
file.
Calling it after manually calling whitespace-mode
does not give error.
Can't reproduce.
I'm not using the config verbatim, so not surprised if it works for you. If something jumps to your mind as to the reason, I appreciate your sharing.
Trace.
Debugger entered--Lisp error: (void-variable whitespace-mode) (format "%s abbrev-mode: %S\n%s debug-on-error: %S\n%s auto-fill-mode: %S\n%s highlight %S\n%s truncate-lines: %S\n%s whitespace-mode: %S\n%s org link display: %S\n" #("a" 0 1 (face hydra-face-pink)) abbrev-mode #("d" 0 1 (face hydra-face-pink)) debug-on-error #("f" 0 1 (face hydra-face-pink)) auto-fill-function #("h" 0 1 (face hydra-face-pink)) highlight-nonselected-windows #("t" 0 1 (face hydra-face-pink)) truncate-lines #("w" 0 1 (face hydra-face-pink)) whitespace-mode #("l" 0 1 (face hydra-face-pink)) org-descriptive-links) (concat (format "%s abbrev-mode: %S\n%s debug-on-error: %S\n%s auto-fill-mode: %S\n%s highlight %S\n%s truncate-lines: %S\n%s whitespace-mode: %S\n%s org link display: %S\n" #("a" 0 1 (face hydra-face-pink)) abbrev-mode #("d" 0 1 (face hydra-face-pink)) debug-on-error #("f" 0 1 (face hydra-face-pink)) auto-fill-function #("h" 0 1 (face hydra-face-pink)) highlight-nonselected-windows #("t" 0 1 (face hydra-face-pink)) truncate-lines #("w" 0 1 (face hydra-face-pink)) whitespace-mode #("l" 0 1 (face hydra-face-pink)) org-descriptive-links) #("[q]: quit." 1 2 (face hydra-face-blue))) eval((concat (format "%s abbrev-mode: %S\n%s debug-on-error: %S\n%s auto-fill-mode: %S\n%s highlight %S\n%s truncate-lines: %S\n%s whitespace-mode: %S\n%s org link display: %S\n" #("a" 0 1 (face hydra-face-pink)) abbrev-mode #("d" 0 1 (face hydra-face-pink)) debug-on-error #("f" 0 1 (face hydra-face-pink)) auto-fill-function #("h" 0 1 (face hydra-face-pink)) highlight-nonselected-windows #("t" 0 1 (face hydra-face-pink)) truncate-lines #("w" 0 1 (face hydra-face-pink)) whitespace-mode #("l" 0 1 (face hydra-face-pink)) org-descriptive-links) #("[q]: quit." 1 2 (face hydra-face-blue)))) hydra-show-hint((concat (format "%s abbrev-mode: %S\n%s debug-on-error: %S\n%s auto-fill-mode: %S\n%s highlight %S\n%s truncate-lines: %S\n%s whitespace-mode: %S\n%s org link display: %S\n" #("a" 0 1 (face hydra-face-pink)) abbrev-mode #("d" 0 1 (face hydra-face-pink)) debug-on-error #("f" 0 1 (face hydra-face-pink)) auto-fill-function #("h" 0 1 (face hydra-face-pink)) highlight-nonselected-windows #("t" 0 1 (face hydra-face-pink)) truncate-lines #("w" 0 1 (face hydra-face-pink)) whitespace-mode #("l" 0 1 (face hydra-face-pink)) org-descriptive-links) #("[q]: quit." 1 2 (face hydra-face-blue))) hydra-toggle) hydra-toggle/body() funcall-interactively(hydra-toggle/body) call-interactively(hydra-toggle/body nil nil) command-execute(hydra-toggle/body)
whitespace-mode
is both a symbol and a function defined in whitespace.el
.
Possibly, only the function is autoloaded, resulting in the symbol being undefined.
In any case, a simple (require 'whitespace)
before defhydra
should fix it.
Thanks. I try to follow your way of reducing the use of require
. I greped your repo for whitespace-mode
. You only define it in keys.el
.
I wonder why you don't see this error.
-- mode: ag; default-directory: "~/GitHub/abo-abo/oremacs/" -- Ag started at Tue Mar 28 19:24:20
ag --literal --nogroup --line-number --column --color --color-match 30\;43 --color-path 1\;32 --nogroup --skip-vcs-ignores --numbers --smart-case --follow --stats -- whitespace-mode . keys.el:252:5:w whitespace-mode: %`whitespace-mode keys.el:260:8: ("w" whitespace-mode) 3 matches 1 files contained matches 172 files searched 271739 bytes searched 0.012638 seconds
Ag finished at Tue Mar 28 19:24:20
Thanks. I try to follow your way of reducing the use of require.
I was actually suggesting to increase it. Your error happens because the whitespace-mode
symbol isn't defined.
If you use (require 'whitespace)
, the symbol will become defined. Just use it before defhydra
, not after.
I was actually suggesting to increase it
I meant the overall philosophy of this config - autoload/hook stuff to reduce load time.
Thanks for your help. I'm still curious why you don't see this error in your config.
I get the subject error calling the hydra below.