emacs-devel
[Top][All Lists]
Advanced

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

Re: emacs-lisp-mode highlights incorrectly defmacros/defuns’ arglists


From: Stefan Monnier
Subject: Re: emacs-lisp-mode highlights incorrectly defmacros/defuns’ arglists
Date: Tue, 16 Oct 2018 17:23:39 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux)

> At least *someone* must have *seen* this:
> #+BEGIN_SRC elisp
> (defmacro unless (cond &rest body)
>   "If COND yields nil, do BODY, else return nil.
> When COND yields nil, eval BODY forms sequentially and return
> value of last one, or nil if there are none.
>
> \(fn COND BODY...)"
>   (declare (indent 1) (debug t))
>   (cons 'if (cons cond (cons nil body))))
> #+END_SRC
>
> “cond” is highlighted in blue, while since defmacro (as well as defun,
> which present the same issue) is itself a macro, and the meaning of its
> arglist is known and fixed in lisp (a list of symbols, whose the first
> isn’t particularly meant to be called), why is cond highlighted just as
> if the arglist was a real form to be evaluated, while we know it’s not?

Because you haven't yet submitted the patch which will fix this.


        Stefan


PS: I've been annoyed by this in the case of arglist that start with
`function` rather than with `cond`, but never enough to start trying to
fix it.  Note there's another similar situation I encounter every once
in a while, which is:

   (cond
    (cond blabla)
    blibli)




reply via email to

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