[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: [External] : Re: master 8f28a1b: Tweak `condition-case' keyword high
From: |
Drew Adams |
Subject: |
RE: [External] : Re: master 8f28a1b: Tweak `condition-case' keyword highlights |
Date: |
Sun, 24 Jan 2021 22:07:36 +0000 |
> > FWIW, I'd be just as happy if `when` were highlighted with a keyword
> > face in this case: it's invalid code anyway, so the only highlighting
> > that would actually be helpful is one with some kind of error/warning
> > face, but I think it's best to leave it to `flymake-mode` to do that for
> > us.
>
> Sure, I just wanted to tighten the check in that function to the actual
> form it was checking, instead of including the VAR form, too. Nobody
> would actually write something like that.
>
> But speaking of other code that's mis-highlighted still:
>
> (defun a (when b c)
> ...)
>
> (The `when' isn't a keyword here, but it's font-locked as such.)
>
> Couldn't we just use `edebug-form-spec' to notice that the arglist isn't
> a funcall position? That would get a huge number of macros/special
> forms with non-funcall positions right...
> `lisp--el-non-funcall-position-p' would have to parse that, though,
> which might slow things down?
Indeed, such names shouldn't be highlighted when they
don't appear to be used for their defined behavior.
https://debbugs.gnu.org/cgi/bugreport.cgi?bug=43265#42
It hurts, more than helps, to highlight a defined name
everywhere.
Yes, it might be non-trivial/problematic to correctly
detect normal uses, but at least some first-level
approximation might be helpful. Blanket highlighting
of such names can be "considered harmful".
https://en.wikipedia.org/wiki/Considered_harmful