GNU bug report logs - #40857
Invisibility specs do not apply to specified spaces

Previous Next

Package: emacs;

Reported by: Clément Pit-Claudel <cpitclaudel <at> gmail.com>

Date: Sat, 25 Apr 2020 23:19:02 UTC

Severity: wishlist

Full log


Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Clément Pit-Claudel <cpitclaudel <at> gmail.com>
To: bug-gnu-emacs <bug-gnu-emacs <at> gnu.org>
Subject: Invisibility specs do not apply to specified spaces
Date: Sat, 25 Apr 2020 19:18:55 -0400
Consider the following program:

(with-current-buffer (get-buffer-create "*spaces*")
  (erase-buffer)
  (let ((indent (propertize " " 'display '(space :width 3))))
    (put-text-property (point) (progn (insert indent "r1\n") (point)) 'invisible 'a)
    (put-text-property (point) (progn (insert indent "r2\n") (point)) 'invisible 'b))
  (add-to-invisibility-spec 'a)
  (pop-to-buffer (current-buffer)))

The first record (r1) is hidden, but not the indentation that precedes it; so, instead of looking like this:

   r2

The buffer looks like this:

      r2

(This is because the invisible property doesn't apply to the display spec.)
It's easy to fix when the replacing display spec is a string (by putting the same invisibility spec on the string), but there doesn't seem to be a way to add an 'invisible property to the specified space.

Clément




This bug report was last modified 5 years and 53 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.