all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Tassilo Horn <tsdh@gnu.org>
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: help-gnu-emacs@gnu.org, emacs-devel@gnu.org
Subject: Re: Bug in Elisp font-locking
Date: Fri, 20 Mar 2015 19:47:13 +0100	[thread overview]
Message-ID: <878uersdzi.fsf@gnu.org> (raw)
In-Reply-To: <jwvpp83wpdl.fsf-monnier+gmane.emacs.help@gnu.org> (Stefan Monnier's message of "Fri, 20 Mar 2015 13:31:26 -0400")

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

>>>> (defun lh/gen-predicate (label)
>>>> (defalias (intern (concat "lh/" label "-p"))
>>>             ^^^^^^
>>> In this case intern should not be highlighted, isn't it ?.
>
> Indeed.
>
>>   (defstruct struct-name ...)
>>   (defstruct (struct-name OPTIONS) ...)
>
> Also for defun in Common-Lisp, there's (defun (setf foo) ...) where
> the "setf" probably shouldn't be highlighted but the "foo" should.

The `setf' should be highlighted as a macro but not as function name as
it is right now.

>> Cc-ing emacs-devel to ask if that's ok to commit.
>
> Could explain what the patch does?

Instead of skipping over whitespace and opening parens between the
definition macro/function and the defined thing's name, it skips only
over whitespace but captures an optional opening paren.  If there's one,
then we don't font-lock with `font-lock-function-name-face'.

The valid cases where the definition macro/function defines a type like
in `cl-defstruct' still highlights the symbol after the paren (but in
`font-lock-type-face').

Or in simpler words: if the name appears after an opening paren, that
cannot be a function name so don't font-lock as such.

Bye,
Tassilo



  parent reply	other threads:[~2015-03-20 18:47 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-19  6:53 Concern around use of eval Les Harris
2015-03-19  8:00 ` Tassilo Horn
     [not found] ` <mailman.2302.1426752018.31049.help-gnu-emacs@gnu.org>
2015-03-19  8:12   ` Joost Kremers
2015-03-19  8:31     ` Tassilo Horn
     [not found]     ` <mailman.2305.1426753885.31049.help-gnu-emacs@gnu.org>
2015-03-20 19:54       ` Joost Kremers
2015-03-19 14:07 ` Stefan Monnier
2015-03-20 15:17   ` Thierry Volpiatto
2015-03-20 17:19     ` Bug in Elisp font-locking (was: Concern around use of eval) Tassilo Horn
2015-03-20 17:31       ` Bug in Elisp font-locking Stefan Monnier
2015-03-20 17:43         ` Drew Adams
2015-03-20 18:47         ` Tassilo Horn [this message]
2015-03-20 20:38           ` Stefan Monnier
2015-03-20 22:45             ` Tassilo Horn
2015-03-21  0:06               ` Johan Bockgård
2015-03-21  7:26                 ` Tassilo Horn
2015-03-21  2:33               ` Stefan Monnier
2015-03-21  7:55                 ` Tassilo Horn

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

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=878uersdzi.fsf@gnu.org \
    --to=tsdh@gnu.org \
    --cc=emacs-devel@gnu.org \
    --cc=help-gnu-emacs@gnu.org \
    --cc=monnier@iro.umontreal.ca \
    /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 external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.