Skip to content

Commit aa5814c

Browse files
committed
tweak(core): better automatic detection of Org directory
1 parent eb2bf18 commit aa5814c

File tree

1 file changed

+11
-10
lines changed

1 file changed

+11
-10
lines changed

core/me-vars.el

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -109,21 +109,22 @@ environment variable \"$MINEMACS_IGNORE_USER_CONFIG\".")
109109
(or (getenv "MINEMACS_ORG_DIR")
110110
(seq-find #'file-directory-p
111111
(cl-loop
112-
for dir in `(,(expand-file-name "Org" minemacs-config-dir)
113-
,(expand-file-name "~/Org")
114-
,@(when-let* ((dir (getenv "XDG_DOCUMENTS_DIR"))) (list (expand-file-name "Org" dir)))
115-
,(expand-file-name "~/Documents/Org"))
116-
collect dir
117-
collect (expand-file-name (downcase (file-name-nondirectory dir)) (file-name-directory dir)))))
112+
for dir in `(,(expand-file-name "org" minemacs-config-dir)
113+
,(expand-file-name "~/org")
114+
,@(when-let* ((dir (getenv "XDG_DOCUMENTS_DIR"))) (list (expand-file-name "org" dir)))
115+
,(expand-file-name "~/Documents/org"))
116+
append (cl-loop
117+
for func in '(downcase upcase capitalize)
118+
collect (expand-file-name (funcall func (file-name-nondirectory dir)) (file-name-directory dir))))))
118119
"The default directory to use for `org-directory'.
119120
If environment variable \"MINEMACS_ORG_DIR\" is defined, it gets used,
120121
else, the first existing directory of the following list will be
121122
used (all small case, or title case):
122123
123-
- `minemacs-config-dir'/{Org,org}
124-
- $HOME/{Org,org}
125-
- $XDG_DOCUMENTS_DIR/{Org,org}
126-
- $HOME/Documents/{Org,org}.")
124+
- `minemacs-config-dir'/{Org,org,ORG}
125+
- $HOME/{Org,org,ORG}
126+
- $XDG_DOCUMENTS_DIR/{Org,org,ORG}
127+
- $HOME/Documents/{Org,org,ORG}.")
127128

128129
(defconst minemacs-started-with-extra-args-p (and (cdr command-line-args) t) "Has Emacs been started with extras arguments? like a file name or so.")
129130

0 commit comments

Comments
 (0)