all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Drew Adams <drew.adams@oracle.com>
To: Dmitry Gutov <dgutov@yandex.ru>, Alan Mackenzie <acm@muc.de>
Cc: Stefan Monnier <monnier@iro.umontreal.ca>, emacs-devel@gnu.org
Subject: RE: forward-comment and syntax-ppss
Date: Fri, 16 Dec 2016 15:16:47 -0800 (PST)	[thread overview]
Message-ID: <c5444a4c-1b90-42f9-b4b3-1f54b70e94df@default> (raw)
In-Reply-To: <b72734b5-1c36-23ee-dfde-aa3350abdafb@yandex.ru>

> 1. Classical example of mixing narrowing for two different purposes, and
> how that backfires: M-: (info "(elisp) Variables")
> Select some region, and to focus on reading it better (or some other
> reason you use narrowing interactively for), narrow to it: C-x n n.
> Finish reading it, try to get back to the node with `C-x n w'.
> 
> Instead, you see the whole elisp.info.

Not a problem for me.  And doesn't have to be a problem for
vanilla Emacs users either, if the proper commands are added.

For me, narrowing (and widening) pushes the current buffer
limits to a list.  And it is trivial to return to any previous
restriction (including fully wide).

In my case:
1. `C-x n n' to "focus on reading" a paragraph in the node.
2. `C-x n x' to return to the full node (not all of Info).
End of story.

or:
1. `C-x n w' to see all of the Info file (for context or whatever).
2. `C-x n x' to return to seeing just the node.

or:
`C-x n n' here and `C-x n n' there, any number of times & places,
followed by `C-x n x' with a prefix arg, to choose any of those
restrictions again.  Or just cycle among them by repeating
`C-x n x'.  Either within a buffer or across buffers.

----
  zz-narrow-repeat is an interactive compiled Lisp function in
  `zones.el'.  It is bound to C-x n x.

  (zz-narrow-repeat ARG)

  Cycle to the next buffer restriction (narrowing).
  This is a repeatable version of `zz-narrow'.

  Note that if the value of `zz-izones-var' is not buffer-local
  then you can use this command to cycle among regions in multiple
  buffers.
----

It's a repeatable version of `zz-narrow' (prefix arg acts the same):

