emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: multi-character syntactic entities in syntax tables


From: Dmitry Gutov
Subject: Re: multi-character syntactic entities in syntax tables
Date: Sat, 27 Apr 2013 00:57:04 +0400
User-agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/20130328 Thunderbird/17.0.5

On 26.04.2013 23:22, Erik Charlebois wrote:
Off the top of my head, point motion (e.g. forward-word should skip the
entire word, not stop where the syntax class changes from "(" to "w")
and font locking (show-paren-mode should highlight the entire matching
words).

But `forward-word' will jump to the end of the next word then, since "begin" as a whole would have non-word syntax.

Since the matching keyword lengths can be different (begin vs end), my
understanding is I can't just turn them into ((((( and ))) because it
doesn't balance.

Yes, that's not what my suggestion was.

Currently I have some hacks for Ruby mode that makes the first
characters of the block keywords have "(" or ")" syntax class. It works
fine, aside from point motion and font locking.

I would've put ")" at the end of "end", but otherwise, that is it. I didn't expect it to work with current open/close parens syntax classes, though: "string quotes", in similar circumstances, doesn't.

The problem with font-lock is important. Maybe we need a syntax class that would mark text as symbol (or word) constituent (or delegate to the buffer syntax table), and at the same time mark them as parenthesising construct.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]