Mark +org-dir obsolete (use org-directory instead)

I prefer not to invent new variables when they aren't strictly
necessary. org-directory is one such variable (although the other path
variables are still necessary).
This commit is contained in:
Henrik Lissner
2018-06-15 00:45:26 +02:00
parent db8b4091dd
commit 6693db48af
8 changed files with 30 additions and 33 deletions

View File

@@ -23,17 +23,17 @@
(when (executable-find "pandoc")
(require 'ox-pandoc))
;; Export to a central location by default or if target isn't in `+org-dir'.
(setq org-export-directory (expand-file-name ".export" +org-dir))
;; Export to a central location by default or if target isn't in `org-directory'.
(setq org-export-directory (expand-file-name ".export" org-directory))
(unless (file-directory-p org-export-directory)
(make-directory org-export-directory t))
(defun +org*export-output-file-name (args)
"Return a centralized export location unless one is provided or the current
file isn't in `+org-dir'."
file isn't in `org-directory'."
(when (and (not (nth 2 args))
buffer-file-name
(file-in-directory-p (file-truename buffer-file-name) (file-truename +org-dir)))
(file-in-directory-p (file-truename buffer-file-name) (file-truename org-directory)))
(setq args (append args (list org-export-directory))))
args)
(advice-add #'org-export-output-file-name :filter-args #'+org*export-output-file-name))