From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Alan Mackenzie Newsgroups: gmane.emacs.devel Subject: CC Mode in MMM Mode(s). [Was: Re: [Emacs-diffs] scratch/widen-less a4ba846: Replace prog-widen with consolidating widen calls] Date: Tue, 5 Dec 2017 19:01:41 +0000 Message-ID: <20171205190141.GA4745@ACM> References: <83d13x1j2s.fsf@gnu.org> <34abea95-c7f7-e8fa-8407-8c2fd2a4cfe1@yandex.ru> <83y3mkzw1n.fsf@gnu.org> <83mv2zzv7z.fsf@gnu.org> <643908a3-bec8-3ac1-38f7-4e73611478ef@yandex.ru> <20171203185946.GC5531@ACM> <20171204155238.GA5101@ACM> <9beb1b6c-7c37-da28-3451-3c2a440f309b@yandex.ru> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: blaine.gmane.org 1512500924 1723 195.159.176.226 (5 Dec 2017 19:08:44 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 5 Dec 2017 19:08:44 +0000 (UTC) User-Agent: Mutt/1.7.2 (2016-11-26) Cc: Eli Zaretskii , tom@tromey.com, monnier@iro.umontreal.ca, spinuvit@gmail.com, emacs-devel@gnu.org To: Dmitry Gutov Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Dec 05 20:08:40 2017 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eMIa7-0000Dz-Gx for ged-emacs-devel@m.gmane.org; Tue, 05 Dec 2017 20:08:39 +0100 Original-Received: from localhost ([::1]:51661 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eMIaE-0003hA-KJ for ged-emacs-devel@m.gmane.org; Tue, 05 Dec 2017 14:08:46 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:49614) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eMIZf-0003h0-ND for emacs-devel@gnu.org; Tue, 05 Dec 2017 14:08:13 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eMIZb-0008JJ-ND for emacs-devel@gnu.org; Tue, 05 Dec 2017 14:08:11 -0500 Original-Received: from colin.muc.de ([193.149.48.1]:23578 helo=mail.muc.de) by eggs.gnu.org with smtp (Exim 4.71) (envelope-from ) id 1eMIZb-0008HY-Fr for emacs-devel@gnu.org; Tue, 05 Dec 2017 14:08:07 -0500 Original-Received: (qmail 45770 invoked by uid 3782); 5 Dec 2017 19:08:02 -0000 Original-Received: from acm.muc.de (p548C7908.dip0.t-ipconnect.de [84.140.121.8]) by colin.muc.de (tmda-ofmipd) with ESMTP; Tue, 05 Dec 2017 20:08:00 +0100 Original-Received: (qmail 4914 invoked by uid 1000); 5 Dec 2017 19:01:41 -0000 Content-Disposition: inline In-Reply-To: <9beb1b6c-7c37-da28-3451-3c2a440f309b@yandex.ru> X-Delivery-Agent: TMDA/1.1.12 (Macallan) X-Primary-Address: acm@muc.de X-detected-operating-system: by eggs.gnu.org: FreeBSD 9.x [fuzzy] X-Received-From: 193.149.48.1 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:220748 Archived-At: Hello, Dmitry. On Tue, Dec 05, 2017 at 15:08:02 +0200, Dmitry Gutov wrote: > Hey Alan, > On 12/4/17 5:52 PM, Alan Mackenzie wrote: > > Any chance you could give me some basic details of how to get into this > > MMM mode? Like which git branch (? scratch/widen-less ?) can I find the > > code in, and where is the best documentation to get started. > I was talking in abstract (MMM meaning any similar framework), but it's > a good question. To debug the problems, a concrete example is needed. > The latest version of mmm-mode lives here: > https://github.com/purcell/mmm-mode.git, you can check out the master > branch, and it even has a manual that's reasonably up-to-date WRT to usage. Yes, thanks. Eli gave me that URL yesterday, so I've had a chance to skim the manual and some of the code. > Here are a couple of related bug reports: > https://github.com/purcell/mmm-mode/issues/55 > https://github.com/purcell/mmm-mode/issues/57 > Both pertaining to the use of c-mode in the context of mmm-noweb.el. > Please let me know if you need more localized examples. > > I've no idea how long it will take to make MMM and > > CC Mode work with eachother. As a first approximation, dealing with CC Mode's need to widen might help. (I don't yet know how that will work for when several CC Mode chunks are embedded in a single main buffer (?local variables), but that should become clearer as time goes by.) In my quick skim of MMM Mode's code, I didn't see any way of accessing all the various pertinent "point-min"s: there's the point-min set by the user, the point-min set by MMM Mode to restrict operations to the current chunk, and there's the point-min set by (e.g.) CC Mode for its own purposes. The same applies (perhaps a bit less so) to all the "point-max"es. Wasn't `prog-widen' supposed to get the MMM Mode's chunk boundaries? What are the recognised ways in MMM Mode of getting these three pairs of (point-min point-max)? > If you manage to do it at all, that would be an achievement. But just > figuring out the biggest problems should help us to design the feature. I'm thinking about first adapting all the various CC Mode caches which implicitly or explicitly start at 1, each to have a "cache-min" position which would coincide with the chunk-start. Maybe I could use some mechanism to avoid invalidating them when a buffer change before the CC Mode chunk changes this "cache-min" position. > > Not much, if at all. I found those discussions to be lacking the > > context I would have needed to understand them. > I hope the context is apparent now. Much more so, yes. > > That's fair. But the "syntax islands" proposal would be a lot of work, > > which I don't want to commit to before I see some sort of undertaking to > > take it seriously. > Then it should be a good idea to try the proposed, smaller approach, and > collect the drawbacks you meet along the way. That sounds like the way to go, yes. [ .... ] > Lots of cats around here in Cyprus. ;-) Ah, Cyprus! I'll bet it's a deal warmer than Germany at the moment! -- Alan Mackenzie (Nuremberg, Germany).