unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@iro.umontreal.ca>
To: emacs-devel@gnu.org
Subject: Re: forward-sexp when on a floating point number
Date: Mon, 18 Jan 2016 08:30:27 -0500	[thread overview]
Message-ID: <jwv1t9fgh4e.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <m2lh7n8ofl.fsf@newartisans.com> (John Wiegley's message of "Sun,  17 Jan 2016 21:08:30 -0800")

>> Lexing via FSM is "standard" in the world of computer languages, so I'm
>> pretty sure it'd be good/useful to add such functionality to Emacs's core.
> If it can provide identical behavior, simpler and more efficiently, I'm happy
> to swap out what we have in core.

My suggestion is to *extend* syntax-table, such that (aref
<syntax-table> <char>) can return another syntax-table (IOW another
state in the FSM, because the char we just considered is part of a token
but that token isn't complete yet).

Major modes could use it or not.

> Yes, we control core, but that doesn't mean it should be the first place we
> look to make changes when brewing new ideas.

I largely agree.  The main reason why it didn't turn out that way for
many of the features I added is that I wanted to make use of them, and
since most of the packages I work on (and use) are in core, I couldn't
make use of those new features in them until that new feature is
in core.

It's also part of the motivation to try and bring GNU ELPA and core
closer together (either by exporting core packages to GNU ELPA like we
have now, or by including GNU ELPA packages into core like we want to
do but still haven't done).


        Stefan


PS: Lexing via FSM is harder than I make it out to be, of course, since
multi-char tokens introduce the question of how to figure out with which
state to start lexing (e.g. if we start a command from the middle of
a token), as well as how to "tokenize backward" ("single-char tokens"
(like we have now) can trivially be parsed with the same FSM going
forward and backward, but that's not true for the more general case).


        Stefan



  reply	other threads:[~2016-01-18 13:30 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-12 10:42 forward-sexp when on a floating point number Oleh Krehel
2016-01-12 13:58 ` Herring, Davis
2016-01-12 14:20 ` Andreas Schwab
2016-01-12 14:41   ` Oleh Krehel
2016-01-12 17:35 ` John Wiegley
2016-01-12 17:45 ` Dmitry Gutov
2016-01-17 23:07 ` Stefan Monnier
2016-01-17 23:42   ` John Wiegley
2016-01-18  1:36     ` Stefan Monnier
2016-01-18  5:08       ` John Wiegley
2016-01-18 13:30         ` Stefan Monnier [this message]
2016-01-18 19:02           ` John Wiegley
2016-01-18 21:03           ` Marcin Borkowski
2016-01-18 21:34             ` Stefan Monnier
2016-01-20 22:15               ` Marcin Borkowski

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=jwv1t9fgh4e.fsf-monnier+emacs@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --cc=emacs-devel@gnu.org \
    /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).