all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Dmitry Gutov <dgutov@yandex.ru>
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: 15874@debbugs.gnu.org, Bozhidar Batsov <bozhidar@batsov.com>
Subject: bug#15874: 24.3.50; exit! not properly font-locked in ruby-mode
Date: Thu, 05 Dec 2013 05:42:19 +0200	[thread overview]
Message-ID: <529FF61B.4060709@yandex.ru> (raw)
In-Reply-To: <jwviov4f1y6.fsf-monnier+emacsbugs@gnu.org>

On 05.12.2013 04:50, Stefan Monnier wrote:
> Maybe a good way to handle them is via syntax-propertize,

Huh yes, that's an approach I haven't considered. But it seems more 
performance-intensive than the other options, at least as long as Emacs 
regexps don't support lookbehind.

If we could match "non-symbols", then the font-lock part of the problem 
would be solved, and appending "?" or "!" in the forward-token and 
backward-token functions would take negligible amount of time.

Say, why don't we have a "non-symbol" matcher? I would think that in 
many cases the regexp engine performs unnecessary work when it sees 
"\\_<" or "\\_>" because we often know in advance that the character 
we've already matched, or will have to match next, is a symbol 
constituent. But the engine has to check.

Most uses of `(regexp-opt '("boats" "boats" "boats") 'symbols)' would 
fall under this scenario.

 > then, especially
> if we can come up with a good regexp that distinguishes "method name"
> from "local variable name"?

Not really. References to local variables, unlike instance and global 
ones, are indistinguishable from method calls if we judge only by name.

We could backtrack until the beginning of block or method, look for 
assignments, etc, but that's a lot of work for marginal gain: we can 
just assume that each such reference is a method calls, because 
otherwise it would be syntax error.






  reply	other threads:[~2013-12-05  3:42 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-12 12:38 bug#15874: 24.3.50; exit! not properly font-locked in ruby-mode Bozhidar Batsov
2013-12-04 18:31 ` Dmitry Gutov
2013-12-04 19:20   ` Stefan Monnier
2013-12-04 22:33     ` Dmitry Gutov
2013-12-04 23:15     ` Dmitry Gutov
2013-12-05  2:50       ` Stefan Monnier
2013-12-05  3:42         ` Dmitry Gutov [this message]
2013-12-05 19:02           ` Stefan Monnier
2013-12-06  2:44             ` Dmitry Gutov
2013-12-06  4:57               ` Stefan Monnier
2013-12-06  4:23             ` Dmitry Gutov
2013-12-05  6:34   ` Kevin Rodgers
2013-12-05 10:58     ` Dmitry Gutov
2013-12-05 14:50       ` Kevin Rodgers
2013-12-05 17:25         ` Dmitry Gutov

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=529FF61B.4060709@yandex.ru \
    --to=dgutov@yandex.ru \
    --cc=15874@debbugs.gnu.org \
    --cc=bozhidar@batsov.com \
    --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.