From: Stefan Monnier <monnier@iro.umontreal.ca>
To: emacs-devel@gnu.org
Subject: Re: emacs-lisp-mode highlights incorrectly defmacros/defuns’ arglists
Date: Tue, 16 Oct 2018 17:23:39 -0400 [thread overview]
Message-ID: <jwv36t51tbx.fsf-monnier+gmane.emacs.devel@gnu.org> (raw)
In-Reply-To: 87in21u6gu.fsf@portable.galex-713.eu
> 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)
prev parent reply other threads:[~2018-10-16 21:23 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-10-16 17:49 emacs-lisp-mode highlights incorrectly defmacros/defuns’ arglists Garreau, Alexandre
2018-10-16 18:35 ` Alan Mackenzie
2018-10-16 19:22 ` Garreau, Alexandre
2018-10-16 20:10 ` Alan Mackenzie
2018-10-16 20:12 ` Garreau, Alexandre
2018-10-16 21:23 ` Stefan Monnier [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=jwv36t51tbx.fsf-monnier+gmane.emacs.devel@gnu.org \
--to=monnier@iro.umontreal.ca \
--cc=emacs-devel@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).