From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Alan Mackenzie Newsgroups: gmane.emacs.devel Subject: Re: emacs-lisp-mode highlights =?utf-8?Q?i?= =?utf-8?Q?ncorrectly_defmacros=2Fdefuns=E2=80=99?= arglists Date: Tue, 16 Oct 2018 18:35:51 +0000 Message-ID: <20181016183551.GB5722@ACM> 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 1539715354 13026 195.159.176.226 (16 Oct 2018 18:42:34 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 16 Oct 2018 18:42:34 +0000 (UTC) User-Agent: Mutt/1.10.1 (2018-07-13) Cc: emacs-devel@gnu.org To: "Garreau, Alexandre" Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Oct 16 20:42: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 1gCUIY-0003KJ-73 for ged-emacs-devel@m.gmane.org; Tue, 16 Oct 2018 20:42:30 +0200 Original-Received: from localhost ([::1]:59738 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gCUKe-0002Qy-RN for ged-emacs-devel@m.gmane.org; Tue, 16 Oct 2018 14:44:40 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:50793) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gCUJq-0001eZ-Bm for emacs-devel@gnu.org; Tue, 16 Oct 2018 14:43:51 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gCUJk-00047t-AZ for emacs-devel@gnu.org; Tue, 16 Oct 2018 14:43:48 -0400 Original-Received: from colin.muc.de ([193.149.48.1]:55741 helo=mail.muc.de) by eggs.gnu.org with smtp (Exim 4.71) (envelope-from ) id 1gCUJj-00045x-TK for emacs-devel@gnu.org; Tue, 16 Oct 2018 14:43:44 -0400 Original-Received: (qmail 9400 invoked by uid 3782); 16 Oct 2018 18:43:41 -0000 Original-Received: from acm.muc.de (p5B14712A.dip0.t-ipconnect.de [91.20.113.42]) by colin.muc.de (tmda-ofmipd) with ESMTP; Tue, 16 Oct 2018 20:43:40 +0200 Original-Received: (qmail 10296 invoked by uid 1000); 16 Oct 2018 18:35:51 -0000 Content-Disposition: inline In-Reply-To: <87in21u6gu.fsf@portable.galex-713.eu> X-Delivery-Agent: TMDA/1.1.12 (Macallan) X-Primary-Address: acm@muc.de X-detected-operating-system: by eggs.gnu.org: FreeBSD 9.x [fuzzy] X-Received-From: 193.149.48.1 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:230419 Archived-At: Hello, Alexandre. On Tue, Oct 16, 2018 at 19:49:53 +0200, Garreau, Alexandre wrote: > 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? You surely are conscious of the fact that `cond' is a special form? To use it as an argument name is asking for trouble, surely. The font locking in emacs-lisp-mode appears not to be too sophisticated. But it is fast. > Wouldn’t there be a way to turn off these highlightings in such places > of known old and fixed macro calls? There might well be, but it would slow fontification down, somewhat. I suspect that changing "cond" to something less contentious will get the result you want. -- Alan Mackenzie (Nuremberg, Germany).