unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Drew Adams <drew.adams@oracle.com>
To: 28080@debbugs.gnu.org
Subject: bug#28080: 25.2; `outline-invisible-p' should be specific to `invisible' property of `outline.el'
Date: Sun, 13 Aug 2017 17:22:48 +0000 (UTC)	[thread overview]
Message-ID: <9b4a1372-0759-42a5-a5b2-cc131c638c74@default> (raw)


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''





             reply	other threads:[~2017-08-13 17:22 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-13 17:22 Drew Adams [this message]
2017-08-16 23:34 ` bug#28080: 25.2; `outline-invisible-p' should be specific to `invisible' property of `outline.el' npostavs
2017-08-16 23:50   ` Drew Adams
2020-11-02 22:04     ` Drew Adams
2020-11-02 22:32       ` Stefan Kangas

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

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=9b4a1372-0759-42a5-a5b2-cc131c638c74@default \
    --to=drew.adams@oracle.com \
    --cc=28080@debbugs.gnu.org \
    /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 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).