emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Kaushal Modi <kaushal.modi@gmail.com>
To: Nicolas Goaziou <mail@nicolasgoaziou.fr>,
	Bastien Guerry <bzg@gnu.org>, Paul Rankin <hello@paulwrankin.com>
Cc: emacs-org list <emacs-orgmode@gnu.org>
Subject: Backward incompatible outline-invisible-p change in emacs master for Org (Was: 6 failing tests on master branch)
Date: Wed, 14 Jun 2017 14:56:55 +0000	[thread overview]
Message-ID: <CAFyQvY2fGdezRKdF5QZ78X89B2Ma-xp3oJQJsDqsgf5Xx7f13w@mail.gmail.com> (raw)
In-Reply-To: <87a85i2nji.fsf@nicolasgoaziou.fr>

[-- Attachment #1: Type: text/plain, Size: 5102 bytes --]

On Thu, Jun 8, 2017 at 5:10 PM Nicolas Goaziou <mail@nicolasgoaziou.fr>
wrote:

> > Test test-org/custom-properties condition:
> >     (ert-test-failed
> >      ((should
> >        (let
> >            (...)
> >          (org-test-with-temp-text "* H
> > :PROPERTIES:
> > <point>:FOO: val
> > :END:
> > " ... ...)))
> >       :form
> >       (let
> >           ((org-custom-properties ...))
> >         (org-test-with-temp-text "* H
> > :PROPERTIES:
> > <point>:FOO: val
> > :END:
> > "
> >          (org-toggle-custom-properties-visibility)
> >          (org-invisible-p2)))
> >       :value nil))
> >    FAILED  646/734  test-org/custom-properties
> >
> >     (ert-test-failed
> >      ((should
> >        (org-test-with-temp-text "#+BEGIN_CENTER
> > P1
> >
> > P2
> > #+END_CENTER
> > P3"
> >         (org-hide-block-toggle)
> >         (org-forward-paragraph)
> >         (looking-at "P3")))
> >       :form
> >       (let
> >           ((inside-text ...)
> >            (org-mode-hook nil))
> >         (with-temp-buffer
> >           (org-mode)
> >           (let ... ...)
> >           (org-hide-block-toggle)
> >           (org-forward-paragraph)
> >           (looking-at "P3")))
> >       :value nil))
> >    FAILED  668/734  test-org/forward-paragraph
>
> These one are related to invisible text. I don't what is going to change
> in this area in next Emacs release.
>

This commit in emacs master is causing this failure:
http://git.savannah.gnu.org/cgit/emacs.git/commit/?id=9cc59ffbbb2f20fbbf1c72d2e0c9dc47c7906a99

Earlier outline-invisible-p simply returned the value of
 (get-char-property (or pos (point)) 'invisible).

But now (in emacs master), it does a check if that value is equal to
'outline.

That test fails as (get-char-property (or pos (point)) 'invisible) returns
'org-hide-block, not 'outline.

Now outline-invisible-p is used at many places!

lisp/org-archive.el
227:     cl (if (outline-invisible-p) (org-end-of-subtree nil t))))
425:     cl (if (outline-invisible-p) (org-end-of-subtree nil t))))
573:     cl (if (outline-invisible-p) (org-end-of-subtree nil t))))
594:     cl (if (outline-invisible-p) (org-end-of-subtree nil t))))

lisp/org-clock.el
2965:          (when (outline-invisible-p) (org-show-context))))))

