From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Robert Weiner Newsgroups: gmane.emacs.devel Subject: Re: invisible text and navigation commands Date: Mon, 2 Oct 2017 09:50:20 -0400 Message-ID: References: Reply-To: rswgnu@gmail.com NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="001a11405bce9890d0055a90a942" X-Trace: blaine.gmane.org 1506952266 15676 195.159.176.226 (2 Oct 2017 13:51:06 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 2 Oct 2017 13:51:06 +0000 (UTC) Cc: Emacs developers To: Paul Pogonyshev Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Oct 02 15:50:58 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 1dz17a-0003DJ-4X for ged-emacs-devel@m.gmane.org; Mon, 02 Oct 2017 15:50:58 +0200 Original-Received: from localhost ([::1]:52388 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dz17h-0007aR-BN for ged-emacs-devel@m.gmane.org; Mon, 02 Oct 2017 09:51:05 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:36661) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dz17X-0007YS-KI for emacs-devel@gnu.org; Mon, 02 Oct 2017 09:50:56 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dz17U-0005dI-Bp for emacs-devel@gnu.org; Mon, 02 Oct 2017 09:50:55 -0400 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:39117) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dz17U-0005d7-71 for emacs-devel@gnu.org; Mon, 02 Oct 2017 09:50:52 -0400 Original-Received: from mail-qt0-f170.google.com ([209.85.216.170]:54645) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.82) (envelope-from ) id 1dz17T-0005yC-AS for emacs-devel@gnu.org; Mon, 02 Oct 2017 09:50:51 -0400 Original-Received: by mail-qt0-f170.google.com with SMTP id i13so7279338qtc.11 for ; Mon, 02 Oct 2017 06:50:51 -0700 (PDT) X-Gm-Message-State: AMCzsaViGJyyrxIJ+z4KDnOJro/KCdcALG0aeqWHO0hzZDEi6lHO08py 4W7sIyr6aohBIQWbFIzuL+Cmjp8KeGqegz2VIuM= X-Google-Smtp-Source: AOwi7QCv1Yu3Hz3m4DyF+Pfn1PoiT/BKK62YvgRP5iVxlbnntQ45jO3w1UJ0SjqJKnOej8rlNQNktKDzlCRiCBJslEM= X-Received: by 10.200.44.118 with SMTP id e51mr1383457qta.171.1506952250690; Mon, 02 Oct 2017 06:50:50 -0700 (PDT) Original-Received: by 10.237.34.225 with HTTP; Mon, 2 Oct 2017 06:50:20 -0700 (PDT) In-Reply-To: X-Gmail-Original-Message-ID: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e 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:219010 Archived-At: --001a11405bce9890d0055a90a942 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Sun, Oct 1, 2017 at 3:21 PM, Paul Pogonyshev wrote: > Hi, > > My mode implements filtering in a read-only buffer by attaching > `invisible' property to text chunks and then modifying > `buffer-invsibility-spec' variable. This way I can hide/show large pieces > of text pretty much instantly and without modifying anything. However, I > noticed that commands like M-f etc. still "see through" the hidden text a= nd > will stop at points where something is hidden. > =E2=80=8BIf you use Emacs outline-mode or the GNU Hyperbole package's Koutl= iner mode, you'll see they both move past invisible *lines* of text all at once. Each Emacs buffer contains a buffer-display-table with a display-table slot that handles invisible lines. See the doc. for buffer-display-table.=E2=80=8B =E2=80=8B=E2=80=8B > Question: is it somehow possible to make M-f and so on (of course, for > interactive use only) ignore invisible text completely, as if it was not > there at all? If not, could such a feature be implemented in future? > =E2=80=8B=E2=80=8B =E2=80=8B=E2=80=8BIf you want this to work for invisible fields rather than= lines, I think you'll have to write your own mode which overlays all the movement commands. Hyperbole's Koutline mode does this too, so you can use that as an example, see: https://git.savannah.gnu.org/cgit/hyperbole.git/tree/kotl/kotl-mode.el It is involved to get this right. Bob --001a11405bce9890d0055a90a942 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
On Sun, Oct 1, 20= 17 at 3:21 PM, Paul Pogonyshev <pogonyshev@gmail.com> wrote:
Hi,

My mode implements filtering in a read-only= buffer by attaching `invisible' property to text chunks and then modif= ying `buffer-invsibility-spec' variable. This way I can hide/show large= pieces of text pretty much instantly and without modifying anything. Howev= er, I noticed that commands like M-f etc. still "see through" the= hidden text and will stop at points where something is hidden.
=

=E2=80=8BIf you use Emacs outline-mode or the GNU H= yperbole package's Koutliner mode, you'll see they both move past i= nvisible *lines* of text all at once.=C2=A0 Each Emacs buffer contains a bu= ffer-display-table with a display-table slot that handles invisible lines.= =C2=A0 See the doc. for buffer-display-table.=E2=80=8B

=E2=80=8B=E2= =80=8B
Question: is it someho= w possible to make M-f and so on (of course, for interactive use only) igno= re invisible text completely, as if it was not there at all? If not, could = such a feature be implemented in future?
=E2=80=8B=E2=80=8B
=E2=80=8B=E2=80=8BIf you want this to work for invi= sible fields rather than lines, I think you'll have to write your own m= ode which overlays all the movement commands.=C2=A0 Hyperbole's Koutlin= e mode does this too, so you can use that as an example, see:


It is involved to get this right.

Bob
--001a11405bce9890d0055a90a942--