unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* multi-character syntactic entities in syntax tables
@ 2013-04-26 17:28 Erik Charlebois
  2013-04-26 18:53 ` Dmitry Gutov
  2013-04-26 19:26 ` Stefan Monnier
  0 siblings, 2 replies; 7+ messages in thread
From: Erik Charlebois @ 2013-04-26 17:28 UTC (permalink / raw)
  To: emacs-devel

[-- Attachment #1: Type: text/plain, Size: 1033 bytes --]

One of the items in etc/TODO is:

** Beefed-up syntax-tables.
*** recognize multi-character syntactic entities like `begin' and `end'.

Lately I'm using languages where this would be quite useful and would be
interested in adding support. Before I dive in, are there any strong
opinions about how this should be implemented?

The approach I was thinking of taking is defining a new syntax character
class (let's say, *) which inherits from the previous character
(recursively if the previous character is *). The important distinction is
that they would not be treated as a new instance of that syntax class, so
point movement by syntax class or paren matching would work (e.g. begin
would be (****, and would only add 1 level of paren nesting).

A mode would use a syntax-propertize-function to tag keywords with
appropriate text properties. So something like Ruby:

class Foo
  def Bar
    if condition
      ...
    end
  end
end

would have syntax classes like:

(**** www
  (** www
    (* wwwwwwwww
       ...
    )**
  )**
)**

[-- Attachment #2: Type: text/html, Size: 1637 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2013-04-27  4:15 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-04-26 17:28 multi-character syntactic entities in syntax tables Erik Charlebois
2013-04-26 18:53 ` Dmitry Gutov
2013-04-26 19:22   ` Erik Charlebois
2013-04-26 20:57     ` Dmitry Gutov
2013-04-26 19:26 ` Stefan Monnier
2013-04-26 21:37   ` Erik Charlebois
2013-04-27  4:15     ` Stefan Monnier

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).