abo-abo / hydra

make Emacs bindings that stick around
1.82k stars 106 forks source link

Bad interaction with company-mode when editing hydra #246

Open justbur opened 7 years ago

justbur commented 7 years ago
  1. emacs -Q
  2. M-x package-initialize
  3. M-x toggle-debug-on-error
  4. M-x company-mode
  5. After "a" start typing in the code below
    (defhydra simple (nil nil :hint nil :foreign-keys run)
    "
    _a_: A"
    ("a" asd))

    You get trapped in a loop with backtrace. company is trying to expand the macro which throws an error each time. Is there any way to avoid an error on macro expansion?

    Debugger entered--Lisp error: (error "An run Hydra must have at least one blue head in order to exit")
    signal(error ("An run Hydra must have at least one blue head in order to exit"))
    error("An %S Hydra must have at least one blue head in order to exit" run)
    #[898 "C\302!\262;\204*:\203\"@\303>\203\"\304\305!P\262\202*B\262\306\262\307\242@!\203;\211\310\211\242BB\240\210\3111(\312!\313\314\315\"!\313\314\316 \"!\242A@\242AA\242@\206b\317\320\"\317\321\"C\317\322\"\317\323\"\206v\317\324\"C\317\325\"C\317\326\"\327\f\242!\330
    \242!\211\203\244\211@\331\332\305!!\"\262A\266\202\202\214\210\211\203\217\211@\211G\211\333W\203\275\334\335\"\210\202k\211\333U\203\331A\336
    \337    #C\241\210AA\340D\241\210\202kAA@\211\203\211;\204\211:\204\336
    \337    #A\341=?\205\373AAB\241\266\210AA\211A\204\211\340D\241\210\202jAAA\317\342\"\211\203Q\343\340\344\345\"\203/\346\2020\310#\210AA\211A@\342=\203G\211AAA\241\210\202M\347A\342\"\210\210\202h\336\340\350#\343\340\350=\203d\n\202e#\266\266\210\210\343AAA\351\352\"#\210\211A@\204\210\343AAA\340\346#\210A\266\202\202\247\210\353\n\f#\354!\355\356\357\360\361\362!\363\"\364\365%\"\210\242\203\306\2429\203\306\366\367\242DD\240\210\203\3319\203\331\366\367  DD\262\242\203\361\2429\203\361\366\367   \242DD\240\210\242\203\2429\203\366\367\242DD\240\210\370>\203\371\372\"\204\334\373\"\210\374\375\376\310\314\377\"F\201@DE\375\376\313\314\201A\"!\310\314\201B\"F\201@\201C\201D\"DE\375\376\313\314\201E\"!\310\314\201F\"F\201@\201G\242$DE\331\201C\356\357\201H\361\362&\201I\"\201J\201K%\"?\206\257?\206\257\201L!?\205\331\201M\201N\201O\201PDED\201Q\201PD\201RBBBEC\201S\310\201C\356\357\201T\361\362\"\201U\"\201V\201K%\"\"\201W\242\f\201X\206\242\242\201Y&C$BBBB\266\202\266\2150\2027\201Z\201[A#\210\310\262\207" [hydra-base-map hydra-default-hint copy-tree (hydra--table concat format) "\n" eval "hydra" keywordp nil (debug error) copy-keymap intern format "%S/keymap" "%S/body" plist-get :bind :pre :body-pre :post :before-exit :after-exit :inherit hydra--body-foreign-keys hydra--body-exit append copy-sequence 2 error "Each head should have at least two items: %S" hydra-plist-get-default :hint :exit none :color plist-put memql (blue teal) t cl--do-remf default :cmd-name hydra--head-name hydra--doc hydra--delete-duplicates mapc make-byte-code 257 "\301\300\302@!\303AAA\304\"#\207" vconcat ...] 38 ("/home/jb/.emacs.d/elpa/hydra-20170325.815/hydra.elc" . 32180)](simple (nil nil :hint nil :foreign-keys run) "\n_a_: A" ("a" elisp--witness--lisp))
    #<subr macroexpand>((defhydra simple (nil nil :hint nil :foreign-keys run) "\n_a_: A" ("a" elisp--witness--lisp)) nil)
    apply(#<subr macroexpand> (defhydra simple (nil nil :hint nil :foreign-keys run) "\n_a_: A" ("a" elisp--witness--lisp)) nil)
    #[642 "\3001\301#0\207\210\207" [(error) apply] 7 "\n\n(fn EXPANDER FORM &rest ARGS)"](#<subr macroexpand> (defhydra simple (nil nil :hint nil :foreign-keys run) "\n_a_: A" ("a" elisp--witness--lisp)) nil)
    apply(#[642 "\3001\301#0\207\210\207" [(error) apply] 7 "\n\n(fn EXPANDER FORM &rest ARGS)"] #<subr macroexpand> ((defhydra simple (nil nil :hint nil :foreign-keys run) "\n_a_: A" ("a" elisp--witness--lisp)) nil))
    macroexpand((defhydra simple (nil nil :hint nil :foreign-keys run) "\n_a_: A" ("a" elisp--witness--lisp)) nil)
    macroexp-macroexpand((defhydra simple (nil nil :hint nil :foreign-keys run) "\n_a_: A" ("a" elisp--witness--lisp)) nil)
    macroexp--expand-all((defhydra simple (nil nil :hint nil :foreign-keys run) "\n_a_: A" ("a" elisp--witness--lisp)))
    macroexpand-all((defhydra simple (nil nil :hint nil :foreign-keys run) "\n_a_: A" ("a" elisp--witness--lisp)))
    elisp--local-variables()
    #[257 "\212\303\304!\210`pB\300\242\232\204!\305\306\302\242\"\210\300\240\210\301\307\310\311 \"\240\210\210)\301\242\207" [((220 . #<buffer *scratch*>)) (nil) (#[0 "\300\302\240\210\303\304\301\242\"\207" [((220 . #<buffer *scratch*>)) #2 nil remove-hook post-command-hook] 3]) skip-syntax-backward "_w" add-hook post-command-hook mapcar symbol-name elisp--local-variables] 6 "\n\n(fn STRING)"]("asd")
    #[771 "\211\242\302=\206\n\211\303=?\2053r\301\204p\202(\304 \305!\203%\306!\202&p\262q\210\307\300!$)\207" [#[257 "\212\303\304!\210`pB\300\242\232\204!\305\306\302\242\"\210\300\240\210\301\307\310\311 \"\240\210\210)\301\242\207" [((220 . #<buffer *scratch*>)) (nil) (#[0 "\300\302\240\210\303\304\301\242\"\207" [(...) #4 nil remove-hook post-command-hook] 3]) skip-syntax-backward "_w" add-hook post-command-hook mapcar symbol-name elisp--local-variables] 6 "\n\n(fn STRING)"] nil boundaries metadata minibuffer-selected-window window-live-p window-buffer complete-with-action] 8 "\n\n(fn STRING PRED ACTION)"]("asd" nil t)
    all-completions("asd" #[771 "\211\242\302=\206\n\211\303=?\2053r\301\204p\202(\304 \305!\203%\306!\202&p\262q\210\307\300!$)\207" [#[257 "\212\303\304!\210`pB\300\242\232\204!\305\306\302\242\"\210\300\240\210\301\307\310\311 \"\240\210\210)\301\242\207" [((220 . #<buffer *scratch*>)) (nil) (#[0 "\300\302\240\210\303\304\301\242\"\207" [(...) #4 nil remove-hook post-command-hook] 3]) skip-syntax-backward "_w" add-hook post-command-hook mapcar symbol-name elisp--local-variables] 6 "\n\n(fn STRING)"] nil boundaries metadata minibuffer-selected-window window-live-p window-buffer complete-with-action] 8 "\n\n(fn STRING PRED ACTION)"] nil)
    #[257 "\302\300\301#\207" ["asd" nil all-completions] 5 "\n\n(fn TABLE)"](#[771 "\211\242\302=\206\n\211\303=?\2053r\301\204p\202(\304 \305!\203%\306!\202&p\262q\210\307\300!$)\207" [#[257 "\212\303\304!\210`pB\300\242\232\204!\305\306\302\242\"\210\300\240\210\301\307\310\311 \"\240\210\210)\301\242\207" [((220 . #<buffer *scratch*>)) (nil) (#[0 "\300\302\240\210\303\304\301\242\"\207" [(...) #4 nil remove-hook post-command-hook] 3]) skip-syntax-backward "_w" add-hook post-command-hook mapcar symbol-name elisp--local-variables] 6 "\n\n(fn STRING)"] nil boundaries metadata minibuffer-selected-window window-live-p window-buffer complete-with-action] 8 "\n\n(fn STRING PRED ACTION)"])
    mapcar(#[257 "\302\300\301#\207" ["asd" nil all-completions] 5 "\n\n(fn TABLE)"] (#[771 "\211\242\302=\206\n\211\303=?\2053r\301\204p\202(\304 \305!\203%\306!\202&p\262q\210\307\300!$)\207" [#[257 "\212\303\304!\210`pB\300\242\232\204!\305\306\302\242\"\210\300\240\210\301\307\310\311 \"\240\210\210)\301\242\207" [((220 . #<buffer *scratch*>)) (nil) (#[0 "\300\302\240\210\303\304\301\242\"\207" [... #5 nil remove-hook post-command-hook] 3]) skip-syntax-backward "_w" add-hook post-command-hook mapcar symbol-name elisp--local-variables] 6 "\n\n(fn STRING)"] nil boundaries metadata minibuffer-selected-window window-live-p window-buffer complete-with-action] 8 "\n\n(fn STRING PRED ACTION)"] #[128 "\302\300\303\301\"\"\207" [completion-table-with-predicate ([eieio-default-eval-maybe esh-arg magit-remote-remove evilnc-comment-or-uncomment-to-the-line viper-util eieio--class-slots--cmacro ox-man debugger-previous-window verilog-mode-indent org-export-org dired-faces crm114 erc-log Info-revert-buffer-function misearch org-archive nnir package-desc-extras semantic-symref-instantiate ediff-merg nnmail-files gnus-article-highlight cal-html eieio--generic-generalizer spreadsheet erc-mode-line-and-header new-vec memory select-tags-table-quit gnus-score-expire byte-goto-if-nil ind select-tags-table-mode-abbrev-table erc-autoaway srecode/expandproto cl-get custom-faces em-script :reqs evilmi-org-get-tag org-export-pdf require-match hydra-idle-message xscheme package-desc-status message-buffers kmacro-step-edit-minibuf-setup ps-print-printer ob-R cl-delete-if ...] boundp strict) apply append] 6 "\n\n(fn &rest ARGS2)"]))
    #[771 "\211\2049\301\302\303\304\305\306\"\307\"\310\311%\300\"\235\203 \2028\312\301\302\303\313\305\306!\314\"\315\316%\317\320\"\"#\207\211\321=\203U\322\323\301\302\303\304\305\306\n\n\"\324\"\310\311%\300\"\"\207\325\302\303\326\305\306#\327\"\330\311%\300\"\207" [(#[771 "\211\242\302=\206\n\211\303=?\2053r\301\204p\202(\304 \305!\203%\306!\202&p\262q\210\307\300!$)\207" [#[257 "\212\303\304!\210`pB\300\242\232\204!\305\306\302\242\"\210\300\240\210\301\307\310\311 \"\240\210\210)\301\242\207" [(...) (nil) (#[0 "\300\302\240\210\303\304\301\242\"\207" [... #7 nil remove-hook post-command-hook] 3]) skip-syntax-backward "_w" add-hook post-command-hook mapcar symbol-name elisp--local-variables] 6 "\n\n(fn STRING)"] nil boundaries metadata minibuffer-selected-window window-live-p window-buffer complete-with-action] 8 "\n\n(fn STRING PRED ACTION)"] #[128 "\302\300\303\301\"\"\207" [completion-table-with-predicate ([eieio-default-eval-maybe esh-arg magit-remote-remove evilnc-comment-or-uncomment-to-the-line viper-util eieio--class-slots--cmacro ox-man debugger-previous-window verilog-mode-indent org-export-org dired-faces crm114 erc-log Info-revert-buffer-function misearch org-archive nnir package-desc-extras semantic-symref-instantiate ediff-merg nnmail-files gnus-article-highlight cal-html eieio--generic-generalizer spreadsheet erc-mode-line-and-header new-vec memory select-tags-table-quit gnus-score-expire byte-goto-if-nil ind select-tags-table-mode-abbrev-table erc-autoaway srecode/expandproto cl-get custom-faces em-script :reqs evilmi-org-get-tag org-export-pdf require-match hydra-idle-message xscheme package-desc-status message-buffers kmacro-step-edit-minibuf-setup ps-print-printer ob-R cl-delete-if ...] boundp strict) apply append] 6 "\n\n(fn &rest ARGS2)"]) mapcar make-byte-code 257 "\302\300\301#\207" vconcat vector [try-completion] 5 "\n\n(fn TABLE)" try-completion "\211\301=\203\300\207\207" [t] 3 "\n\n(fn VALUE)" delq nil t apply append [all-completions] completion--some "\303\302\300\301$\207" [complete-with-action] 6] 13 "\n\n(fn STRING PRED ACTION)"]("asd" nil t)
    all-completions("asd" #[771 "\211\2049\301\302\303\304\305\306\"\307\"\310\311%\300\"\235\203 \2028\312\301\302\303\313\305\306!\314\"\315\316%\317\320\"\"#\207\211\321=\203U\322\323\301\302\303\304\305\306\n\n\"\324\"\310\311%\300\"\"\207\325\302\303\326\305\306#\327\"\330\311%\300\"\207" [(#[771 "\211\242\302=\206\n\211\303=?\2053r\301\204p\202(\304 \305!\203%\306!\202&p\262q\210\307\300!$)\207" [#[257 "\212\303\304!\210`pB\300\242\232\204!\305\306\302\242\"\210\300\240\210\301\307\310\311 \"\240\210\210)\301\242\207" [(...) (nil) (#[0 "\300\302\240\210\303\304\301\242\"\207" [... #7 nil remove-hook post-command-hook] 3]) skip-syntax-backward "_w" add-hook post-command-hook mapcar symbol-name elisp--local-variables] 6 "\n\n(fn STRING)"] nil boundaries metadata minibuffer-selected-window window-live-p window-buffer complete-with-action] 8 "\n\n(fn STRING PRED ACTION)"] #[128 "\302\300\303\301\"\"\207" [completion-table-with-predicate ([eieio-default-eval-maybe esh-arg magit-remote-remove evilnc-comment-or-uncomment-to-the-line viper-util eieio--class-slots--cmacro ox-man debugger-previous-window verilog-mode-indent org-export-org dired-faces crm114 erc-log Info-revert-buffer-function misearch org-archive nnir package-desc-extras semantic-symref-instantiate ediff-merg nnmail-files gnus-article-highlight cal-html eieio--generic-generalizer spreadsheet erc-mode-line-and-header new-vec memory select-tags-table-quit gnus-score-expire byte-goto-if-nil ind select-tags-table-mode-abbrev-table erc-autoaway srecode/expandproto cl-get custom-faces em-script :reqs evilmi-org-get-tag org-export-pdf require-match hydra-idle-message xscheme package-desc-status message-buffers kmacro-step-edit-minibuf-setup ps-print-printer ob-R cl-delete-if ...] boundp strict) apply append] 6 "\n\n(fn &rest ARGS2)"]) mapcar make-byte-code 257 "\302\300\301#\207" vconcat vector [try-completion] 5 "\n\n(fn TABLE)" try-completion "\211\301=\203\300\207\207" [t] 3 "\n\n(fn VALUE)" delq nil t apply append [all-completions] completion--some "\303\302\300\301$\207" [complete-with-action] 6] 13 "\n\n(fn STRING PRED ACTION)"] nil)
    completion-pcm--all-completions("" ("asd" point) #[771 "\211\2049\301\302\303\304\305\306\"\307\"\310\311%\300\"\235\203 \2028\312\301\302\303\313\305\306!\314\"\315\316%\317\320\"\"#\207\211\321=\203U\322\323\301\302\303\304\305\306\n\n\"\324\"\310\311%\300\"\"\207\325\302\303\326\305\306#\327\"\330\311%\300\"\207" [(#[771 "\211\242\302=\206\n\211\303=?\2053r\301\204p\202(\304 \305!\203%\306!\202&p\262q\210\307\300!$)\207" [#[257 "\212\303\304!\210`pB\300\242\232\204!\305\306\302\242\"\210\300\240\210\301\307\310\311 \"\240\210\210)\301\242\207" [(...) (nil) (#[0 "\300\302\240\210\303\304\301\242\"\207" [... #7 nil remove-hook post-command-hook] 3]) skip-syntax-backward "_w" add-hook post-command-hook mapcar symbol-name elisp--local-variables] 6 "\n\n(fn STRING)"] nil boundaries metadata minibuffer-selected-window window-live-p window-buffer complete-with-action] 8 "\n\n(fn STRING PRED ACTION)"] #[128 "\302\300\303\301\"\"\207" [completion-table-with-predicate ([eieio-default-eval-maybe esh-arg magit-remote-remove evilnc-comment-or-uncomment-to-the-line viper-util eieio--class-slots--cmacro ox-man debugger-previous-window verilog-mode-indent org-export-org dired-faces crm114 erc-log Info-revert-buffer-function misearch org-archive nnir package-desc-extras semantic-symref-instantiate ediff-merg nnmail-files gnus-article-highlight cal-html eieio--generic-generalizer spreadsheet erc-mode-line-and-header new-vec memory select-tags-table-quit gnus-score-expire byte-goto-if-nil ind select-tags-table-mode-abbrev-table erc-autoaway srecode/expandproto cl-get custom-faces em-script :reqs evilmi-org-get-tag org-export-pdf require-match hydra-idle-message xscheme package-desc-status message-buffers kmacro-step-edit-minibuf-setup ps-print-printer ob-R cl-delete-if ...] boundp strict) apply append] 6 "\n\n(fn &rest ARGS2)"]) mapcar make-byte-code 257 "\302\300\301#\207" vconcat vector [try-completion] 5 "\n\n(fn TABLE)" try-completion "\211\301=\203\300\207\207" [t] 3 "\n\n(fn VALUE)" delq nil t apply append [all-completions] completion--some "\303\302\300\301$\207" [complete-with-action] 6] 13 "\n\n(fn STRING PRED ACTION)"] nil)
    completion-basic-all-completions("asd" #[771 "\211\2049\301\302\303\304\305\306\"\307\"\310\311%\300\"\235\203 \2028\312\301\302\303\313\305\306!\314\"\315\316%\317\320\"\"#\207\211\321=\203U\322\323\301\302\303\304\305\306\n\n\"\324\"\310\311%\300\"\"\207\325\302\303\326\305\306#\327\"\330\311%\300\"\207" [(#[771 "\211\242\302=\206\n\211\303=?\2053r\301\204p\202(\304 \305!\203%\306!\202&p\262q\210\307\300!$)\207" [#[257 "\212\303\304!\210`pB\300\242\232\204!\305\306\302\242\"\210\300\240\210\301\307\310\311 \"\240\210\210)\301\242\207" [(...) (nil) (#[0 "\300\302\240\210\303\304\301\242\"\207" [... #7 nil remove-hook post-command-hook] 3]) skip-syntax-backward "_w" add-hook post-command-hook mapcar symbol-name elisp--local-variables] 6 "\n\n(fn STRING)"] nil boundaries metadata minibuffer-selected-window window-live-p window-buffer complete-with-action] 8 "\n\n(fn STRING PRED ACTION)"] #[128 "\302\300\303\301\"\"\207" [completion-table-with-predicate ([eieio-default-eval-maybe esh-arg magit-remote-remove evilnc-comment-or-uncomment-to-the-line viper-util eieio--class-slots--cmacro ox-man debugger-previous-window verilog-mode-indent org-export-org dired-faces crm114 erc-log Info-revert-buffer-function misearch org-archive nnir package-desc-extras semantic-symref-instantiate ediff-merg nnmail-files gnus-article-highlight cal-html eieio--generic-generalizer spreadsheet erc-mode-line-and-header new-vec memory select-tags-table-quit gnus-score-expire byte-goto-if-nil ind select-tags-table-mode-abbrev-table erc-autoaway srecode/expandproto cl-get custom-faces em-script :reqs evilmi-org-get-tag org-export-pdf require-match hydra-idle-message xscheme package-desc-status message-buffers kmacro-step-edit-minibuf-setup ps-print-printer ob-R cl-delete-if ...] boundp strict) apply append] 6 "\n\n(fn &rest ARGS2)"]) mapcar make-byte-code 257 "\302\300\301#\207" vconcat vector [try-completion] 5 "\n\n(fn TABLE)" try-completion "\211\301=\203\300\207\207" [t] 3 "\n\n(fn VALUE)" delq nil t apply append [all-completions] completion--some "\303\302\300\301$\207" [complete-with-action] 6] 13 "\n\n(fn STRING PRED ACTION)"] nil 3)
    #[257 "\300
    \2368\301\242\302\242\303\304\242$\207" [2 ("asd") (#[771 "\211\2049\301\302\303\304\305\306\"\307\"\310\311%\300\"\235\203 \2028\312\301\302\303\313\305\306!\314\"\315\316%\317\320\"\"#\207\211\321=\203U\322\323\301\302\303\304\305\306\n\n\"\324\"\310\311%\300\"\"\207\325\302\303\326\305\306#\327\"\330\311%\300\"\207" [(#[771 "\211\242\302=\206\n\211\303=?\2053r\301\204p\202(\304 \305!\203%\306!\202&p\262q\210\307\300!$)\207" [#[257 "\212\303\304!\210`pB\300\242\232\204!\305\306\302\242\"\210\300\240\210\301\307\310\311 \"\240\210\210)\301\242\207" [... ... ... skip-syntax-backward "_w" add-hook post-command-hook mapcar symbol-name elisp--local-variables] 6 "\n\n(fn STRING)"] nil boundaries metadata minibuffer-selected-window window-live-p window-buffer complete-with-action] 8 "\n\n(fn STRING PRED ACTION)"] #[128 "\302\300\303\301\"\"\207" [completion-table-with-predicate ... apply append] 6 "\n\n(fn &rest ARGS2)"]) mapcar make-byte-code 257 "\302\300\301#\207" vconcat vector [try-completion] 5 "\n\n(fn TABLE)" try-completion "\211\301=\203\300\207\207" [t] 3 "\n\n(fn VALUE)" delq nil t apply append [all-completions] completion--some "\303\302\300\301$\207" [complete-with-action] 6] 13 "\n\n(fn STRING PRED ACTION)"]) nil (3) completion-styles-alist] 6 "\n\n(fn STYLE)"](basic)
    completion--some(#[257 "\300
    \2368\301\242\302\242\303\304\242$\207" [2 ("asd") (#[771 "\211\2049\301\302\303\304\305\306\"\307\"\310\311%\300\"\235\203 \2028\312\301\302\303\313\305\306!\314\"\315\316%\317\320\"\"#\207\211\321=\203U\322\323\301\302\303\304\305\306\n\n\"\324\"\310\311%\300\"\"\207\325\302\303\326\305\306#\327\"\330\311%\300\"\207" [(#[771 "\211\242\302=\206\n\211\303=?\2053r\301\204p\202(\304 \305!\203%\306!\202&p\262q\210\307\300!$)\207" [#[257 "\212\303\304!\210`pB\300\242\232\204!\305\306\302\242\"\210\300\240\210\301\307\310\311 \"\240\210\210)\301\242\207" [... ... ... skip-syntax-backward "_w" add-hook post-command-hook mapcar symbol-name elisp--local-variables] 6 "\n\n(fn STRING)"] nil boundaries metadata minibuffer-selected-window window-live-p window-buffer complete-with-action] 8 "\n\n(fn STRING PRED ACTION)"] #[128 "\302\300\303\301\"\"\207" [completion-table-with-predicate ... apply append] 6 "\n\n(fn &rest ARGS2)"]) mapcar make-byte-code 257 "\302\300\301#\207" vconcat vector [try-completion] 5 "\n\n(fn TABLE)" try-completion "\211\301=\203\300\207\207" [t] 3 "\n\n(fn VALUE)" delq nil t apply append [all-completions] completion--some "\303\302\300\301$\207" [complete-with-action] 6] 13 "\n\n(fn STRING PRED ACTION)"]) nil (3) completion-styles-alist] 6 "\n\n(fn STYLE)"] (basic partial-completion emacs22))
    completion--nth-completion(2 "asd" #[771 "\211\2049\301\302\303\304\305\306\"\307\"\310\311%\300\"\235\203 \2028\312\301\302\303\313\305\306!\314\"\315\316%\317\320\"\"#\207\211\321=\203U\322\323\301\302\303\304\305\306\n\n\"\324\"\310\311%\300\"\"\207\325\302\303\326\305\306#\327\"\330\311%\300\"\207" [(#[771 "\211\242\302=\206\n\211\303=?\2053r\301\204p\202(\304 \305!\203%\306!\202&p\262q\210\307\300!$)\207" [#[257 "\212\303\304!\210`pB\300\242\232\204!\305\306\302\242\"\210\300\240\210\301\307\310\311 \"\240\210\210)\301\242\207" [(...) (nil) (#[0 "\300\302\240\210\303\304\301\242\"\207" [... #7 nil remove-hook post-command-hook] 3]) skip-syntax-backward "_w" add-hook post-command-hook mapcar symbol-name elisp--local-variables] 6 "\n\n(fn STRING)"] nil boundaries metadata minibuffer-selected-window window-live-p window-buffer complete-with-action] 8 "\n\n(fn STRING PRED ACTION)"] #[128 "\302\300\303\301\"\"\207" [completion-table-with-predicate ([eieio-default-eval-maybe esh-arg magit-remote-remove evilnc-comment-or-uncomment-to-the-line viper-util eieio--class-slots--cmacro ox-man debugger-previous-window verilog-mode-indent org-export-org dired-faces crm114 erc-log Info-revert-buffer-function misearch org-archive nnir package-desc-extras semantic-symref-instantiate ediff-merg nnmail-files gnus-article-highlight cal-html eieio--generic-generalizer spreadsheet erc-mode-line-and-header new-vec memory select-tags-table-quit gnus-score-expire byte-goto-if-nil ind select-tags-table-mode-abbrev-table erc-autoaway srecode/expandproto cl-get custom-faces em-script :reqs evilmi-org-get-tag org-export-pdf require-match hydra-idle-message xscheme package-desc-status message-buffers kmacro-step-edit-minibuf-setup ps-print-printer ob-R cl-delete-if ...] boundp strict) apply append] 6 "\n\n(fn &rest ARGS2)"]) mapcar make-byte-code 257 "\302\300\301#\207" vconcat vector [try-completion] 5 "\n\n(fn TABLE)" try-completion "\211\301=\203\300\207\207" [t] 3 "\n\n(fn VALUE)" delq nil t apply append [all-completions] completion--some "\303\302\300\301$\207" [complete-with-action] 6] 13 "\n\n(fn STRING PRED ACTION)"] nil 3 nil)
    completion-all-completions("asd" #[771 "\211\2049\301\302\303\304\305\306\"\307\"\310\311%\300\"\235\203 \2028\312\301\302\303\313\305\306!\314\"\315\316%\317\320\"\"#\207\211\321=\203U\322\323\301\302\303\304\305\306\n\n\"\324\"\310\311%\300\"\"\207\325\302\303\326\305\306#\327\"\330\311%\300\"\207" [(#[771 "\211\242\302=\206\n\211\303=?\2053r\301\204p\202(\304 \305!\203%\306!\202&p\262q\210\307\300!$)\207" [#[257 "\212\303\304!\210`pB\300\242\232\204!\305\306\302\242\"\210\300\240\210\301\307\310\311 \"\240\210\210)\301\242\207" [(...) (nil) (#[0 "\300\302\240\210\303\304\301\242\"\207" [... #7 nil remove-hook post-command-hook] 3]) skip-syntax-backward "_w" add-hook post-command-hook mapcar symbol-name elisp--local-variables] 6 "\n\n(fn STRING)"] nil boundaries metadata minibuffer-selected-window window-live-p window-buffer complete-with-action] 8 "\n\n(fn STRING PRED ACTION)"] #[128 "\302\300\303\301\"\"\207" [completion-table-with-predicate ([eieio-default-eval-maybe esh-arg magit-remote-remove evilnc-comment-or-uncomment-to-the-line viper-util eieio--class-slots--cmacro ox-man debugger-previous-window verilog-mode-indent org-export-org dired-faces crm114 erc-log Info-revert-buffer-function misearch org-archive nnir package-desc-extras semantic-symref-instantiate ediff-merg nnmail-files gnus-article-highlight cal-html eieio--generic-generalizer spreadsheet erc-mode-line-and-header new-vec memory select-tags-table-quit gnus-score-expire byte-goto-if-nil ind select-tags-table-mode-abbrev-table erc-autoaway srecode/expandproto cl-get custom-faces em-script :reqs evilmi-org-get-tag org-export-pdf require-match hydra-idle-message xscheme package-desc-status message-buffers kmacro-step-edit-minibuf-setup ps-print-printer ob-R cl-delete-if ...] boundp strict) apply append] 6 "\n\n(fn &rest ARGS2)"]) mapcar make-byte-code 257 "\302\300\301#\207" vconcat vector [try-completion] 5 "\n\n(fn TABLE)" try-completion "\211\301=\203\300\207\207" [t] 3 "\n\n(fn VALUE)" delq nil t apply append [all-completions] completion--some "\303\302\300\301$\207" [complete-with-action] 6] 13 "\n\n(fn STRING PRED ACTION)"] nil 3)
    company-capf(candidates "asd")
    apply(company-capf (candidates "asd"))
    company-call-backend-raw(candidates "asd")
    company--fetch-candidates("asd")
    company-calculate-candidates("asd")
    company--begin-new()
    company--perform()
    company-auto-begin()
    company-idle-begin(#<buffer *scratch*> #<window 3 on *scratch*> 178 223)
    apply(company-idle-begin (#<buffer *scratch*> #<window 3 on *scratch*> 178 223))
    timer-event-handler([t 22813 37810 996671 nil company-idle-begin (#<buffer *scratch*> #<window 3 on *scratch*> 178 223) nil 81000])
abo-abo commented 7 years ago

Works fine for me. In any case, seems like a company-mode issue rather than hydra.

justbur commented 7 years ago

It's not just company-mode, although that is what's causing the headache here. The call that triggers it is elisp--local-variables which tries to expand any surrounding macros. If you just try to macroexpand a bad hydra, an error is thrown. Here for example.

The issue is that there are some cases (eg company-mode) in which the macro gets expanded before the user has finished it and defhydra throws errors at expansion time. I tend to leave debug-on-error on, but I can see that everything is fine with it off. What if the macro just expanded to the error without executing it in this case? Would that be bad?

Now that I understand the problem, I can just leave debug-on-error off, but this is the first time it's caused a problem when there wasn't an actual bug.

abo-abo commented 7 years ago

What if the macro just expanded to the error without executing it in this case? Would that be bad?

You can change it to a warning as far as I'm concerned. The error was intended as a hint to the user to fix the code.