refactor(mu4e): use doom-call-process to check XDG
This is a bit safer than shell-command-to-string, and we also now check that the command exited successfully, and fall back if not.
This commit is contained in:
parent
7ab825157f
commit
083c81e44b
1 changed files with 5 additions and 4 deletions
|
@ -53,13 +53,14 @@
|
||||||
(t #'ido-completing-read))
|
(t #'ido-completing-read))
|
||||||
mu4e-attachment-dir
|
mu4e-attachment-dir
|
||||||
(concat
|
(concat
|
||||||
(if (executable-find "xdg-user-dir")
|
(if-let ((xdg-download-query (and (executable-find "xdg-user-dir")
|
||||||
;; remove trailing newline
|
(doom-call-process "xdg-user-dir" "DOWNLOAD")))
|
||||||
(substring (shell-command-to-string "xdg-user-dir DOWNLOAD") 0 -1)
|
(xdg-download-dir (and (= 0 (car xdg-download-query)) (cdr xdg-download-query))))
|
||||||
|
xdg-download-dir
|
||||||
(expand-file-name (or (getenv "XDG_DOWNLOAD_DIR")
|
(expand-file-name (or (getenv "XDG_DOWNLOAD_DIR")
|
||||||
"Downloads")
|
"Downloads")
|
||||||
"~"))
|
"~"))
|
||||||
"/")
|
"/") ; a trailing / makes it easier to change directory in `read-file-name'
|
||||||
;; no need to ask
|
;; no need to ask
|
||||||
mu4e-confirm-quit nil
|
mu4e-confirm-quit nil
|
||||||
mu4e-headers-thread-single-orphan-prefix '("─>" . "─▶")
|
mu4e-headers-thread-single-orphan-prefix '("─>" . "─▶")
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue