unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Drew Adams <drew.adams@oracle.com>
To: Lars Ingebrigtsen <larsi@gnus.org>,
	Stefan Monnier <monnier@iro.umontreal.ca>
Cc: "emacs-devel@gnu.org" <emacs-devel@gnu.org>
Subject: RE: [External] : Re: master 8f28a1b: Tweak `condition-case' keyword highlights
Date: Sun, 24 Jan 2021 22:07:36 +0000	[thread overview]
Message-ID: <SA2PR10MB44745BC7C3DFC3FD2D7D439CF3BE9@SA2PR10MB4474.namprd10.prod.outlook.com> (raw)
In-Reply-To: <87o8heovpm.fsf@gnus.org>

> > FWIW, I'd be just as happy if `when` were highlighted with a keyword
> > face in this case: it's invalid code anyway, so the only highlighting
> > that would actually be helpful is one with some kind of error/warning
> > face, but I think it's best to leave it to `flymake-mode` to do that for
> > us.
> 
> Sure, I just wanted to tighten the check in that function to the actual
> form it was checking, instead of including the VAR form, too.  Nobody
> would actually write something like that.
> 
> But speaking of other code that's mis-highlighted still:
> 
> (defun a (when b c)
>   ...)
> 
> (The `when' isn't a keyword here, but it's font-locked as such.)
> 
> Couldn't we just use `edebug-form-spec' to notice that the arglist isn't
> a funcall position?  That would get a huge number of macros/special
> forms with non-funcall positions right...
> `lisp--el-non-funcall-position-p' would have to parse that, though,
> which might slow things down?

Indeed, such names shouldn't be highlighted when they
don't appear to be used for their defined behavior.

https://debbugs.gnu.org/cgi/bugreport.cgi?bug=43265#42

It hurts, more than helps, to highlight a defined name
everywhere.

Yes, it might be non-trivial/problematic to correctly
detect normal uses, but at least some first-level
approximation might be helpful.  Blanket highlighting
of such names can be "considered harmful".

https://en.wikipedia.org/wiki/Considered_harmful




  reply	other threads:[~2021-01-24 22:07 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20210124203118.16450.28084@vcs0.savannah.gnu.org>
     [not found] ` <20210124203120.0ABC320AD1@vcs0.savannah.gnu.org>
2021-01-24 21:32   ` master 8f28a1b: Tweak `condition-case' keyword highlights Stefan Monnier
2021-01-24 21:45     ` Lars Ingebrigtsen
2021-01-24 22:07       ` Drew Adams [this message]
2021-01-24 22:50       ` Lars Ingebrigtsen
2021-01-24 23:10       ` Stefan Monnier
2021-01-26  0:25         ` Lars Ingebrigtsen

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=SA2PR10MB44745BC7C3DFC3FD2D7D439CF3BE9@SA2PR10MB4474.namprd10.prod.outlook.com \
    --to=drew.adams@oracle.com \
    --cc=emacs-devel@gnu.org \
    --cc=larsi@gnus.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 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).