Closed djpeebles closed 1 year ago
Thanks for creating a separate issue!
toggle-debug-on-error
is an interactive function, you need to call it to have an expected effect.
What is M-#
bound for you? Does this happen when (require 'powerthesaurus)
is executing or later when you call one of the commands?
Cheers!
M-# is bound to powerthesaurus-lookup-dwim
When I ran toggle-debug-on-error as a function it returned nil and I received the message "Debug on Error disabled globally" each time!
When I ran (require 'powerthesaurus) I got the following error
OK, I see. Let's try
(setq byte-compile-debug t)
(byte-compile-file "path/to/powerthesaurus.el")
and repeat.
Additionally, can you please tell me what version of Emacs do you use and whether you have the hydra
package installed or not. Thanks for all the information!
OK, done. the last command just produces the following output:
In powerthesaurus--make-insert-callback: powerthesaurus.el:244:57: Warning: Unused lexical argument `query-type'
In powerthesaurus--with-term-id: powerthesaurus.el:452:62: Warning: Unused lexical argument `sync'
In powerthesaurus--query-definition: powerthesaurus.el:494:71: Warning: Unused lexical argument `type'
In powerthesaurus--query-sentence: powerthesaurus.el:509:69: Warning: Unused lexical argument `type'
In powerthesaurus--query-impl: powerthesaurus.el:551:38: Warning: reference to free variable ‘url-http-end-of-headers’
In powerthesaurus-lookup-word-dwim: powerthesaurus.el:594:10: Warning: ‘powerthesaurus-lookup-word’ is an obsolete function (as of 0.2.0); use ‘powerthesaurus-lookup’ instead. powerthesaurus.el:592:12: Warning: ‘powerthesaurus-lookup-word-at-point’ is an obsolete function (as of 0.2.0); use ‘powerthesaurus-lookup’ instead. powerthesaurus.el:592:12: Warning: ‘powerthesaurus-lookup-word’ is an obsolete function (as of 0.2.0); use ‘powerthesaurus-lookup’ instead. powerthesaurus.el:701:10: Warning: docstring wider than 80 characters powerthesaurus.el:696:10: Warning: docstring wider than 80 characters powerthesaurus.el:697:10: Warning: docstring wider than 80 characters powerthesaurus.el:698:10: Warning: docstring wider than 80 characters powerthesaurus.el:699:10: Warning: docstring wider than 80 characters
but then when I evaluate (require 'powerthesaurus) I get:
Warning (comp): powerthesaurus.el:244:57: Warning: Unused lexical argument query-type' Disable showing Disable logging Warning (comp): powerthesaurus.el:356:20: Warning: Unknown slot ‘text’ Disable showing Disable logging Warning (comp): powerthesaurus.el:362:54: Warning: Unknown slot ‘text’ Disable showing Disable logging Warning (comp): powerthesaurus.el:367:19: Warning: Unknown slot ‘rating’ Disable showing Disable logging Warning (comp): powerthesaurus.el:388:23: Warning: Unused lexical variable
ivy-sort-functions-alist' Disable showing Disable logging
Warning (comp): powerthesaurus.el:398:63: Warning: Unused lexical variable ivy--display-transformers-alist' Disable showing Disable logging Warning (comp): powerthesaurus.el:447:4: Warning: reference to free variable ‘powerthesaurus--search-query’ Disable showing Disable logging Warning (comp): powerthesaurus.el:452:62: Warning: Unused lexical argument
sync' Disable showing Disable logging
Warning (comp): powerthesaurus.el:477:6: Warning: reference to free variable ‘powerthesaurus--thesaurus-query’ Disable showing Disable logging
Warning (comp): powerthesaurus.el:494:71: Warning: Unused lexical argument type' Disable showing Disable logging Warning (comp): powerthesaurus.el:504:6: Warning: reference to free variable ‘powerthesaurus--definition-query’ Disable showing Disable logging Warning (comp): powerthesaurus.el:509:69: Warning: Unused lexical argument
type' Disable showing Disable logging
Warning (comp): powerthesaurus.el:519:6: Warning: reference to free variable ‘powerthesaurus--sentence-query’ Disable showing Disable logging
Warning (comp): powerthesaurus.el:551:38: Warning: reference to free variable ‘url-http-end-of-headers’ Disable showing Disable logging
Warning (comp): powerthesaurus.el:685:1: Warning: ‘"s"’ is a malformed function Disable showing Disable logging
Warning (comp): powerthesaurus.el:685:1: Warning: ‘"a"’ is a malformed function Disable showing Disable logging
Warning (comp): powerthesaurus.el:685:1: Warning: ‘"r"’ is a malformed function Disable showing Disable logging
Warning (comp): powerthesaurus.el:685:1: Warning: ‘"d"’ is a malformed function Disable showing Disable logging
Warning (comp): powerthesaurus.el:685:1: Warning: ‘"e"’ is a malformed function Disable showing Disable logging
Warning (comp): powerthesaurus.el:685:1: Warning: ‘"q"’ is a malformed function Disable showing Disable logging
Warning (comp): powerthesaurus.el:686:13: Warning: reference to free variable ‘powerthesaurus-hydra’ Disable showing Disable logging
Warning (comp): powerthesaurus.el:686:13: Warning: ‘:color’ called as a function Disable showing Disable logging
Warning (comp): powerthesaurus.el:686:42: Warning: reference to free variable ‘blue’ Disable showing Disable logging
Warning (comp): powerthesaurus.el:696:10: Warning: reference to free variable ‘powerthesaurus-lookup-synonyms-dwim’ Disable showing Disable logging
Warning (comp): powerthesaurus.el:697:10: Warning: reference to free variable ‘powerthesaurus-lookup-antonyms-dwim’ Disable showing Disable logging
Warning (comp): powerthesaurus.el:698:10: Warning: reference to free variable ‘powerthesaurus-lookup-related-dwim’ Disable showing Disable logging
Warning (comp): powerthesaurus.el:699:10: Warning: reference to free variable ‘powerthesaurus-lookup-definitions-dwim’ Disable showing Disable logging
Warning (comp): powerthesaurus.el:700:10: Warning: reference to free variable ‘powerthesaurus-lookup-sentences-dwim’ Disable showing Disable logging
Warning (comp): powerthesaurus.el:704:28: Warning: reference to free variable ‘powerthesaurus-transient’ Disable showing Disable logging
Warning (comp): powerthesaurus.el:704:4: Warning: the function ‘transient-define-prefix’ is not known to be defined. Disable showing Disable logging
Warning (comp): powerthesaurus.el:686:35: Warning: the function ‘:color’ is not known to be defined. Disable showing Disable logging
Warning (comp): powerthesaurus.el:686:4: Warning: the function ‘defhydra’ is not known to be defined. Disable showing Disable logging
I'm using Emacs 28.2 and hydra-20220910.1206
Ok good, these warnings are coming from byte-compilation itself. However, we configured the byte code to include debug symbols, so that the top line of the backtrace from your screenshot has more information.
Can you please toggle debug and execute (require 'powerthesaurus)
to see a more detailed backtrace. Many thanks for jumping the hoops with me, I really appreciate it!
Can you specify what you want me to do in more detail? I've done what I think you want but am getting no backtrace.
Sorry for confusion.
If you call toggle-debug-on-error
, it toggles on a global debug mode. After that, whenever you get any type of error (like command-execute: Symbol’s value as variable is void: powerthesaurus-hydra
), the lisp interpreter will stop and call the debugger in the code where the error had been thrown. As part of it, it will show you a backtrace for that event.
You did it once, when you got that screenshot, but it didn't have the full information to understand it because the error happens in the byte compiled code. So, that other bit is to recompile powerthesaurus with debug symbols.
(setq byte-compile-debug t) (byte-compile-file "path/to/powerthesaurus.el")
After that if you reproduce the issue, and have debug on error toggled, it should show a bit more detailed backtrace.
I hope it's a bit more clear this time 😔
OK, I've done that a few times now and the contents of the debugger is in the attached file backtrace.txt
I think I understand the problem now. When we byte compile, it still tries to expand defhydra
macro without checking the condition (why should it?) and that causes the problem.
Huge thanks!
No problem - glad to be of help!
Hopefully, the version 0.3.5
should help 🤞
With the latest update when I press meta-# to initiate the process I get the following error:
command-execute: Symbol’s value as variable is void: powerthesaurus-hydra
I have set toggle-debug-on-error to t but no additional output occurs.