[Top][All Lists]

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

Re: /srv/bzr/emacs/trunk r101338: * lisp/emacs-lisp/syntax.el (syntax-pp

From: Dmitry Gutov
Subject: Re: /srv/bzr/emacs/trunk r101338: * lisp/emacs-lisp/syntax.el (syntax-ppss): More sanity check to catch
Date: Sun, 16 Feb 2014 04:01:20 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.2.0

On 14.02.2014 19:08, Stefan Monnier wrote:
Last time I checked, web-mode wasn't in this category: it's a major mode
with explicit support for some templating languages.

That's right, it doesn't try to handle major modes generically, but it
does have to solve similar problems, just with the benefit of being able
to custom-make its major modes.

I'm not sure what you mean. web-mode has only one major mode, and its support of multiple template engines looks like this in the code:

(defun web-mode-scan-blocks (reg-beg reg-end)
         ((string= web-mode-engine "php")
         ((string= web-mode-engine "django")
         ((string= web-mode-engine "erb")

and so on.

mmm-mode would require a hunt for CA signatures, but it's not outside the
realm of possibility.

The way I see it rather is to start over from scratch, based on the
experience gained with mmm-mode, but with a different view: instead of
trying to make it work without changing existing modes, assume that
the major modes will be changed to fit the framework.

The result should be much simpler/cleaner/shorter.

The implementation of region classes definitions and parsing of the buffer could still be reused with this approach. Although, if the goal is to parse the buffer lazily, maybe adapting the relevant multi-mode code instead would be easier.

I tend to assume that mode switches shouldn't be that super frequent to
be a real performance problem, and that if they need to be sped up,
there are ways to do that, e.g. by providing a few "subr", so I'm not
too worried about it.


reply via email to

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