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 and > will stop at points where something is hidden. > ​If you use Emacs outline-mode or the GNU Hyperbole package's Koutliner 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.​ ​​ > 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? > ​​ ​​If 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