From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Dmitrii Korobeinikov Newsgroups: gmane.emacs.bugs Subject: bug#35419: [O] [Proposal] Buffer Lenses and the Case of Org-Mode (also, Jupyter) Date: Sun, 5 Apr 2020 16:05:08 +0600 Message-ID: References: <87v9z2ojf8.fsf@yantar92-laptop.i-did-not-set--mail-host-address--so-tickle-me> <4bb84e9a-7058-3deb-30f0-b4c8f337b116@yandex.ru> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="72028"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Ihor Radchenko , 35419@debbugs.gnu.org To: Dmitry Gutov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Apr 05 12:06:30 2020 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jL2Af-000IcL-Vi for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 05 Apr 2020 12:06:29 +0200 Original-Received: from localhost ([::1]:46462 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jL2Af-0001m6-22 for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 05 Apr 2020 06:06:29 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:37214) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jL2AL-0001fe-6q for bug-gnu-emacs@gnu.org; Sun, 05 Apr 2020 06:06:10 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jL2AK-0001QD-4A for bug-gnu-emacs@gnu.org; Sun, 05 Apr 2020 06:06:09 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:33670) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1jL2AE-0001Hq-6G; Sun, 05 Apr 2020 06:06:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1jL2AD-0007rC-Vp; Sun, 05 Apr 2020 06:06:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Dmitrii Korobeinikov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org, emacs-orgmode@gnu.org Resent-Date: Sun, 05 Apr 2020 10:06:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 35419 X-GNU-PR-Package: emacs,org-mode Original-Received: via spool by 35419-submit@debbugs.gnu.org id=B35419.158608112730096 (code B ref 35419); Sun, 05 Apr 2020 10:06:01 +0000 Original-Received: (at 35419) by debbugs.gnu.org; 5 Apr 2020 10:05:27 +0000 Original-Received: from localhost ([127.0.0.1]:45216 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jL29f-0007pL-3K for submit@debbugs.gnu.org; Sun, 05 Apr 2020 06:05:27 -0400 Original-Received: from mail-wm1-f48.google.com ([209.85.128.48]:35559) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jL29d-0007ov-Sk for 35419@debbugs.gnu.org; Sun, 05 Apr 2020 06:05:26 -0400 Original-Received: by mail-wm1-f48.google.com with SMTP id i19so12596906wmb.0 for <35419@debbugs.gnu.org>; Sun, 05 Apr 2020 03:05:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=LgYS1j8Jy35QSeYIOi29s1pGROb3CIAI/he3OBpiFHM=; b=kf6gmJE06Xu6pX0YUfZKKlOmjFC0U+qkcqmmwJVgxQPTRweriSUCEpJsy4tMKjj7E2 /WZeMGUE0C6g3hNicTmSZOfHuR9JW3WkfXGk0wSYeLZ+NbaJDnKu4w7FYtd2ek2MTVM3 MwrarA4X//mF5vNupa5ztWP7gNOXY+OTDOLiSk8EQlorVsY1hnuqPLftbQkG9WrgDQ57 O8BGx3FofgiB/ASubPs9PUwYqw8oYQ+oIZtz42Bal4ZtO/xVWDpA+sk3ouajKlWkuvPs YjowK1Fa+RUi1yHFJxEYylBwcTiaUwa3+gkaUNm93OEHlr2sr0W+PRRpi7MOixBSTR9G y7ww== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=LgYS1j8Jy35QSeYIOi29s1pGROb3CIAI/he3OBpiFHM=; b=LA9Ccmzc2bnB4kJXh8eYxTGN1ImcGF8TbyAeHPhHASp5in4uoeD+gO9BWG3wK7wf/w lRNuFtA0UKNMr/o5IhHyURBeuXgKbKsaOlHjt9jOcs5wOB3YGJN6q7Jx6+Vy3KbW5vdz OnP7yDlESYTQsL8g8MaHGEsM9QWsq3gF2OPyFA33ZUTg4h90Oh4EcyndXp6v0dMcYg9O f1MFly8IpTHih77/BLylWbRatJF8IFmXaGvKhSjt1tEkygILs3JR9yxHMcep3n/63Ty9 Ht/nUmiKJB3Z96bWPR8JnH2nUu54x9wT4/GzUZP9YYDmeLOGSustF9u4rTLBtcbPUu0O y3kA== X-Gm-Message-State: AGi0PuZwQKPJjDo0ZqHXoJ21qfwfbCT+uPCjeIxqOj5V1NqsNyQTGDw5 u7eLpRkwDeZCnapkdrROqvtEEjHQ4/NLIjJv8+M= X-Google-Smtp-Source: APiQypLx9bjUiwsVvMqOMCNxyUu9QWcswX+Cj8LJ1ckEGP4DwfYuDAHfJ4Kh4BaRrCUG726Kk77XWfehGBIBEPjOg8E= X-Received: by 2002:a1c:6503:: with SMTP id z3mr7152239wmb.92.1586081120061; Sun, 05 Apr 2020 03:05:20 -0700 (PDT) In-Reply-To: <4bb84e9a-7058-3deb-30f0-b4c8f337b116@yandex.ru> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:178051 Archived-At: Thank you for the insight and the references! Quite useful to learn about this stuff. =D0=B2=D1=81, 5 =D0=B0=D0=BF=D1=80. 2020 =D0=B3. =D0=B2 07:46, Dmitry Gutov= : > > Hi! > > Some late clarifications about mmm-mode. > > On 26.04.2019 00:00, Dmitrii Korobeinikov wrote: > > > A lot of the functionality of MMM Mode---that which makes the major = mode > > > appear to change---is implemented by saving and restoring the values= of > > > local variables, or pseudo-variables. > > > > What I don't understand is where the modes of the submode region run an= d > > when they are turned on. > > They are run in an empty temporary buffer, see mmm-update-mode-info. > That is true for all the "submodes" in a buffer. The primary major mode > is run in the context of that buffer (IIRC). After any of them runs, the > code responsible for it collects the values of a certain number of known > variables and associates that map with the major mode (this is a bit of > a simplification). > > > Are necessary modes just allowed to run at the right time for the whole > > buffer? > > When you move between the "chunks", no major mode functions are called. > Instead, the values of variables are swapped in. Including the value of > the 'major-mode' variable. > > > But then, how are they limited in their effect to just the > > necessary region? Narrowing? > > Usually, yes. Especially when we're talking about font-lock and > syntax-propertize-function. See mmm-fontify-region-list for an example. > > > Could, for example, syntax checking be done efficiently that way? > > That depends on the combination of modes and how they are used (either > they can be nested, like in web templates, or it's a flat list where > chunks are largely independent like in Jupyter). But in most cases, I > think, you could pick a good strategy. There are no universal ones, thoug= h.