Subject: Re: bug#21681: [PATCH] Fix formatting of lexical-binding at eof warning

From: Noam Postavsky <[email-masked]>
Date: Sat, 31 Oct 2015 18:36:40 -0400

On Wed, Oct 14, 2015 at 1:47 PM, Noam Postavsky
<[email-masked]> wrote:
> On Wed, Oct 14, 2015 at 1:42 PM, Eli Zaretskii <[email-masked]> wrote:
>>> Date: Wed, 14 Oct 2015 12:56:28 -0400
>>> From: Noam Postavsky <[email-masked]>
>>> own, but display-warning only prints the 1st symbol of the list so the
>>> warning text itself wouldn't change.
>>
>> I find "files" no more explanatory that "warning".  If we lack
>> infrastructure to display meaningful messages that unequivocally point
>> to the nature of the problem, let's add the missing infrastructure.
>
> How about making display-warning print all TYPE symbols then?

I've been playing a bit more with display-warning, and I think the
part in brackets is not supposed to be part of the warning's
explanation, but rather it tells you how to block it. Like gcc's
"[-Wfoo]". The problem with printing all the symbols is that it would
make the warnings using TYPE lists longer, pushing the actual warning
text to the right, and discourage use of more specific TYPEs.

Another possiblity is still to truncate to a single item, but show a
"..." button to expand it, like `eval-last-sexp' does for long lists.

Another thing I've been experimenting with is including buttons with
an action to resolve the problem in the warning text. It seems to work
pretty well, except that because *Warnings* is in special-mode <tab>
isn't bound to forward-button. It could be nice to have a
warnings-mode which does that. It could also bind e.g. `i' to
something like ignore-warning-at-point (which would customize
warning-suppress-types). But I know Emacs supposed to be in feature
freeze so maybe now is not the time to be adding new modes.