Skip to content

Commit

Permalink
Mimic some aspects of file visiting.
Browse files Browse the repository at this point in the history
Set ‘default-directory’ to the directory of the visited file so that relative
filenames are interpreted correctly.
  • Loading branch information
phst committed Sep 17, 2024
1 parent 05e3c01 commit 40adffa
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion elisp/export-org.el
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,8 @@
(org-export-time-stamp-file nil)
(org-export-use-babel nil))
(with-temp-buffer
(insert-file-contents input)
(insert-file-contents input :visit)
(setq default-directory (file-name-directory input))
(write-region (org-export-as 'texinfo) nil output))))
(_ (user-error "Usage: elisp/export-org INPUT OUTPUT")))

Expand Down

0 comments on commit 40adffa

Please sign in to comment.