----
  zz-narrow is an interactive compiled Lisp function in `zones.el'.

  (zz-narrow ARG &optional MSGP)

  Widen to a previous buffer restriction (narrowing).
  The candidates are the zones in the current `zz-izones-var'.

  With no prefix arg, widen to the previous narrowing.
  With a plain prefix arg (`C-u'), widen completely.
  With a zero  prefix arg (`C-0'), widen completely and reset (empty)
   the list of zones for this buffer.
  With a numeric prefix arg N, widen abs(N) times (to the abs(N)th
   previous narrowing).  Positive and negative args work the same,
   except that a negative arg also pops entries off the ring: it removes
   the ring entries from the most recent back through the (-)Nth one.
----

`C-x n x' is simple, but it goes a long way.

If better control of restrictions by users is what you're after,
then the code in `zones.el' is a good start, IMO.

> 2. Multi-mode usage where the framework delegates to each
> subregion's major mode for fontification and indentation.

I can't speak to that (too vague for me).  But a wild guess might
be that maybe "the framework" should _not_ blindly so delegate.
IOW, if it hurts, don't do it.  Maybe a better sauce is needed
for the recipe.  Or maybe the delegate itself needs to be
improved, before it can be delegated this way.

> I'm not going to recap it all again now, but, suffice to say, font-lock
> rules, indentation functions and syntax-ppss ignoring the narrowing
> imposed on them by the calling code is highly inconvenient.

Then maybe that should be fixed.  Or maybe the fix should be in
the calling code.  Seems like font-lock etc. code should be able
to do whatever narrowing it needs to do (modulo, perhaps,
communicating what it's done).  If that is wrong for a potential
caller then the caller might need to do something different.

Anyway, font-lock, indentation, and syntax-ppss are hardly your
average bits of code.  Perhaps some communication is in order,
between them and potential callers, so that they can be properly
or more easily used in more contexts.

That's a far cry from wanting to simply replace narrowing for
users with some kind of invisible-text hack.

> We don't want the JS indentation or highlighting rules to look at HTML
> code, and vice versa.

So create environments for them - quarantine them.  Or fix them
so whatever they do to wrt buffer restriction is benign outside
them.



  reply	other threads:[~2016-12-16 23:16 UTC|newest]

Thread overview: 299+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-28 19:50 Preview: portable dumper Daniel Colascione
2016-11-28 19:58 ` Burton Samograd
2016-11-28 20:11   ` Daniel Colascione
2016-11-28 20:12 ` Eli Zaretskii
2016-11-28 20:14   ` Daniel Colascione
2016-11-28 20:16     ` Daniel Colascione
2016-11-28 20:29     ` Eli Zaretskii
2016-11-28 20:20   ` John Wiegley
2016-11-28 20:22     ` Daniel Colascione
2016-11-28 20:26       ` John Wiegley
2016-11-28 20:31         ` Daniel Colascione
2016-11-28 20:37           ` Burton Samograd
2016-11-28 20:44             ` Daniel Colascione
2016-11-29 16:02               ` Ted Zlatanov
2016-11-29 17:58                 ` Daniel Colascione
2016-11-29 16:48               ` Richard Stallman
2016-11-29 17:32                 ` Daniel Colascione
2016-11-29 19:55                   ` Philippe Vaucher
2016-11-29 17:43                 ` Eli Zaretskii
2016-11-29 17:49                   ` Daniel Colascione
2016-11-29 18:17                     ` Eli Zaretskii
2016-11-29 18:03                   ` John Wiegley
2016-11-29 18:23                     ` Eli Zaretskii
2016-11-29 18:49                       ` Daniel Colascione
2016-11-29 19:02                         ` Eli Zaretskii
2016-12-01  9:18                         ` Richard Stallman
2016-12-01 18:11                           ` Eli Zaretskii
2016-12-02  4:28                             ` Ken Raeburn
2016-12-02  4:41                               ` Daniel Colascione
2016-12-02  8:08                                 ` Eli Zaretskii
2016-12-02  8:03                               ` Eli Zaretskii
2016-12-02 17:24                                 ` Ken Raeburn
2016-11-28 20:39           ` John Wiegley
2016-11-28 20:34         ` Burton Samograd
2016-11-28 20:31     ` Eli Zaretskii
2016-11-28 20:21   ` Paul Eggert
2016-11-28 20:34     ` Eli Zaretskii
2016-11-28 20:47       ` John Wiegley
2016-11-28 21:14         ` Eli Zaretskii
2016-11-28 21:55           ` Daniel Colascione
2016-11-28 22:18           ` John Wiegley
2016-11-29 18:40             ` Eli Zaretskii
2016-11-29 19:11               ` John Wiegley
2016-11-29 20:07                 ` Eli Zaretskii
2016-11-29 20:29                   ` John Wiegley
2016-11-29 20:36                     ` Daniel Colascione
2016-11-29 21:30                       ` John Wiegley
2016-11-30  8:26                       ` Philippe Vaucher
2016-11-29 19:12               ` Daniel Colascione
2016-11-29 16:55   ` Richard Stallman
2016-11-29 18:39     ` Eli Zaretskii
2016-11-29 19:03       ` Daniel Colascione
2016-11-29 19:59         ` Eli Zaretskii
2016-11-29 20:28           ` John Wiegley
2016-11-29 19:13       ` Paul Eggert
2016-11-29 19:35         ` Eli Zaretskii
2016-11-29 20:54           ` Paul Eggert
2016-11-30 16:38             ` Eli Zaretskii
2016-11-30 18:57               ` John Wiegley
2016-11-30 19:14                 ` Daniel Colascione
2016-11-30 21:03                   ` John Wiegley
2016-11-30 21:06                     ` Paul Eggert
2016-11-30 21:44                       ` John Wiegley
2016-12-01  3:32                       ` Eli Zaretskii
2016-12-01  9:16                         ` Paul Eggert
2016-12-01 17:26                           ` Eli Zaretskii
2016-12-01 17:35                             ` Daniel Colascione
2016-12-01 17:58                             ` Paul Eggert
2016-11-30 21:35                     ` Daniel Colascione
2016-11-30 21:44                       ` John Wiegley
2016-11-30 21:50                         ` Daniel Colascione
2016-11-30 22:20                           ` John Wiegley
2016-12-01  1:37                           ` Paul Eggert
2016-12-01  1:45                             ` Daniel Colascione
2016-12-01  3:47                           ` Eli Zaretskii
2016-12-01  4:10                             ` John Wiegley
2016-12-01  4:12                               ` Daniel Colascione
2016-12-01  4:49                                 ` John Wiegley
2016-12-01  5:12                                   ` Daniel Colascione
2016-12-01  9:03                                     ` Matt Armstrong
2016-12-02  8:10                                       ` John Wiegley
2016-12-01  9:18                                     ` Phillip Lord
2016-12-01  4:10                             ` Daniel Colascione
2016-12-01  3:41                         ` Eli Zaretskii
2016-11-30 19:29                 ` Philippe Vaucher
2016-11-30 19:45                   ` Daniel Colascione
2016-11-30 21:06               ` Paul Eggert
2016-12-01  9:18       ` Richard Stallman
2016-12-01 18:09         ` Eli Zaretskii
2016-12-02  2:18           ` Stefan Monnier
2016-12-02  7:54             ` Eli Zaretskii
2016-12-02  8:08               ` John Wiegley
2016-12-02  8:59                 ` Eli Zaretskii
2016-12-02 19:39                   ` John Wiegley
2016-12-02 20:11                     ` Karl Fogel
2016-12-02 21:22                       ` Daniel Colascione
2016-12-02 22:06                         ` Eli Zaretskii
2016-12-02 23:15                         ` Karl Fogel
2016-12-15 14:28                         ` Philippe Vaucher
2017-10-18 23:36                           ` Kaushal Modi
2017-10-19 10:12                             ` Jeremie Courreges-Anglas
2018-02-12 20:18                               ` Daniel Colascione
2018-02-13 16:37                                 ` Eli Zaretskii
2018-02-14 21:03                                   ` Philipp Stephani
2018-02-15  0:42                                     ` Daniel Colascione
2018-02-15 23:31                                   ` Ken Brown
2018-02-15 23:36                                     ` Daniel Colascione
2018-02-16  1:56                                       ` Ken Brown
2018-02-16  2:36                                         ` Daniel Colascione
2018-02-17 23:38                                           ` Ken Brown
2018-02-17 23:59                                             ` Ken Brown
2018-02-18  0:02                                             ` Daniel Colascione
2018-02-19 13:30                                               ` Ken Brown
2018-02-19 17:03                                                 ` Daniel Colascione
2018-02-19 22:33                                                   ` Ken Brown
2018-02-20 16:32                                                     ` Ken Brown
2018-02-20 17:23                                                       ` Daniel Colascione
2018-02-20  1:16                                                   ` Andy Moreton
2018-02-17  1:01                                   ` Clément Pit-Claudel
2018-02-19 17:06                                     ` Daniel Colascione
2018-02-19 22:00                                       ` Clément Pit-Claudel
2018-02-17 11:53                                   ` Charles A. Roelli
2018-02-17 12:09                                     ` Alan Third
2018-02-17 14:12                                       ` Charles A. Roelli
2018-02-20  0:54                                   ` Andy Moreton
2018-02-15  4:28                                 ` Stefan Monnier
2018-02-15 22:13                                   ` Daniel Colascione
2018-02-15 22:30                                     ` Paul Eggert
2018-02-15 22:35                                       ` Daniel Colascione
2018-02-15 22:56                                         ` Paul Eggert
2018-02-15 22:35                                     ` Paul Eggert
2018-02-15 18:34                                 ` andres.ramirez
2018-02-19 22:01                                 ` Daniele Nicolodi
2018-02-20  0:28                                   ` Daniel Colascione
2016-12-02 22:06                       ` Eli Zaretskii
2016-12-02 22:28                         ` Daniel Colascione
2016-12-03  8:48                           ` Eli Zaretskii
2016-12-03  9:34                             ` Daniel Colascione
2016-12-03 12:47                               ` Eli Zaretskii
2016-12-03 14:36                                 ` Alan Mackenzie
2016-12-03 15:11                                   ` Eli Zaretskii
2016-12-04 12:20                                     ` Alan Mackenzie
2016-12-04 12:48                                       ` Dmitry Gutov
2016-12-04 15:53                                       ` Eli Zaretskii
2016-12-03 17:36                                   ` Daniel Colascione
2016-12-03 17:40                                     ` Dmitry Gutov
2016-12-03 21:09                                       ` Stefan Monnier
2016-12-03 21:31                                         ` Daniel Colascione
2016-12-04  4:25                                           ` Stefan Monnier
2016-12-04 12:34                                         ` Alan Mackenzie
2016-12-04 12:51                                           ` Dmitry Gutov
2016-12-04 14:08                                           ` Stefan Monnier
2016-12-04 15:22                                             ` Alan Mackenzie
2016-12-04 22:24                                             ` forward-comment and syntax-ppss (was: Preview: portable dumper) Stefan Monnier
2016-12-06 19:55                                               ` Alan Mackenzie
2016-12-06 22:56                                                 ` forward-comment and syntax-ppss Stefan Monnier
2016-12-07  6:55                                                   ` Andreas Röhler
2016-12-07 14:01                                                     ` Stefan Monnier
2016-12-07 14:49                                                       ` Andreas Röhler
2016-12-07 14:53                                                         ` Clément Pit--Claudel
2016-12-07 22:04                                                           ` Alan Mackenzie
2016-12-07 22:23                                                             ` Clément Pit--Claudel
2016-12-08 19:31                                                               ` Alan Mackenzie
2016-12-08 19:54                                                                 ` Clément Pit--Claudel
2016-12-09  8:37                                                                   ` Eli Zaretskii
2016-12-08  2:32                                                             ` Stefan Monnier
2016-12-08 20:15                                                               ` Alan Mackenzie
2016-12-08 20:34                                                                 ` Clément Pit--Claudel
2016-12-08 21:25                                                                   ` Dmitry Gutov
2016-12-08 21:35                                                                   ` Stefan Monnier
2016-12-08 21:13                                                                 ` Stefan Monnier
2016-12-09 18:00                                                                   ` Alan Mackenzie
2016-12-09 18:47                                                                     ` Stefan Monnier
2016-12-09 22:33                                                                       ` Clément Pit--Claudel
2016-12-09 23:09                                                                         ` Alan Mackenzie
2016-12-10  6:56                                                                         ` Eli Zaretskii
2016-12-10 18:39                                                                       ` Andreas Röhler
2016-12-08 21:24                                                                 ` Dmitry Gutov
2016-12-08 21:47                                                                   ` Stefan Monnier
2016-12-09  7:39                                                                     ` Andreas Röhler
2016-12-09 19:07                                                                   ` Alan Mackenzie
2016-12-09 23:30                                                                     ` Dmitry Gutov
2016-12-11  0:24                                                                       ` Stefan Monnier
2016-12-11 10:17                                                                       ` Alan Mackenzie
2016-12-11 10:40                                                                         ` Andreas Röhler
2016-12-16  1:33                                                                         ` Dmitry Gutov
2016-12-16  2:06                                                                           ` Drew Adams
2016-12-16  8:12                                                                             ` Eli Zaretskii
2016-12-16 12:32                                                                             ` Dmitry Gutov
2016-12-16 16:22                                                                               ` Drew Adams
2016-12-16 19:14                                                                                 ` Dmitry Gutov
2016-12-16 23:16                                                                                   ` Drew Adams
2016-12-17  0:08                                                                                     ` Dmitry Gutov
2016-12-16 19:25                                                                               ` Alan Mackenzie
2016-12-16 20:06                                                                                 ` Dmitry Gutov
2016-12-16 23:16                                                                                   ` Drew Adams [this message]
2016-12-17  0:42                                                                                     ` Dmitry Gutov
2016-12-17  1:30                                                                                       ` Drew Adams
2016-12-17  1:40                                                                                         ` Stefan Monnier
2016-12-17  2:26                                                                                           ` Drew Adams
2016-12-17 14:37                                                                                             ` Stefan Monnier
2016-12-16 14:24                                                                             ` Clément Pit--Claudel
2016-12-16 16:22                                                                               ` Drew Adams
2016-12-16 19:50                                                                                 ` Clément Pit--Claudel
2016-12-16 23:16                                                                                   ` Drew Adams
2016-12-17  2:39                                                                                     ` Clément Pit--Claudel
2016-12-17  4:50                                                                                       ` Wording of the Elisp manuals (was: forward-comment and syntax-ppss) Marcin Borkowski
2016-12-20  9:22                                                                                         ` Wording of the Elisp manuals Michael Heerdegen
2016-12-20 10:52                                                                                         ` Wording of the Elisp manuals (was: forward-comment and syntax-ppss) Jean-Christophe Helary
2016-12-20 16:01                                                                                           ` Eli Zaretskii
     [not found]                                                                             ` <<83oa0c8f7r.fsf@gnu.org>
2016-12-16 16:22                                                                               ` forward-comment and syntax-ppss Drew Adams
2016-12-16 21:00                                                                                 ` Eli Zaretskii
     [not found]                                                                                 ` <<8337hn8u81.fsf@gnu.org>
2016-12-16 23:16                                                                                   ` Drew Adams
2016-12-16 20:06                                                                           ` Alan Mackenzie
2016-12-16 22:08                                                                             ` Dmitry Gutov
2016-12-16 23:08                                                                               ` Stefan Monnier
2016-12-17  0:18                                                                                 ` Dmitry Gutov
2016-12-17  7:37                                                                                   ` Marcin Borkowski
2016-12-17  7:42                                                                                 ` Eli Zaretskii
2016-12-17 14:41                                                                                   ` Stefan Monnier
2016-12-17 14:49                                                                                     ` Eli Zaretskii
2016-12-17 15:09                                                                                       ` Lars Ingebrigtsen
2016-12-18 20:08                                                                                         ` Dmitry Gutov
2017-02-05 23:33                                                                                         ` Drew Adams
2016-12-17 15:38                                                                                       ` Stefan Monnier
2016-12-19  2:31                                                                                         ` Dmitry Gutov
2016-12-19 13:12                                                                                           ` Stefan Monnier
2016-12-19 13:34                                                                                             ` Dmitry Gutov
2016-12-19 14:17                                                                                               ` Stefan Monnier
2016-12-19 23:16                                                                                                 ` Dmitry Gutov
2016-12-20 13:33                                                                                                   ` Stefan Monnier
2017-11-29 23:48                                                                                                     ` multi-modes and widen (again), was: " Dmitry Gutov
2017-11-30 13:05                                                                                                       ` Stefan Monnier
2017-12-01 23:57                                                                                                         ` Dmitry Gutov
2016-12-16 23:16                                                                               ` Drew Adams
2016-12-09  8:35                                                                 ` Eli Zaretskii
2016-12-09 17:08                                                                   ` Alan Mackenzie
2016-12-09 17:22                                                                     ` Eli Zaretskii
2016-12-09 21:55                                                                       ` Richard Stallman
2016-12-03 21:31                                   ` Preview: portable dumper Richard Stallman
2016-12-04 12:41                                     ` Alan Mackenzie
2016-12-03 17:41                                 ` Paul Eggert
2016-12-03 19:49                                   ` Eli Zaretskii
2016-12-03 21:30                                 ` Richard Stallman
2016-12-04  3:31                                   ` Eli Zaretskii
2016-12-04 23:03                                     ` Richard Stallman
2016-12-03 17:24                               ` Paul Eggert
2016-12-03 15:56                             ` Stefan Monnier
2016-12-03 21:31                               ` Richard Stallman
2016-12-04 23:05                             ` Richard Stallman
2016-12-02 22:29                         ` John Wiegley
2016-12-03 21:28                         ` Richard Stallman
2016-12-04 15:57                           ` Eli Zaretskii
2016-12-04 17:12                             ` Daniel Colascione
2016-12-04 23:07                               ` Richard Stallman
2016-12-05  0:24                                 ` Daniel Colascione
2016-12-06 10:38                               ` Philippe Vaucher
2016-12-02  9:00               ` Philippe Vaucher
2016-12-02 10:56                 ` Eli Zaretskii
2017-05-26 19:48                   ` Thien-Thi Nguyen
2017-05-26 20:26                     ` Kaushal Modi
2017-05-27  7:27                       ` Thien-Thi Nguyen
2016-12-02 13:04               ` Stefan Monnier
2016-12-02 14:45                 ` Eli Zaretskii
2016-12-02 14:51                   ` Stefan Monnier
2016-12-02 22:24                     ` Richard Stallman
2016-12-02 23:32                       ` Stefan Monnier
2016-12-03  8:28                       ` Eli Zaretskii
2016-12-02 23:42                     ` Paul Eggert
2016-12-02 15:38                   ` Daniel Colascione
2016-12-02 17:26                   ` Ken Raeburn
2016-12-02 17:47                     ` Paul Eggert
     [not found]                   ` <<jwvlgvyv10x.fsf-monnier+Inbox@gnu.org>
     [not found]                     ` <<E1cCwGF-0002PT-Kq@fencepost.gnu.org>
2016-12-03  0:07                       ` Drew Adams
2016-12-03  8:25                         ` Eli Zaretskii
2016-12-03 20:40                           ` Joost Kremers
2016-12-03 21:30                         ` Richard Stallman
     [not found]                   ` <<<jwvlgvyv10x.fsf-monnier+Inbox@gnu.org>
     [not found]                     ` <<<E1cCwGF-0002PT-Kq@fencepost.gnu.org>
     [not found]                       ` <<2b63d48d-a678-49c2-a3a9-4f91d8d8bdb4@default>
     [not found]                         ` <<8337i5mnb5.fsf@gnu.org>
2016-12-03 16:14                           ` Drew Adams
2016-12-03 16:42                             ` Eli Zaretskii
2016-12-02 14:27           ` Richard Stallman
2016-11-28 21:14 ` Paul Eggert
2016-11-28 23:01 ` Stefan Monnier
2016-11-28 23:17   ` Daniel Colascione
2016-11-29 13:06     ` Stefan Monnier
2016-11-29 21:19       ` Daniel Colascione
2016-11-29 21:35         ` Paul Eggert
2016-11-29 21:50           ` Daniel Colascione
2016-11-29 22:01             ` Paul Eggert
2016-11-30  0:37               ` Daniel Colascione
2016-11-30  7:35                 ` Paul Eggert
2016-11-30 13:33                   ` Stefan Monnier
2016-11-30 20:07               ` Richard Stallman
2016-11-30 20:18                 ` Daniel Colascione
2016-12-03 21:32                   ` Richard Stallman
2016-12-03 21:37                     ` Daniel Colascione
2016-12-04 23:03                       ` Richard Stallman
2016-12-03 21:54                     ` Paul Eggert
2016-11-29 22:01           ` Stefan Monnier
2016-11-29 22:22           ` Philipp Stephani
2016-11-29 22:34             ` Paul Eggert

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=c5444a4c-1b90-42f9-b4b3-1f54b70e94df@default \
    --to=drew.adams@oracle.com \
    --cc=acm@muc.de \
    --cc=dgutov@yandex.ru \
    --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.