From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: emacs-lisp-mode highlights incorrectly =?utf-8?Q?defmacros=2F?= =?utf-8?Q?defuns=E2=80=99?= arglists Date: Tue, 16 Oct 2018 17:23:39 -0400 Message-ID: References: <87in21u6gu.fsf@portable.galex-713.eu> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: blaine.gmane.org 1539724954 4494 195.159.176.226 (16 Oct 2018 21:22:34 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 16 Oct 2018 21:22:34 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Oct 16 23:22:30 2018 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gCWnN-00014r-LC for ged-emacs-devel@m.gmane.org; Tue, 16 Oct 2018 23:22:29 +0200 Original-Received: from localhost ([::1]:60274 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gCWpU-0006pk-5K for ged-emacs-devel@m.gmane.org; Tue, 16 Oct 2018 17:24:40 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:37735) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gCWol-0006UJ-16 for emacs-devel@gnu.org; Tue, 16 Oct 2018 17:23:55 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gCWog-0005fO-2M for emacs-devel@gnu.org; Tue, 16 Oct 2018 17:23:54 -0400 Original-Received: from [195.159.176.226] (port=35662 helo=blaine.gmane.org) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gCWof-0005dW-QY for emacs-devel@gnu.org; Tue, 16 Oct 2018 17:23:49 -0400 Original-Received: from list by blaine.gmane.org with local (Exim 4.84_2) (envelope-from ) id 1gCWmU-0008M9-OI for emacs-devel@gnu.org; Tue, 16 Oct 2018 23:21:34 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 32 Original-X-Complaints-To: usenet@blaine.gmane.org Cancel-Lock: sha1:MAOrJNmg167mGBU3V1F9xLPPgXI= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 195.159.176.226 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:230427 Archived-At: > 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)