From mboxrd@z Thu Jan 1 00:00:00 1970 From: Richard Hansen Subject: [PATCH] fix SETUPFILE pathname expansion with subdirectories Date: Fri, 18 Sep 2015 20:22:01 -0400 Message-ID: <1442622121-25638-1-git-send-email-rhansen@bbn.com> Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:45205) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zd5vB-0007eq-Jr for emacs-orgmode@gnu.org; Fri, 18 Sep 2015 20:22:33 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Zd5v6-0000Zq-Lb for emacs-orgmode@gnu.org; Fri, 18 Sep 2015 20:22:29 -0400 Received: from smtp.bbn.com ([128.33.1.81]:20822) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zd5v6-0000ZA-Iz for emacs-orgmode@gnu.org; Fri, 18 Sep 2015 20:22:24 -0400 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-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org Cc: 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