bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#66979: Wrong number of arguments with completion-at-point


From: Stefan Monnier
Subject: bug#66979: Wrong number of arguments with completion-at-point
Date: Tue, 07 Nov 2023 15:13:53 -0500
User-agent: Gnus/5.13 (Gnus v5.13)

>>     commit f931cebce76d911dfc61274e0a8c1de3627b9179
>>     Author: Alan Mackenzie <acm@muc.de>
>>     Date:   Wed Sep 20 15:51:17 2023 +0000
>
>>     Insert symbol `debug' into two condition-case handlers
>     
>>     This fixes bug#65622.  Also correct a mismatch between a
>>     function to which advice is added, and that from which it is
>>     removed.
>     
>>     * lisp/emacs-lisp/macroexp.el (internal-macroexpand-for-load):
>>     Add a `debug' to the condition-case handler for `error', so
>>     that a useful backtrace will be produced on a macro expansion
>>     error.
>     
>>     * lisp/progmodes/elisp-mode.el (elisp--local-variables): Add
>>     `debug' to a condition-case handler, as above.  In the
>>     advice-remove call, give the same function, macroexpand-1, as
>>     in the corresponding advice-add call.
>
>> Alan do you remember why you also added the `debug` to the
>> condition-case in `elisp--local-variables`?
>> The rest of the commit looks right to me.
>
> I was trying to debug an error in eager macro expansion (i.e. macro
> expansion in forms called directly by read), and that was the
> condition-case that was suppressing the backtrace.

Really?  I'd expect this case to go through the `condition-case` that's
in `internal-macroexpand-for-load` but not the condition-case that's in
`elisp--local-variables`.

Any chance you can still reproduce the bug and get a backtrace showing
how `elisp--local-variables` gets involved?

>> Macro expansion errors in there are perfectly normal since
>> `elisp--local-variables` routinely passes incomplete code to
>> macroexpand.  IOW most errors signal'd in there probably don't need to
>> be debugged at all.
> But when somebody has set debug-on-error to t, they _want_ those errors
> signalled, surely?

No, I have it set and don't want to be told that the internal completion
machinery extracted broken code from the current buffer in its
best-effort attempt to compute the set of surrounding lexical variables.

In 99% of the cases, it is neither a bug in the code I'm editing nor in
the macros.  The design of `elisp--local-variables` is such that it
often builds syntactically invalid code to pass to the macro expander.


        Stefan






reply via email to

[Prev in Thread] Current Thread [Next in Thread]