unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Dmitry Gutov <dgutov@yandex.ru>
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: cyd@gnu.org, lennart.borgman@gmail.com, emacs-devel@gnu.org
Subject: Re: web-mode.el
Date: Wed, 20 Jun 2012 06:01:00 +0400	[thread overview]
Message-ID: <4FE12EDC.3080001@yandex.ru> (raw)
In-Reply-To: <jwvvcioypdd.fsf-monnier+emacs@gnu.org>

On 19.06.2012 7:09, Stefan Monnier wrote:
>> It occurs to me that, once the supported interface is established,
>> introducing new syntax-table value becomes not strictly necessary because,
>> for example, a version of Lennart's `with-chunks' macro can be implemented
>> in Lisp by applying whitespace or comment-starter/ender syntax to foreign
>> chunks around the body calls (idea from mmm-noweb).
>> Is that right?
>
> That's right as long as you're willing to dynamically modify the buffer
> (with syntax-table text-properties) every time you move from one chunk
> to another.

Or just every time I want to indent a line, instead. And if I always use 
`narrow-to-region' before performing indentation within a submode, the 
syntax-table text property (unless it's 'whitespace') isn't going to 
affect the result, so I might as well assign text properties only once 
when the buffer is parsed for chunks, "commenting out" the submodes.

> If you have many chunks, that can be a problem.  This can happen if you
> push the idea of multi-major-mode a bit further and consider for example
> that comments and strings are really "text-mode chunks" embedded in
> "some other mode chunks".

Yes, but what follows is defining the supported interface and patching 
existing packages becomes first priority, and implementing low-level 
support in C code - only second, which means more time to get the latter 
right.

For example, I'd like to see a use case for handling submode regions of 
the same mode as though they're contiguous (as oppsed to isolated), in 
the context of `syntax-ppss'. If there isn't, it might simplify the 
implementation.

On 19.06.2012 14:39, Lennart Borgman wrote:
 > My idea with (with-chunks chunk-table ...) that chunk-table contains
 > this information instead. Then it can be cashed by the multi major
 > mode framework.

You might want to consider how syntax-ppss cache works. Since 
text-property change in considered buffer modification, 
`syntax-ppss-flush-cache' will be called from `before-change-functions', 
invalidating the cache entries with positions after the edit position, 
and keeping the ones before it.
With your proposal, it would need to somehow keep track of the 
chunk-table, too.



  parent reply	other threads:[~2012-06-20  2:01 UTC|newest]

Thread overview: 48+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-06-14 14:24 web-mode.el Dmitry Gutov
2012-06-14 16:54 ` web-mode.el Lennart Borgman
2012-06-15  3:24   ` web-mode.el Dmitry Gutov
2012-06-16  1:43     ` web-mode.el Lennart Borgman
2012-06-16 13:19       ` web-mode.el Dmitry Gutov
2012-06-16 13:30         ` web-mode.el Lennart Borgman
2012-06-19  1:18           ` web-mode.el Dmitry Gutov
2012-06-19  1:56             ` web-mode.el Lennart Borgman
2012-06-19 16:04               ` web-mode.el Dmitry Gutov
2012-06-14 17:28 ` web-mode.el Stefan Monnier
2012-06-15  1:40   ` web-mode.el Dmitry Gutov
2012-06-16  6:17     ` web-mode.el Stefan Monnier
2012-06-16 10:55       ` web-mode.el Lennart Borgman
2012-06-16 13:27       ` web-mode.el Dmitry Gutov
2012-06-16 13:32         ` web-mode.el Lennart Borgman
2012-06-18  1:49         ` web-mode.el Stefan Monnier
2012-06-19  1:00           ` web-mode.el Dmitry Gutov
2012-06-19  3:09             ` web-mode.el Stefan Monnier
2012-06-19 10:39               ` web-mode.el Lennart Borgman
2012-06-20  2:01               ` Dmitry Gutov [this message]
2012-07-31  8:46                 ` web-mode.el Lennart Borgman
  -- strict thread matches above, loose matches on Subject: below --
2012-06-14  0:33 web-mode.el Dmitry Gutov
2012-06-14  1:49 ` web-mode.el Lennart Borgman
2012-06-14  2:13   ` web-mode.el Dmitry Gutov
2012-06-14  3:23 ` web-mode.el Stefan Monnier
2012-06-15  8:34   ` web-mode.el Vitalie Spinu
2012-06-15  9:23     ` web-mode.el Lennart Borgman
2012-06-15  9:41       ` web-mode.El Vitalie Spinu
2012-06-16  1:37         ` web-mode.El Lennart Borgman
2012-06-11 22:24 web-mode.el Bois Francois-Xavier
2012-06-12 11:37 ` web-mode.el Lennart Borgman
2012-06-12 13:23   ` web-mode.el Bois Francois-Xavier
     [not found]   ` <CAK1xyPN=7To8ZsznHdjhDO=pd_8MocAqWXzSSrFJNe=uHRwp9g@mail.gmail.com>
2012-06-12 13:24     ` web-mode.el Lennart Borgman
2012-06-12 13:45       ` web-mode.el Bois Francois-Xavier
2012-06-13  7:45 ` web-mode.el Chong Yidong
2012-06-13  8:39   ` web-mode.el Bois Francois-Xavier
2012-07-31  8:41     ` web-mode.el Steinar Bang
2012-06-13 10:36   ` web-mode.el Lennart Borgman
2012-06-13 10:49     ` web-mode.el Bois Francois-Xavier
2012-06-13 10:55       ` web-mode.el Lennart Borgman
2012-06-13 11:43         ` web-mode.el Bois Francois-Xavier
2012-06-13 11:52           ` web-mode.el Lennart Borgman
2012-06-13 12:30     ` web-mode.el Stefan Monnier
2012-06-13 12:37       ` web-mode.el Lennart Borgman
2012-06-13 10:37   ` web-mode.el Dmitry Gutov
2012-06-13 10:46     ` web-mode.el Lennart Borgman
2012-06-13 10:26 ` web-mode.el Dmitry Gutov
2012-06-13 14:18 ` web-mode.el Richard Riley

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=4FE12EDC.3080001@yandex.ru \
    --to=dgutov@yandex.ru \
    --cc=cyd@gnu.org \
    --cc=emacs-devel@gnu.org \
    --cc=lennart.borgman@gmail.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 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).