From mboxrd@z Thu Jan 1 00:00:00 1970 From: Kaushal Modi 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 Message-ID: References: <87a85i2nji.fsf@nicolasgoaziou.fr> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="f403045ea28601538b0551ecc42e" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:57027) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dL9jM-0002GG-8N for emacs-orgmode@gnu.org; Wed, 14 Jun 2017 10:57:14 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dL9jK-0004Kg-Hh for emacs-orgmode@gnu.org; Wed, 14 Jun 2017 10:57:12 -0400 In-Reply-To: <87a85i2nji.fsf@nicolasgoaziou.fr> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: "Emacs-orgmode" To: Nicolas Goaziou , Bastien Guerry , Paul Rankin Cc: emacs-org list --f403045ea28601538b0551ecc42e Content-Type: text/plain; charset="UTF-8" On Thu, Jun 8, 2017 at 5:10 PM Nicolas Goaziou wrote: > > Test test-org/custom-properties condition: > > (ert-test-failed > > ((should > > (let > > (...) > > (org-test-with-temp-text "* H > > :PROPERTIES: > > :FOO: val > > :END: > > " ... ...))) > > :form > > (let > > ((org-custom-properties ...)) > > (org-test-with-temp-text "* H > > :PROPERTIES: > > :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 --f403045ea28601538b0551ecc42e Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
On Thu, Jun 8,= 2017 at 5:10 PM Nicolas Goaziou <mail@nicolasgoaziou.fr> wrote:
> Test test-org/custom-properties condition:
>=C2=A0 =C2=A0 =C2=A0(ert-test-failed
>=C2=A0 =C2=A0 =C2=A0 ((should
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 (let
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (...)
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (org-test-with-temp-text "* H > :PROPERTIES:
> <point>:FOO: val
> :END:
> " ... ...)))
>=C2=A0 =C2=A0 =C2=A0 =C2=A0:form
>=C2=A0 =C2=A0 =C2=A0 =C2=A0(let
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0((org-custom-properties ...))<= br> >=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(org-test-with-temp-text "* H > :PROPERTIES:
> <point>:FOO: val
> :END:
> "
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (org-toggle-custom-properties-visibi= lity)
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (org-invisible-p2)))
>=C2=A0 =C2=A0 =C2=A0 =C2=A0:value nil))
>=C2=A0 =C2=A0 FAILED=C2=A0 646/734=C2=A0 test-org/custom-properties
>
>=C2=A0 =C2=A0 =C2=A0(ert-test-failed
>=C2=A0 =C2=A0 =C2=A0 ((should
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 (org-test-with-temp-text "#+BEGIN_CENT= ER
> P1
>
> P2
> #+END_CENTER
> P3"
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(org-hide-block-toggle)
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(org-forward-paragraph)
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(looking-at "P3")))
>=C2=A0 =C2=A0 =C2=A0 =C2=A0:form
>=C2=A0 =C2=A0 =C2=A0 =C2=A0(let
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0((inside-text ...)
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (org-mode-hook nil))
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(with-temp-buffer
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(org-mode)
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(let ... ...)
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(org-hide-block-toggle)
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(org-forward-paragraph)
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(looking-at "P3")))<= br> >=C2=A0 =C2=A0 =C2=A0 =C2=A0:value nil))
>=C2=A0 =C2=A0 FAILED=C2=A0 668/734=C2=A0 test-org/forward-paragraph

These one are related to invisible text. I don't what is going to chang= e
in this area in next Emacs release.


Earlier outline= -invisible-p simply returned the value of =C2=A0(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)) 'invisi= ble) returns 'org-hide-block, not 'outline.

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

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

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

lisp/org.el
6926: =C2=A0 (when (outline= -invisible-p) (org-flag-heading nil))))
6960: =C2=A0 (when (outli= ne-invisible-p) (org-flag-heading nil)))
7134: =C2=A0 =C2=A0 =C2= =A0 (when (and (not (outline-invisible-p))
7136: =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(goto-char (point-at= -eol)) (outline-invisible-p)))
7489: =C2=A0 =C2=A0 (when (or (out= line-invisible-p) (org-invisible-p2))
7530: =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 (when (outline-invisible-p)
8387: =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (setq folded (outline-= invisible-p)))
8483: =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 (setq folded (outline-invisible-p)))
8536: = =C2=A0 (let* ((visp (not (outline-invisible-p)))
8593: =C2=A0 =C2= =A0 (when (and (outline-invisible-p) visp)
10441: =C2=A0 =C2=A0(w= hen (outline-invisible-p) (org-show-context)))
11144: =C2=A0 =C2= =A0(when (or (outline-invisible-p) (org-invisible-p2)) (org-show-context &#= 39;mark-goto))))
12395: =C2=A0 cl (when (outline-invisible-p) (or= g-end-of-subtree nil t))))
13323: =C2=A0 =C2=A0 =C2=A0 (lambda ()= (when (outline-invisible-p) (org-end-of-subtree nil t))))
13340:= =C2=A0 =C2=A0 =C2=A0 (lambda () (when (outline-invisible-p) (org-end-of-su= btree nil t))))
14887: =C2=A0 '(when (outline-invisible-p) (o= rg-end-of-subtree nil t))))
23850: =C2=A0;; Early versions of nou= tline don't have `outline-invisible-p'.
23852: =C2=A0 =C2= =A0(outline-invisible-p)))
23858: =C2=A0 =C2=A0;; Early versions = of noutline don't have `outline-invisible-p'.
23859: =C2= =A0 =C2=A0(outline-invisible-p)))
24129: =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(not (outline-invisible= -p
24265: =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0((outline-invisible-p= (line-end-position))
24352: =C2=A0 =C2=A0(when (outline-invisibl= e-p (point)) (beginning-of-visual-line))))
24429: =C2=A0 =C2=A0 = =C2=A0(when (outline-invisible-p (line-end-position)) (org-cycle))
24910: =C2=A0 =C2=A0 =C2=A0 (or (outline-invisible-p)
24912: = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (outl= ine-invisible-p)))
24918: =C2=A0 =C2=A0 =C2=A0 (outline-invisible= -p))

lisp/org-list.el
158:(declare-funct= ion outline-invisible-p "outline" (&optional pos))
= 2260: =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (outline-invisible-p)))

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

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

One so= lution would be to have a new function "org-invisible-p" that res= tores the old definition of outline-invisible-p. Interestingly I find that = an "org-invisible-p" did exist back then, but it was replaced wit= h outline-invisible-p in 2011 (=C2=A0http:/= /orgmode.org/cgit.cgi/org-mode.git/commit/?id=3D84d7165d74a5061413168af435d= 61453be217933 ). Looks like that might need reverting.

I also find an org-invisible-p2 function, but it's not clear w= hy it does a (backward-char =C2=A01) before doing invisibility check.. and = that too eventually relies on outline-visible-p. (Turns out this function h= as a long history:=C2=A0http://orgmode.org/= cgit.cgi/org-mode.git/commit/?id=3D93a4128a6fe47b4e05c0a7cb3ec14878b41d6000= =C2=A0)

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

Kaushal Modi

--f403045ea28601538b0551ecc42e--