Re: Failing tests

2020-06-02 Thread Kyle Meyer
Kévin Le Gouguec writes:

> Kyle Meyer  writes:
>
>>> I think I've narrowed this down to org-open-file running "less
>>> examples/att1/fileA" instead of visiting this file.
>> [...]
>>> Let-binding org-file-apps to '(("." . emacs)) makes the tests pass, but
>>> I don't know if that's the way we want to solve this.
>>
>> Thanks for looking into the failures.  Let-binding org-file-apps sounds
>> like a good approach to me.  Rather than the catch-all regular
>> expression, I believe the value could be ((t . emacs)).
>
> Absolutely.  I've attached a patch to that effect.

Thanks.  Applied (c8f7e89d7).

> I wonder though, shouldn't org-open-file always visit text/plain files?
> Why would we ever want to send those to an external viewer?
>
> I think this would need special-casing inside org-open-file, since I
> don't see a way to catch all text/plain files with org-file-apps.

Good question.  I'm not sure, though offhand I can't think of cases
where I'd want to send text/plain files to an external viewer.  I'd
guess this doesn't matter much in practice given the default position of

  (auto-mode . emacs)

in org-file-apps, which will catch a good number of text/plain files.



Re: Failing tests

2020-06-01 Thread Kévin Le Gouguec
Kévin Le Gouguec  writes:

> Absolutely.  I've attached a patch to that effect.

I just realized that these let-bindings probably deserved explanatory
comments.  Here is an updated patch:

>From f996ec3a10a845abae2fa463ab0ea7a761af1707 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?K=C3=A9vin=20Le=20Gouguec?= 
Date: Mon, 1 Jun 2020 16:07:44 +0200
Subject: [PATCH] Make tests robust with respect to mailcap entries

When /etc/mailcap specifies a program for text/plain
files (e.g. less(1)), org-open-file will run this program instead of
visiting the file.  This throws off some tests which expect
extension-less temporary files to be visited.

* testing/lisp/test-ob-tangle.el (ob-tangle/jump-to-org):
* testing/lisp/test-org-attach.el (test-org-attach/dir): Rig
org-file-apps so that temporary files are visited inside Emacs.
---
 testing/lisp/test-ob-tangle.el  | 124 +-
 testing/lisp/test-org-attach.el | 148 
 2 files changed, 138 insertions(+), 134 deletions(-)

