From 2cf2d522818c75ff5626324251bb74cdc3c36dc7 Mon Sep 17 00:00:00 2001 From: Joseph Turner Date: Sat, 6 May 2023 14:49:43 -0700 Subject: [PATCH] Fix: (package-vc--build-documentation) Relative @include statements --- lisp/emacs-lisp/package-vc.el | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lisp/emacs-lisp/package-vc.el b/lisp/emacs-lisp/package-vc.el index 476c38916a8..65767cf043a 100644 --- a/lisp/emacs-lisp/package-vc.el +++ b/lisp/emacs-lisp/package-vc.el @@ -376,14 +376,17 @@ Package specs are loaded from trusted package archives." FILE can be an Org file, indicated by its \".org\" extension, otherwise it's assumed to be an Info file." (let* ((pkg-name (package-desc-name pkg-desc)) - (default-directory (package-desc-dir pkg-desc)) + (file-path (expand-file-name file (package-desc-dir pkg-desc))) + ;; `let'-bind `default-directory' to the directory containing the .org or .info FILE + ;; so that makeinfo can resolve relative @include statements in the docs directory. + (default-directory (expand-file-name (file-name-directory file-path))) (output (expand-file-name (format "%s.info" pkg-name))) clean-up) (when (string-match-p "\\.org\\'" file) (require 'ox) (require 'ox-texinfo) (with-temp-buffer - (insert-file-contents file) + (insert-file-contents file-path) (setq file (make-temp-file "ox-texinfo-")) (org-export-to-file 'texinfo file) (setq clean-up t))) -- 2.39.2