all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Vitalie Spinu <spinuvit@gmail.com>
To: Alan Mackenzie <acm@muc.de>
Cc: "Andreas Röhler" <andreas.roehler@online.de>,
	emacs-devel@gnu.org, "Stefan Monnier" <monnier@iro.umontreal.ca>,
	"Dmitry Gutov" <dgutov@yandex.ru>, "Eli Zaretskii" <eliz@gnu.org>,
	"Drew Adams" <drew.adams@oracle.com>
Subject: Re: A vision for multiple major modes [was: Re: [Emacs-diffs] widen-limits c331b66:]
Date: Thu, 24 Mar 2016 21:22:28 +0100	[thread overview]
Message-ID: <87shzffwxn.fsf@gmail.com> (raw)
In-Reply-To: <20160324183835.GB2721@acm.fritz.box> (Alan Mackenzie's message of "Thu, 24 Mar 2016 18:38:35 +0000")


>> On Thu, Mar 24 2016 18:38, Alan Mackenzie wrote:

>> For instance, you said that there could be island-local variables. Can I 
>> put some cache into one?

> I can't see why not.

Not sure why would you need island local variables but sub-mode local variables
are very meaningful. For instance, polymode gives each submode its own indirect
buffer. So all those critical variables that you mentioned are already sub-mode
local and independent between sub-modes. Polymode never bothers with thing like
syntax-tables, font-lock keywords and most of other buffer local vars.

> The island-local variables would stay with the island, so that when somebody
> inserts or removes text the right thing would be done.  If somebody deletes
> the island, those variables would disappear (just as buffer local ones do when
> a buffer is deleted).

Are islands of same mode connected in any way? If you delete one char of a chunk
head, the island disappears. You type it back and the islands re-appears. Is
this a new island? Or is it the same old one? Are local variables from old
island preserved or not?

This stuff is stuffy. If you are so excited about your general proposal, then
why not give it a try and implement a proof of concept - a new multi-mode
engine?

> What is "(narrow-to-region 1 (point-max))" going to become?  

Out-of-range error. Unless a mode is already smart enough to use (point-min) it
will have to learn that the hard way.

> I'm worried that the multi-mode projects will suborn these
> text properties, making them unavailable for major modes to use.

Not if there will be special "whitespace-begin/end" syntax class designed for
multitudes only. But that work won't be complete without tackling regexp
search. Your idea of "whitespacing" the regexp search might be handy but it's
probably a lot of complex work with long list of problems which no-one has ever
seen before.

For instance a lot of searches are user level and must be on the whole
buffer. So you will need to differentiate between sub-mode search/replace and
user search/replace. Then you need to define the semantics of matching or
replacing on the boundaries. What if a mode wants to replace a regexp that
starts in one chunk and ends in another? More generally, you will need to decide
if the mode is allowed to manipulate regions that start in one of its chunks and
end in another of its chunks. And if so with what semantics. Etc. etc.

Restricting a sub-mode to it's own bubble within a single span is a much simpler
implementation and is quite well understood by now. In so many years no-one came
across with a better idea than widen/narrow. AFAIK this situation is unlikely to
change in the foreseeable future.

  Vitalie



  reply	other threads:[~2016-03-24 20:22 UTC|newest]

Thread overview: 62+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20160322022539.16038.77264@vcs.savannah.gnu.org>
     [not found] ` <E1aiC0q-0004DL-40@vcs.savannah.gnu.org>
2016-03-22 12:08   ` [Emacs-diffs] widen-limits c331b66: Implement buffer-widen-limits functionality Stefan Monnier
2016-03-22 19:44     ` Vitalie Spinu
2016-03-22 19:56       ` Drew Adams
2016-03-22 22:42         ` Vitalie Spinu
2016-03-23  0:44           ` Drew Adams
2016-03-23  7:16             ` Andreas Röhler
2016-03-23 11:58               ` Vitalie Spinu
2016-03-23 13:02                 ` Andreas Röhler
2016-03-23 14:17                   ` Vitalie Spinu
2016-03-23 15:34                     ` Eli Zaretskii
2016-03-23 17:24                       ` Andreas Röhler
2016-03-23 17:55                         ` Eli Zaretskii
2016-03-23 18:53                           ` Andreas Röhler
2016-03-23 21:57                             ` Drew Adams
2016-03-23 22:13                               ` Vitalie Spinu
2016-03-23 23:03                                 ` Drew Adams
2016-03-24  3:38                                 ` Eli Zaretskii
2016-03-24 12:24                                   ` Dmitry Gutov
2016-03-24 15:56                                     ` Eli Zaretskii
2016-03-24 18:55                                       ` Removing prog-indentation-context (was: [Emacs-diffs] widen-limits c331b66: Implement buffer-widen-limits functionality) Stefan Monnier
2016-03-25  0:53                                         ` Removing prog-indentation-context Dmitry Gutov
2016-03-25  1:29                                           ` Dmitry Gutov
2016-03-25  2:09                                           ` Stefan Monnier
2016-03-25 11:38                                             ` Dmitry Gutov
2016-03-26 22:29                                               ` John Wiegley
2016-03-28  1:03                                                 ` Dmitry Gutov
2016-03-25 15:45                                           ` Vitalie Spinu
2016-03-28 21:37                                             ` Dmitry Gutov
2016-03-28 22:08                                               ` Stefan Monnier
2016-03-28 22:55                                                 ` Dmitry Gutov
2016-03-28 23:24                                                   ` Stefan Monnier
2016-03-28  1:03                                       ` [Emacs-diffs] widen-limits c331b66: Implement buffer-widen-limits functionality Dmitry Gutov
2016-03-24  3:37                               ` Eli Zaretskii
2016-03-23 17:14                     ` Andreas Röhler
2016-03-24  0:03                       ` Vitalie Spinu
2016-03-24  0:37                         ` Drew Adams
2016-03-24  2:36                           ` Vitalie Spinu
2016-03-24 13:53                             ` Drew Adams
2016-03-24 13:57                               ` Dmitry Gutov
2016-03-24 14:31                                 ` Drew Adams
2016-03-24 14:56                                   ` Stefan Monnier
2016-03-24 15:13                                     ` Drew Adams
2016-03-24 15:20                                       ` Stefan Monnier
2016-03-24  7:00                         ` Andreas Röhler
2016-03-23 14:29                 ` Drew Adams
2016-03-23 21:16                 ` A vision for multiple major modes [was: Re: [Emacs-diffs] widen-limits c331b66:] Alan Mackenzie
2016-03-23 21:58                   ` Vitalie Spinu
2016-03-24 17:44                     ` Alan Mackenzie
2016-03-24 20:43                       ` Vitalie Spinu
2016-03-23 22:34                   ` Dmitry Gutov
2016-03-24 18:38                     ` Alan Mackenzie
2016-03-24 20:22                       ` Vitalie Spinu [this message]
2016-03-25  0:11                       ` Dmitry Gutov
2016-03-27 12:09                         ` Alan Mackenzie
2016-03-27 22:59                           ` Dmitry Gutov
2016-03-29  0:07                             ` Alan Mackenzie
2016-04-01  1:15                               ` Dmitry Gutov
2016-04-05 16:29                                 ` Alan Mackenzie
2016-04-05 22:52                                   ` Dmitry Gutov
2016-04-18 21:32                                     ` Alan Mackenzie
2016-03-28 13:00                       ` Filipp Gunbin
2016-03-25 18:20                   ` Phillip Lord

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

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87shzffwxn.fsf@gmail.com \
    --to=spinuvit@gmail.com \
    --cc=acm@muc.de \
    --cc=andreas.roehler@online.de \
    --cc=dgutov@yandex.ru \
    --cc=drew.adams@oracle.com \
    --cc=eliz@gnu.org \
    --cc=emacs-devel@gnu.org \
    --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 external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.