emacs-devel
[Top][All Lists]
Advanced

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

Re: master 8f28a1b: Tweak `condition-case' keyword highlights


From: Lars Ingebrigtsen
Subject: Re: master 8f28a1b: Tweak `condition-case' keyword highlights
Date: Sun, 24 Jan 2021 22:45:25 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

Stefan Monnier <monnier@iro.umontreal.ca> writes:

>> +(ert-deftest test-elisp-font-keywords-5 ()
>> +  (should (eq (test--font '(condition-case (when a)
>> +                               (foo)
>> +                             (error t))
>> +                          "(\\(when\\)")
>> +              nil)))
>
> 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?

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no



reply via email to

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