unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#28080: 25.2; `outline-invisible-p' should be specific to `invisible' property of `outline.el'
@ 2017-08-13 17:22 Drew Adams
  2017-08-16 23:34 ` npostavs
  0 siblings, 1 reply; 5+ messages in thread
From: Drew Adams @ 2017-08-13 17:22 UTC (permalink / raw)
  To: 28080


This is the definition of `outline-invisible-p' in `outline.el':

(defsubst outline-invisible-p (&optional pos)
  "Non-nil if the character after POS is invisible.
If POS is nil, use `point' instead."
  (get-char-property (or pos (point)) 'invisible))

That's wrong.  Outline should recognize and respect, for its purposes,
only the invisibility that it, itself, imposes.

Here is a correct definition, AFAICT.  My own use of this indicates that
it DTRT.  In particular, I believe that it handles all of the invisible
text that Outline itself imposes, so that `outline.el' loses nothing by
using it.

(defun outline-invisible-p (&optional pos)
  "Non-nil if the character after point is invisible for outline purposes."
  (eq (get-char-property (or pos (point)) 'invisible) 'outline))

(It also should not be a `defsubst'.  1985 has come and gone.)

This fix is important for letting `outline.el' play with other code that
uses text invisibility for other reasons.  For example, I use it with
Info mode in a TOC buffer.  (That lets you show/hide parts of the TOC,
move parts around, etc., while still keeping hidden *Note:: etc.)

In GNU Emacs 25.2.1 (x86_64-w64-mingw32)
 of 2017-04-24
Windowing system distributor `Microsoft Corp.', version 6.1.7601
Configured using:
 `configure --without-dbus --without-compress-install 'CFLAGS=-O2
 -static -g3''





^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2020-11-02 22:32 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-08-13 17:22 bug#28080: 25.2; `outline-invisible-p' should be specific to `invisible' property of `outline.el' Drew Adams
2017-08-16 23:34 ` npostavs
2017-08-16 23:50   ` Drew Adams
2020-11-02 22:04     ` Drew Adams
2020-11-02 22:32       ` Stefan Kangas

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).