armindarvish / consult-omni

A Powerful Versatile Omni Search inside Emacs
https://github.com/armindarvish/consult-omni/tree/main
165 stars 4 forks source link

call-dynamic-command fails when thing at point starts with a number #18

Closed agzam closed 3 months ago

agzam commented 3 months ago

Describe the bug

Searching for things when the cursor is on something that starts with a number throws.

To Reproduce Steps to reproduce the behavior:

  1. Find or type any string that starts with a number
  2. Perform any consult-omni search commands, e.g., consult-omni-google

It fails at consult-omni-dynamic--split-thingatpt

Note that I'm using 'develop' branch.

stacktrace Debugger entered--Lisp error: (wrong-type-argument sequencep 1) transient--exit-and-debug(error (wrong-type-argument sequencep 1)) consult--async-split-initial(1) consult-omni-dynamic--split-thingatpt(number t) #(number) consult-omni--add-history() consult-omni--call-dynamic-command("1c1" nil nil nil "Wikipedia" consult-omni--wikipedia-fetch-results nil consult-omni-engine-title-face nil nil consult-omni--search-history consult-omni--selection-history nil "C-SPC" t) #f(compiled-function (&optional initial prompt no-callback &rest args) "consult-omni's dynamic interactive command to search Wikipedia." (interactive "P") #)("1c1" nil) apply(#f(compiled-function (&optional initial prompt no-callback &rest args) "consult-omni's dynamic interactive command to search Wikipedia." (interactive "P") #) "1c1" nil nil) (let ((init (or initial (if (use-region-p) (buffer-substring (region-beginning) (region-end)) (thing-at-point 'symbol :no-props))))) (apply fn init no-cb args)) consult-omni-use-thing-at-point-a(#f(compiled-function (&optional initial prompt no-callback &rest args) "consult-omni's dynamic interactive command to search Wikipedia." (interactive "P") #) nil) apply(consult-omni-use-thing-at-point-a #f(compiled-function (&optional initial prompt no-callback &rest args) "consult-omni's dynamic interactive command to search Wikipedia." (interactive "P") #) nil) #f(advice consult-omni-use-thing-at-point-a :around #f(compiled-function (&optional initial prompt no-callback &rest args) "consult-omni's dynamic interactive command to search Wikipedia." (interactive "P") #))(nil) apply(#f(advice consult-omni-use-thing-at-point-a :around #f(compiled-function (&optional initial prompt no-callback &rest args) "consult-omni's dynamic interactive command to search Wikipedia." (interactive "P") #)) nil) #f(compiled-function (fn &rest args) (interactive nil) #)(#f(advice consult-omni-use-thing-at-point-a :around #f(compiled-function (&optional initial prompt no-callback &rest args) "consult-omni's dynamic interactive command to search Wikipedia." (interactive "P") #)) nil) funcall-interactively(#f(compiled-function (fn &rest args) (interactive nil) #) #f(advice consult-omni-use-thing-at-point-a :around #f(compiled-function (&optional initial prompt no-callback &rest args) "consult-omni's dynamic interactive command to search Wikipedia." (interactive "P") #)) nil) apply(funcall-interactively #f(compiled-function (fn &rest args) (interactive nil) #) (#f(advice consult-omni-use-thing-at-point-a :around #f(compiled-function (&optional initial prompt no-callback &rest args) "consult-omni's dynamic interactive command to search Wikipedia." (interactive "P") #)) nil)) #[128 "\302\303\304!\203\13\0\305\202\f\0\306\300\3#\207" [#[385 "\304\305\300\301\302$\216\306\33\307\2\2\"*\207" [(#0) consult-omni-wikipedia #s(transient-prefix #s(transient-prefix eieio--unbound consult-omni-transient eieio--unbound nil eieio--unbound eieio--unbound eieio--unbound nil nil 0 nil nil nil nil nil nil eieio--unbound nil nil eieio--unbound nil nil nil) consult-omni-transient 4 nil eieio--unbound nil eieio--unbound nil (nil) 0 nil nil nil nil nil nil eieio--unbound nil nil eieio--unbound nil nil nil) debugger make-closure #[0 "\303\302\304\"\211\203\20\0\305\306!\210\211\301!\210\210\307\301\300\242\"\210\310\302\304\311#\207" [V0 V1 V2 eieio-oref unwind-suffix transient--debug unwind-command advice-remove eieio-oset nil] 4] transient--exit-and-debug apply] 7 "\n\n(fn FN &rest ARGS)" nil] '#[257 "\304C\305\306\2\300\301\302%\216\307\33\310\2!)\1\311\240)\210\207" [(#0) consult-omni-wikipedia #s(transient-prefix #s(transient-prefix eieio--unbound consult-omni-transient eieio--unbound nil eieio--unbound eieio--unbound eieio--unbound nil nil 0 nil nil nil nil nil nil eieio--unbound nil nil eieio--unbound nil nil nil) consult-omni-transient 4 nil eieio--unbound nil eieio--unbound nil (nil) 0 nil nil nil nil nil nil eieio--unbound nil nil eieio--unbound nil nil nil) debugger t make-closure #[0 "\300\242\205!\0\304\303\305\"\211\203\25\0\306\307!\210\211\302!\210\210\310\302\301\242\"\210\311\303\305\312#\207" [V0 V1 V2 V3 eieio-oref unwind-suffix transient--debug unwind-interactive advice-remove eieio-oset nil] 4] transient--exit-and-debug advice-eval-interactive-spec nil] 8 "\n\n(fn SPEC)"] apply called-interactively-p any funcall-interactively funcall] 5 cconv--interactive-helper](#f(advice consult-omni-use-thing-at-point-a :around #f(compiled-function (&optional initial prompt no-callback &rest args) "consult-omni's dynamic interactive command to search Wikipedia." (interactive "P") #)) nil) apply(#[128 "\302\303\304!\203\13\0\305\202\f\0\306\300\3#\207" [#[385 "\304\305\300\301\302$\216\306\33\307\2\2\"*\207" [(#0) consult-omni-wikipedia #s(transient-prefix #s(transient-prefix eieio--unbound consult-omni-transient eieio--unbound nil eieio--unbound eieio--unbound eieio--unbound nil nil 0 nil nil nil nil nil nil eieio--unbound nil nil eieio--unbound nil nil nil) consult-omni-transient 4 nil eieio--unbound nil eieio--unbound nil (nil) 0 nil nil nil nil nil nil eieio--unbound nil nil eieio--unbound nil nil nil) debugger make-closure #[0 "\303\302\304\"\211\203\20\0\305\306!\210\211\301!\210\210\307\301\300\242\"\210\310\302\304\311#\207" [V0 V1 V2 eieio-oref unwind-suffix transient--debug unwind-command advice-remove eieio-oset nil] 4] transient--exit-and-debug apply] 7 "\n\n(fn FN &rest ARGS)" nil] '#[257 "\304C\305\306\2\300\301\302%\216\307\33\310\2!)\1\311\240)\210\207" [(#0) consult-omni-wikipedia #s(transient-prefix #s(transient-prefix eieio--unbound consult-omni-transient eieio--unbound nil eieio--unbound eieio--unbound eieio--unbound nil nil 0 nil nil nil nil nil nil eieio--unbound nil nil eieio--unbound nil nil nil) consult-omni-transient 4 nil eieio--unbound nil eieio--unbound nil (nil) 0 nil nil nil nil nil nil eieio--unbound nil nil eieio--unbound nil nil nil) debugger t make-closure #[0 "\300\242\205!\0\304\303\305\"\211\203\25\0\306\307!\210\211\302!\210\210\310\302\301\242\"\210\311\303\305\312#\207" [V0 V1 V2 V3 eieio-oref unwind-suffix transient--debug unwind-interactive advice-remove eieio-oset nil] 4] transient--exit-and-debug advice-eval-interactive-spec nil] 8 "\n\n(fn SPEC)"] apply called-interactively-p any funcall-interactively funcall] 5 cconv--interactive-helper] #f(advice consult-omni-use-thing-at-point-a :around #f(compiled-function (&optional initial prompt no-callback &rest args) "consult-omni's dynamic interactive command to search Wikipedia." (interactive "P") #)) nil) consult-omni-wikipedia(nil) funcall-interactively(consult-omni-wikipedia nil) command-execute(consult-omni-wikipedia)
armindarvish commented 3 months ago

@agzam Just pushed a fix for this to develop. Let me know if there are more issues with thing at point because I have not tested that exhaustively.

agzam commented 3 months ago

That was quick, thank you!