Re: [O] [PATCH] fix SETUPFILE pathname expansion with subdirectories

2015-09-19 Thread Richard Hansen
On 2015-09-19 04:16, Nicolas Goaziou wrote:
> Hello,
> 
> Richard Hansen  writes:
> 
>> * lisp/org.el (org--setup-collect-keywords): cd to the directory
>> containing the SETUPFILE before recursing so that relative pathnames
>> in the SETUPFILE are expanded properly.
>>
>> * lisp/ox.el (org-export--get-inbuffer-options): cd to the directory
>> containing the SETUPFILE before recursing so that relative pathnames
>> in the SETUPFILE are expanded properly.
>>
>> If /path/to/foo.org contains:
>>
>> #+SETUPFILE: settings/beamer.org
>>
>> and /path/to/settings/beamer.org contains:
>>
>> #+SETUPFILE: common.org
>>
>> then we want to read /path/to/settings/common.org, not
>> /path/to/common.org.
>>
>> TINYCHANGE
> 
> Thank you.
> 
> Could you also provide add a test for it in "test-org.el"
> (test-org/set-regexps-and-options)?

I'm having trouble running the test suite.  'make test' freezes at:

  test-ob-shell/dont-insert-spaces-on-expanded-bodies

If I comment out that test, it hangs at:

  test-ob-shell/dont-error-on-empty-results

If I comment out that test, it gets stuck at:

  test-ob-python/colnames-yes-header-argument-again

I haven't yet tried commenting out that test because I feel like I'm
doing something wrong.  Any hints?  (Emacs 24.4.1 from Ubuntu 15.04)

Thanks,
Richard



Re: [O] [PATCH] fix SETUPFILE pathname expansion with subdirectories

2015-09-19 Thread Nicolas Goaziou
Hello,

Richard Hansen  writes:

> * lisp/org.el (org--setup-collect-keywords): cd to the directory
> containing the SETUPFILE before recursing so that relative pathnames
> in the SETUPFILE are expanded properly.
>
> * lisp/ox.el (org-export--get-inbuffer-options): cd to the directory
> containing the SETUPFILE before recursing so that relative pathnames
> in the SETUPFILE are expanded properly.
>
> If /path/to/foo.org contains:
>
> #+SETUPFILE: settings/beamer.org
>
> and /path/to/settings/beamer.org contains:
>
> #+SETUPFILE: common.org
>
> then we want to read /path/to/settings/common.org, not
> /path/to/common.org.
>
> TINYCHANGE

Thank you.

Could you also provide add a test for it in "test-org.el"
(test-org/set-regexps-and-options)?


Regards,

-- 
Nicolas Goaziou



[O] [PATCH] fix SETUPFILE pathname expansion with subdirectories

2015-09-18 Thread Richard Hansen
* lisp/org.el (org--setup-collect-keywords): cd to the directory
containing the SETUPFILE before recursing so that relative pathnames
in the SETUPFILE are expanded properly.

* lisp/ox.el (org-export--get-inbuffer-options): cd to the directory
containing the SETUPFILE before recursing so that relative pathnames
in the SETUPFILE are expanded properly.

If /path/to/foo.org contains:

#+SETUPFILE: settings/beamer.org

and /path/to/settings/beamer.org contains:

#+SETUPFILE: common.org

then we want to read /path/to/settings/common.org, not
/path/to/common.org.

TINYCHANGE
---
 lisp/org.el | 1 +
 lisp/ox.el  | 1 +
 2 files changed, 2 insertions(+)

diff --git a/lisp/org.el b/lisp/org.el
index 74fe4ae..ded3e13 100755
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -5194,6 +5194,7 @@ Return value contains the following keys: `archive', 
`category',
(org-remove-double-quotes value)
   (when (and f (file-readable-p f) (not (member f files)))
 (with-temp-buffer
+  (cd (file-name-directory f))
   (insert-file-contents f)
   (setq alist
 ;; Fake Org mode to benefit from cache
diff --git a/lisp/ox.el b/lisp/ox.el
index bfdfeba..07e5ef3 100644
--- a/lisp/ox.el
+++ b/lisp/ox.el
@@ -1455,6 +1455,7 @@ Assume buffer is in Org mode.  Narrowing, if any, is 
ignored."
 ;; Avoid circular dependencies.
 (unless (member file files)
   (with-temp-buffer
+(cd (file-name-directory file))
 (insert (org-file-contents file 'noerror))
 (let ((org-inhibit-startup t)) (org-mode))
 (setq plist (funcall get-options
-- 
2.5.3