diff --git a/testing/lisp/test-ob-tangle.el b/testing/lisp/test-ob-tangle.el
index 2283037fc..7b1f617ed 100644
--- a/testing/lisp/test-ob-tangle.el
+++ b/testing/lisp/test-ob-tangle.el
@@ -124,24 +124,26 @@ echo 1
 
 (ert-deftest ob-tangle/jump-to-org ()
   "Test `org-babel-tangle-jump-to-org' specifications."
-  ;; Standard test.
-  (should
-   (equal
-"* H\n#+begin_src emacs-lisp\n1\n#+end_src"
-(org-test-with-temp-text-in-file
-"* H\n#+begin_src emacs-lisp\n1\n#+end_src"
-  (let ((file (buffer-file-name)))
-(org-test-with-temp-text
-(format ";; [[file:%s][H:1]]\n1\n;; H:1 ends here\n"
-(file-name-nondirectory file))
-  (org-babel-tangle-jump-to-org)
-  (buffer-string))
-  ;; Multiple blocks in the same section.
-  (should
-   (equal
-"2"
-(org-test-with-temp-text-in-file
-"* H
+  ;; Make sure temporary files will be visited inside Emacs.
+  (let ((org-file-apps '((t . emacs
+;; Standard test.
+(should
+ (equal
+  "* H\n#+begin_src emacs-lisp\n1\n#+end_src"
+  (org-test-with-temp-text-in-file
+  "* H\n#+begin_src emacs-lisp\n1\n#+end_src"
+	(let ((file (buffer-file-name)))
+  (org-test-with-temp-text
+  (format ";; [[file:%s][H:1]]\n1\n;; H:1 ends here\n"
+  (file-name-nondirectory file))
+(org-babel-tangle-jump-to-org)
+(buffer-string))
+;; Multiple blocks in the same section.
+(should
+ (equal
+  "2"
+  (org-test-with-temp-text-in-file
+  "* H
 
 first block
 
@@ -155,49 +157,49 @@ another block
 2
 #+end_src
 "
-  (let ((file (buffer-file-name)))
-(org-test-with-temp-text
-(format ";; [[file:%s][H:2]]\n2\n;; H:2 ends here\n"
-(file-name-nondirectory file))
-  (org-babel-tangle-jump-to-org)
-  (buffer-substring (line-beginning-position)
-(line-end-position)))
-  ;; Preserve position within the source code.
-  (should
-   (equal
-"1)"
-(org-test-with-temp-text-in-file
-"* H\n#+begin_src emacs-lisp\n(+ 1 1)\n#+end_src"
-  (let ((file (buffer-file-name)))
-(org-test-with-temp-text
-(format ";; [[file:%s][H:1]]\n(+ 1 1)\n;; H:1 ends here\n"
-(file-name-nondirectory file))
-  (org-babel-tangle-jump-to-org)
-  (buffer-substring-no-properties (point) (line-end-position)))
-  ;; Blocks before first heading.
-  (should
-   (equal
-"Buffer start\n#+begin_src emacs-lisp\n1\n#+end_src\n* H"
-(org-test-with-temp-text-in-file
-"Buffer start\n#+begin_src emacs-lisp\n1\n#+end_src\n* H"
-  (let ((file (buffer-file-name)))
-(org-test-with-temp-text
-(format ";; [[file:%s][H:1]]\n1\n;; H:1 ends here\n"
-(file-name-nondirectory file))
-  (org-babel-tangle-jump-to-org)
-  (buffer-string))
-  ;; Special case: buffer starts with a source block.
-  (should
-   (equal
-"#+begin_src emacs-lisp\n1\n#+end_src\n* H"
-(org-test-with-temp-text-in-file
-"#+begin_src emacs-lisp\n1\n#+end_src\n* H"
-  (let ((file (buffer-file-name)))
-(org-test-with-temp-text
-(format ";; [[file:%s][H:1]]\n1\n;; H:1 ends here\n"
-(file-name-nondirectory file))
-  (org-babel-tangle-jump-to-org)
-  (buffer-string)))
+	(let ((file (buffer-file-name)))
+  (org-test-with-temp-text
+  (format ";; [[file:%s][H:2]]\n2\n;; H:2 ends here\n"
+  (file-name-nondirectory file))
+(org-babel-tangle-jump-to-org)
+(buffer-substring (line-beginning-position)
+  (line-end-position)))
+;; Preserve position within the source code.
+(should
+ (equal
+  "1)"
+  (org-test-with-temp-text-in-file
+  "* 

Re: Failing tests

2020-06-01 Thread Kévin Le Gouguec
Kyle Meyer  writes:

>> I think I've narrowed this down to org-open-file running "less
>> examples/att1/fileA" instead of visiting this file.
> [...]
>> Let-binding org-file-apps to '(("." . emacs)) makes the tests pass, but
>> I don't know if that's the way we want to solve this.
>
> Thanks for looking into the failures.  Let-binding org-file-apps sounds
> like a good approach to me.  Rather than the catch-all regular
> expression, I believe the value could be ((t . emacs)).

Absolutely.  I've attached a patch to that effect.

I wonder though, shouldn't org-open-file always visit text/plain files?
Why would we ever want to send those to an external viewer?

I think this would need special-casing inside org-open-file, since I
don't see a way to catch all text/plain files with org-file-apps.


>From 05a71740c662fcde3fcfad7c07975052781ec589 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?K=C3=A9vin=20Le=20Gouguec?= 
Date: Mon, 1 Jun 2020 16:07:44 +0200
Subject: [PATCH] Make tests robust with respect to mailcap entries

When /etc/mailcap specifies a program for text/plain
files (e.g. less(1)), org-open-file will run this program instead of
visiting the file.  This throws off some tests which expect
extension-less temporary files to be visited.

* testing/lisp/test-ob-tangle.el (ob-tangle/jump-to-org):
* testing/lisp/test-org-attach.el (test-org-attach/dir): Rig
org-file-apps so that temporary files are visited inside Emacs.
---
 testing/lisp/test-ob-tangle.el  | 121 +-
 testing/lisp/test-org-attach.el | 147 
 2 files changed, 135 insertions(+), 133 deletions(-)

diff --git a/testing/lisp/test-ob-tangle.el b/testing/lisp/test-ob-tangle.el
index 2283037fc..35490f538 100644
--- a/testing/lisp/test-ob-tangle.el
+++ b/testing/lisp/test-ob-tangle.el
@@ -125,23 +125,24 @@ echo 1
 (ert-deftest ob-tangle/jump-to-org ()
   "Test `org-babel-tangle-jump-to-org' specifications."
   ;; Standard test.
-  (should
-   (equal
-"* H\n#+begin_src emacs-lisp\n1\n#+end_src"
-(org-test-with-temp-text-in-file
-"* H\n#+begin_src emacs-lisp\n1\n#+end_src"
-  (let ((file (buffer-file-name)))
-(org-test-with-temp-text
-(format ";; [[file:%s][H:1]]\n1\n;; H:1 ends here\n"
-(file-name-nondirectory file))
-  (org-babel-tangle-jump-to-org)
-  (buffer-string))
-  ;; Multiple blocks in the same section.
-  (should
-   (equal
-"2"
-(org-test-with-temp-text-in-file
-"* H
+  (let ((org-file-apps '((t . emacs
+(should
+ (equal
+  "* H\n#+begin_src emacs-lisp\n1\n#+end_src"
+  (org-test-with-temp-text-in-file
+  "* H\n#+begin_src emacs-lisp\n1\n#+end_src"
+	(let ((file (buffer-file-name)))
+  (org-test-with-temp-text
+  (format ";; [[file:%s][H:1]]\n1\n;; H:1 ends here\n"
+  (file-name-nondirectory file))
+(org-babel-tangle-jump-to-org)
+(buffer-string))
+;; Multiple blocks in the same section.
+(should
+ (equal
+  "2"
+  (org-test-with-temp-text-in-file
+  "* H
 
 first block
 
@@ -155,49 +156,49 @@ another block
 2
 #+end_src
 "
-  (let ((file (buffer-file-name)))
-(org-test-with-temp-text
-(format ";; [[file:%s][H:2]]\n2\n;; H:2 ends here\n"
-(file-name-nondirectory file))
-  (org-babel-tangle-jump-to-org)
-  (buffer-substring (line-beginning-position)
-(line-end-position)))
-  ;; Preserve position within the source code.
-  (should
-   (equal
-"1)"
-(org-test-with-temp-text-in-file
-"* H\n#+begin_src emacs-lisp\n(+ 1 1)\n#+end_src"
-  (let ((file (buffer-file-name)))
-(org-test-with-temp-text
-(format ";; [[file:%s][H:1]]\n(+ 1 1)\n;; H:1 ends here\n"
-(file-name-nondirectory file))
-  (org-babel-tangle-jump-to-org)
-  (buffer-substring-no-properties (point) (line-end-position)))
-  ;; Blocks before first heading.
-  (should
-   (equal
-"Buffer start\n#+begin_src emacs-lisp\n1\n#+end_src\n* H"
-(org-test-with-temp-text-in-file
-"Buffer start\n#+begin_src emacs-lisp\n1\n#+end_src\n* H"
-  (let ((file (buffer-file-name)))
-(org-test-with-temp-text
-(format ";; [[file:%s][H:1]]\n1\n;; H:1 ends here\n"
-(file-name-nondirectory file))
-  (org-babel-tangle-jump-to-org)
-  (buffer-string))
-  ;; Special case: buffer starts with a source block.
-  (should
-   (equal
-"#+begin_src emacs-lisp\n1\n#+end_src\n* H"
-(org-test-with-temp-text-in-file
-"#+begin_src emacs-lisp\n1\n#+end_src\n* H"
-  (let ((file (buffer-file-name)))
-(org-test-with-temp-text
-(format ";; [[file:%s][H:1]]\n1\n;; H:1 ends here\n"
-(file-name-nondirectory file))
-  (org-babel-tangle-jump-to-org)
-  

Re: Failing tests

2020-06-01 Thread Bastien
Kévin Le Gouguec  writes:

> Thanks for the pointer, and for applying the patches!
>
   FAILED  ob-tangle/jump-to-org
   FAILED  test-org-attach/dir

I have had both tests failing for a while without understanding why,
if this gets fixed as a side-effect of the incomplete fix I made for 
ob-C.el, I'd be very happy!

-- 
 Bastien



Re: Failing tests (was: Possible fix for :includes header argument in org-babel C source blocks)

2020-05-30 Thread Kyle Meyer
Kévin Le Gouguec writes:

> Kyle Meyer  writes:
>
>> The source for that page is in the worg repo:
>> https://code.orgmode.org/bzg/worg/src/master/org-contrib/babel/languages/ob-doc-C.org
>
> Thanks for the pointer, and for applying the patches!
>
   FAILED  ob-tangle/jump-to-org
   FAILED  test-org-attach/dir
>>
>> :(
>>
>> After your first patch, all tests now pass on my end.  Would you mind
>> posting the details of those failures in a new thread?
>
> Mmm, on further inspection, those tests fail on one of my setups but
> pass on another.
>
> I think I've narrowed this down to org-open-file running "less
> examples/att1/fileA" instead of visiting this file.
[...]
> Let-binding org-file-apps to '(("." . emacs)) makes the tests pass, but
> I don't know if that's the way we want to solve this.

Thanks for looking into the failures.  Let-binding org-file-apps sounds
like a good approach to me.  Rather than the catch-all regular
expression, I believe the value could be ((t . emacs)).



Failing tests (was: Possible fix for :includes header argument in org-babel C source blocks)

2020-05-29 Thread Kévin Le Gouguec
Kyle Meyer  writes:

> The source for that page is in the worg repo:
> https://code.orgmode.org/bzg/worg/src/master/org-contrib/babel/languages/ob-doc-C.org

Thanks for the pointer, and for applying the patches!

>>>   FAILED  ob-tangle/jump-to-org
>>>   FAILED  test-org-attach/dir
>
> :(
>
> After your first patch, all tests now pass on my end.  Would you mind
> posting the details of those failures in a new thread?

Mmm, on further inspection, those tests fail on one of my setups but
pass on another.

I think I've narrowed this down to org-open-file running "less
examples/att1/fileA" instead of visiting this file.

The following snippet returns "less '%s'" on the failing setup, and nil
on the passing one:

#+begin_src elisp
(mailcap-mime-info (mailcap-extension-to-mime ""))
#+end_src

IIUC this comes from /etc/mailcap; the failing setup (Xubuntu 18.04) has
an entry saying "less '%s'" for "text/plain"; the passing setup
(OpenSUSE Tumbleweed) simply has no /etc/mailcap.  mailcap-mime-info
falls back to "text/plain" when mailcap-extension-to-mime returns nil.

Let-binding org-file-apps to '(("." . emacs)) makes the tests pass, but
I don't know if that's the way we want to solve this.



Re: Failing tests

2020-04-21 Thread Marco Wahl
Kyle Meyer  writes:

> Marco Wahl  writes:
>
>> When building with "make test" I get
>>
>> #v+
>> 2 unexpected results:
>>FAILED  ob-tangle/jump-to-org
>>FAILED  test-org-attach/dir
>> #v-
>>
>> does this ring a bell for anybody?
>
> FWIW I don't see either failure on my end (Emacs 26.3).  Do they fail
> for you consistently?

Good to know that the tests pass on your side.

I'll check again and report in the case I find something interesting.


Thanks!
-- Marco



Re: Failing tests

2020-04-20 Thread Kyle Meyer
Marco Wahl  writes:

> When building with "make test" I get
>
> #v+
> 2 unexpected results:
>FAILED  ob-tangle/jump-to-org
>FAILED  test-org-attach/dir
> #v-
>
> does this ring a bell for anybody?

FWIW I don't see either failure on my end (Emacs 26.3).  Do they fail
for you consistently?



Failing tests

2020-04-17 Thread Marco Wahl
Dear all,

When building with "make test" I get

#v+
2 unexpected results:
   FAILED  ob-tangle/jump-to-org
   FAILED  test-org-attach/dir
#v-

does this ring a bell for anybody?


Best regards,
-- Marco




Re: [O] Backward incompatible outline-invisible-p change in emacs master for Org (Was: 6 failing tests on master branch)

2017-06-14 Thread Kaushal Modi
On Wed, Jun 14, 2017 at 10:56 AM Kaushal Modi 
wrote:

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

Here's a patch for the above proposed solution.

With that applied, 'make test' now passes cleanly on emacs master. Running
'make single' also looks good.
-- 

Kaushal Modi


0001-Fix-breakage-due-to-outline-invisible-p-defn-change-.patch
Description: Binary data


[O] Backward incompatible outline-invisible-p change in emacs master for Org (Was: 6 failing tests on master branch)

2017-06-14 Thread Kaushal Modi
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" ( 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 

Re: [O] 6 failing tests on master branch

2017-06-09 Thread Kaushal Modi
On Fri, Jun 9, 2017 at 4:05 PM Nicolas Goaziou 
wrote:

> Hello,
>
> Kaushal Modi  writes:
>
> > Here's a patch rebased off maint (as it's just test and manual change
> with
> > edits to a backward compatible Tramp syntax).
>
> LGTM.
>
> Thank you.
>

Thanks, pushed to maint, merged to master.
-- 

Kaushal Modi


Re: [O] 6 failing tests on master branch

2017-06-09 Thread Nicolas Goaziou
Hello,

Kaushal Modi  writes:

> Here's a patch rebased off maint (as it's just test and manual change with
> edits to a backward compatible Tramp syntax).

LGTM.

Thank you.

Regards,

-- 
Nicolas Goaziou0x80A93738



Re: [O] 6 failing tests on master branch

2017-06-09 Thread Kaushal Modi
On Fri, Jun 9, 2017 at 12:27 PM Nicolas Goaziou 
wrote:

> AFAIU, the function doesn't need to change, but the manual needs to be
> updated since, in (info "(org) External links") there is:
>
>  /myself@some.where:papers/last.pdfsame as above
>
> which is no longer a valid syntax.
>

Here's a patch rebased off maint (as it's just test and manual change with
edits to a backward compatible Tramp syntax).

There were some alignment issues in that External links section. So I have
fixed that too.
-- 

Kaushal Modi


0001-Update-remote-file-syntax-for-Tramp.patch
Description: Binary data


Re: [O] 6 failing tests on master branch

2017-06-09 Thread Nicolas Goaziou
Hello,

Kaushal Modi  writes:

> Does org-export-file-uri need to change? Because now
>
> (org-export-file-uri "/ssh:myself@some.where:papers/last.pdf")
>
> returns
>
> "file://ssh:myself@some.where:papers/last.pdf"

AFAIU, the function doesn't need to change, but the manual needs to be
updated since, in (info "(org) External links") there is:

 /myself@some.where:papers/last.pdfsame as above

which is no longer a valid syntax.

Regards,

-- 
Nicolas Goaziou0x80A93738



Re: [O] 6 failing tests on master branch

2017-06-09 Thread Kaushal Modi
On Fri, Jun 9, 2017 at 12:02 PM Michael Albinus 
wrote:

> Kaushal Modi  writes:
>
> The stronger Tramp file name syntax requires now a method. Something
> like "/ssh:myself@some.where:papers/last.pdf". This is backward
> compatible with Emacs 25, 24, etc pp.
>

Thanks for the quick reply!

@Nicholas

Does org-export-file-uri need to change? Because now

(org-export-file-uri "/ssh:myself@some.where:papers/last.pdf")

returns

"file://ssh:myself@some.where:papers/last.pdf"
-- 

Kaushal Modi


Re: [O] 6 failing tests on master branch

2017-06-09 Thread Michael Albinus
Kaushal Modi  writes:

> This seems to be related to a tramp file notation change on emacs
> master. I don't use tramp, but I heard about it on emacs-devel.

Indeed.

> Here is a test expression:
>
> (find-file-name-handler "/myself@some.where:papers/last.pdf"
> 'file-remote-p)
>
> On emacs 25.2, that returns tramp-file-name-handler.
> On emacs master, that returns nil.
>
> @Michael How should the above find-file-name-handler arg change to
> support that test file path?

The stronger Tramp file name syntax requires now a method. Something
like "/ssh:myself@some.where:papers/last.pdf". This is backward
compatible with Emacs 25, 24, etc pp.

> Thanks.

Best regards, Michael.



Re: [O] 6 failing tests on master branch

2017-06-09 Thread Kaushal Modi
On Fri, Jun 9, 2017 at 10:26 AM Kaushal Modi  wrote:

> This one should be easy to debug since
>>
>>   (org-export-file-uri "/myself@some.where:papers/last.pdf")
>>
>> is easy to reproduce. Could you investigate where the spurious "/" comes
>> from?
>>
>
> Will do.
>

This seems to be related to a tramp file notation change on emacs master. I
don't use tramp, but I heard about it on emacs-devel.

Here is a test expression:

(find-file-name-handler "/myself@some.where:papers/last.pdf"
'file-remote-p)

On emacs 25.2, that returns tramp-file-name-handler.
On emacs master, that returns nil.

So, on emacs 25.2, in org-export-file-uri, the (org-file-remote-p filename)
case evaluates to true. Whereas, on emacs master, the execution falls into
the default (t ..) case.

.. and thus the spurious "/".

Copying the tramp dev Michael Albinus on this for help.
@Michael How should the above find-file-name-handler arg change to support
that test file path?

Thanks.
-- 

Kaushal Modi


Re: [O] 6 failing tests on master branch

2017-06-09 Thread Kaushal Modi
On Thu, Jun 8, 2017 at 5:10 PM Nicolas Goaziou 
wrote:

> > I remember reading that someone else too saw the fortran errors.. Is it
> > because I don't have fortran on my system?
>
> No, I don't think so. OTOH, I have no idea about where this comes from.
>

Did little digging, TIL that the gfortran binary is part of GCC.. as
gfortran binary. So I do have fortran, but I never use it.

Also found out why fortran tests were failing for me.. by default the gcc
version on my system (RHEL 6.6) is 4.4.7. Using GCC 6.1.0 passes the full
"make test" on emacs 25.2.

For example, this is one of the ob-fortran examples that was failing:

* matrix
  :PROPERTIES:
  :ID:   3f73ab19-d25a-428d-8c26-e8c6aa933976
  :END:
Real matrix as input
#+name: fortran-input-matrix1
| 0.0 | 42.0 |
| 0.0 |  0.0 |
| 0.0 |  0.0 |

#+name: fortran-input-matrix2
| 0.0 | 0.0 | 0.0 |
| 0.0 | 0.0 | 42.0 |

#+begin_src fortran :var s=fortran-input-matrix1 :results silent
write (*, '(i2)'), nint(s(1,2))
#+end_src

#+begin_src fortran :var s=fortran-input-matrix2 :results silent
write (*, '(i2)'), nint(s(2,3))
#+end_src

Doing C-c C-c on the first source block gives this error with gcc 4.4.7:

/tmp/babel-6872M6V/fortran-src-6872rcR.F90:4.27:

real, parameter :: s(3,2) = transpose( reshape( (/(/0.0, 42.0/), (/0.0,
0.0/),
   1
Error: transformational intrinsic 'transpose' at (1) is not permitted in an
initialization expression
/bin/sh: /tmp/babel-6872M6V/fortran-bin-68724mX: Permission denied

That expression is apparently legal in newer fortran, is my guess.


> > About the other 3 errors:
>
> Since our buildbot doesn't report any problem, this seems specific to
> Emacs master.
>

Thanks. I confirm that make test on org master passes with emacs 25.2.

> Test test-org-export/file-uri condition:
> > (ert-test-failed
> >  ((should
> >(equal "file://myself@some.where:papers/last.pdf"
> >   (org-export-file-uri "/myself@some.where
> :papers/last.pdf")))
> >   :form
> >   (equal "file://myself@some.where:papers/last.pdf"
> > "file:///myself@some.where:papers/last.pdf")
> >   :value nil :explanation
> >   (arrays-of-different-length 40 41
> > "file://myself@some.where:papers/last.pdf"
> > "file:///myself@some.where:papers/last.pdf" first-mismatch-at 7)))
>
> This one should be easy to debug since
>
>   (org-export-file-uri "/myself@some.where:papers/last.pdf")
>
> is easy to reproduce. Could you investigate where the spurious "/" comes
> from?
>

Will do.


> >FAILED  646/734  test-org/custom-properties
> >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.
>

I'll have to leave this for a future debug.. Someone else wants to help out
with this?


> You can run, e.g.,
>
>   BTEST_RE="foo" make test
>

Thanks!
-- 

Kaushal Modi


Re: [O] 6 failing tests on master branch

2017-06-08 Thread Nicolas Goaziou
Hello,

Kaushal Modi  writes:

> 6 unexpected results:
>FAILED  ob-fortran/list-matrix-from-table1
>FAILED  ob-fortran/list-matrix-from-table2
>FAILED  ob-fortran/list-var-from-table
>FAILED  test-org-export/file-uri
>FAILED  test-org/custom-properties
>FAILED  test-org/forward-paragraph
>
> I remember reading that someone else too saw the fortran errors.. Is it
> because I don't have fortran on my system?

No, I don't think so. OTOH, I have no idea about where this comes from.

> About the other 3 errors:

Since our buildbot doesn't report any problem, this seems specific to
Emacs master.

> Test test-org-export/file-uri condition:
> (ert-test-failed
>  ((should
>(equal "file://myself@some.where:papers/last.pdf"
>   (org-export-file-uri "/myself@some.where:papers/last.pdf")))
>   :form
>   (equal "file://myself@some.where:papers/last.pdf"
> "file:///myself@some.where:papers/last.pdf")
>   :value nil :explanation
>   (arrays-of-different-length 40 41
> "file://myself@some.where:papers/last.pdf"
> "file:///myself@some.where:papers/last.pdf" first-mismatch-at 7)))

This one should be easy to debug since 

  (org-export-file-uri "/myself@some.where:papers/last.pdf")

is easy to reproduce. Could you investigate where the spurious "/" comes
from?

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

> I have an unrelated make test question too.
>
> If I add a test, say test-org/foo, in order to make learning ert and org
> test writing faster, it is possible to run just that one test-org/foo and
> not the whole suite?

You can run, e.g.,

  BTEST_RE="foo" make test


Regards,

-- 
Nicolas Goaziou



[O] 6 failing tests on master branch

2017-06-08 Thread Kaushal Modi
Hello,

I ran make test today using the latest version of org master branch (and
latest of emacs master), and I see 6 failures:

6 unexpected results:
   FAILED  ob-fortran/list-matrix-from-table1
   FAILED  ob-fortran/list-matrix-from-table2
   FAILED  ob-fortran/list-var-from-table
   FAILED  test-org-export/file-uri
   FAILED  test-org/custom-properties
   FAILED  test-org/forward-paragraph

I remember reading that someone else too saw the fortran errors.. Is it
because I don't have fortran on my system?

About the other 3 errors:

Test test-org-export/file-uri condition:
(ert-test-failed
 ((should
   (equal "file://myself@some.where:papers/last.pdf"
  (org-export-file-uri "/myself@some.where:papers/last.pdf")))
  :form
  (equal "file://myself@some.where:papers/last.pdf"
"file:///myself@some.where:papers/last.pdf")
  :value nil :explanation
  (arrays-of-different-length 40 41
"file://myself@some.where:papers/last.pdf"
"file:///myself@some.where:papers/last.pdf" first-mismatch-at 7)))
   FAILED  406/734  test-org-export/file-uri

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

---

I have an unrelated make test question too.

If I add a test, say test-org/foo, in order to make learning ert and org
test writing faster, it is possible to run just that one test-org/foo and
not the whole suite?
-- 

Kaushal Modi