lisp/org.el
6926:   (when (outline-invisible-p) (org-flag-heading nil))))
6960:   (when (outline-invisible-p) (org-flag-heading nil)))
7134:       (when (and (not (outline-invisible-p))
7136:                    (goto-char (point-at-eol)) (outline-invisible-p)))
7489:     (when (or (outline-invisible-p) (org-invisible-p2))
7530:               (when (outline-invisible-p)
8387:                 (setq folded (outline-invisible-p)))
8483:                   (setq folded (outline-invisible-p)))
8536:   (let* ((visp (not (outline-invisible-p)))
8593:     (when (and (outline-invisible-p) visp)
10441:    (when (outline-invisible-p) (org-show-context)))
11144:    (when (or (outline-invisible-p) (org-invisible-p2))
(org-show-context 'mark-goto))))
12395:   cl (when (outline-invisible-p) (org-end-of-subtree nil t))))
13323:       (lambda () (when (outline-invisible-p) (org-end-of-subtree nil
t))))
13340:       (lambda () (when (outline-invisible-p) (org-end-of-subtree nil
t))))
14887:   '(when (outline-invisible-p) (org-end-of-subtree nil t))))
23850:  ;; Early versions of noutline don't have `outline-invisible-p'.
23852:    (outline-invisible-p)))
23858:    ;; Early versions of noutline don't have `outline-invisible-p'.
23859:    (outline-invisible-p)))
24129:                      (not (outline-invisible-p
24265:          ((outline-invisible-p (line-end-position))
24352:    (when (outline-invisible-p (point)) (beginning-of-visual-line))))
24429:      (when (outline-invisible-p (line-end-position)) (org-cycle))
24910:       (or (outline-invisible-p)
24912:                     (outline-invisible-p)))
24918:       (outline-invisible-p))

lisp/org-list.el
158:(declare-function outline-invisible-p "outline" (&optional pos))
2260:             (outline-invisible-p)))

lisp/org-crypt.el
179:       (let ((folded (outline-invisible-p))
207:          (outline-invisible-p))))

contrib/lisp/org-drill.el
1458:;;          (when (and (not (outline-invisible-p))
1483:         (when (and (not (outline-invisible-p))

One solution would be to have a new function "org-invisible-p" that
restores the old definition of outline-invisible-p. Interestingly I find
that an "org-invisible-p" did exist back then, but it was replaced with
outline-invisible-p in 2011 (
http://orgmode.org/cgit.cgi/org-mode.git/commit/?id=84d7165d74a5061413168af435d61453be217933
). Looks like that might need reverting.

I also find an org-invisible-p2 function, but it's not clear why it does a
(backward-char  1) before doing invisibility check.. and that too
eventually relies on outline-visible-p. (Turns out this function has a long
history:
http://orgmode.org/cgit.cgi/org-mode.git/commit/?id=93a4128a6fe47b4e05c0a7cb3ec14878b41d6000
 )

I am copying Bastien and Paul as they would know the history behind the
above referenced emacs master commit.
-- 

Kaushal Modi

[-- Attachment #2: Type: text/html, Size: 7195 bytes --]

  parent reply	other threads:[~2017-06-14 14:57 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-08 20:33 6 failing tests on master branch Kaushal Modi
2017-06-08 21:10 ` Nicolas Goaziou
2017-06-09 14:26   ` Kaushal Modi
2017-06-09 15:14     ` Kaushal Modi
2017-06-09 16:02       ` Michael Albinus
2017-06-09 16:10         ` Kaushal Modi
2017-06-09 16:27           ` Nicolas Goaziou
2017-06-09 19:55             ` Kaushal Modi
2017-06-09 20:05               ` Nicolas Goaziou
2017-06-09 20:21                 ` Kaushal Modi
2017-06-14 14:56   ` Kaushal Modi [this message]
2017-06-14 16:03     ` Backward incompatible outline-invisible-p change in emacs master for Org (Was: 6 failing tests on master branch) Kaushal Modi
2017-06-14 17:02     ` Backward incompatible outline-invisible-p change in emacs master for Org Bastien Guerry
2017-06-14 17:18       ` Kaushal Modi
2017-06-14 20:28         ` Paul Rankin
2017-06-15  6:19           ` Bastien Guerry
2017-06-15 12:16             ` Kaushal Modi
2017-06-15 12:40               ` Bastien Guerry
2017-06-15 13:08                 ` Kaushal Modi

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.orgmode.org/

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

  git send-email \
    --in-reply-to=CAFyQvY2fGdezRKdF5QZ78X89B2Ma-xp3oJQJsDqsgf5Xx7f13w@mail.gmail.com \
    --to=kaushal.modi@gmail.com \
    --cc=bzg@gnu.org \
    --cc=emacs-orgmode@gnu.org \
    --cc=hello@paulwrankin.com \
    --cc=mail@nicolasgoaziou.fr \
    /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/org-mode.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).