Fix some file permissions errors

Occurs when deferred packages are loaded while in an unreadable or
non-existent directory.
This commit is contained in:
Henrik Lissner 2019-08-26 20:36:39 -04:00
parent 43ebba886f
commit 8766499b0d
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395
4 changed files with 19 additions and 7 deletions

View file

@ -40,7 +40,8 @@ flycheck issues with direnv and on nix."
"Don't try to update direnv if the executable isn't present."
:around #'direnv--maybe-update-environment
(if (executable-find "direnv")
(funcall orig-fn)
(when (file-readable-p (or buffer-file-name default-directory))
(funcall orig-fn))
(doom-log "Couldn't find direnv executable")))
(direnv-mode +1))

View file

@ -288,10 +288,10 @@ controlled by `+doom-dashboard-pwd-policy'."
(doom-log "Changed dashboard's PWD to %s" pwd)
(setq-local default-directory pwd))
(let ((new-pwd (+doom-dashboard--get-pwd)))
(when (and new-pwd (file-directory-p new-pwd))
(unless (string-suffix-p "/" new-pwd)
(setq new-pwd (concat new-pwd "/")))
(+doom-dashboard-update-pwd new-pwd)))))
(when (and new-pwd (file-accessible-directory-p new-pwd))
(+doom-dashboard-update-pwd
(concat (directory-file-name new-pwd)
"/"))))))
(defun +doom-dashboard-reload (&optional force)
"Update the DOOM scratch buffer (or create it, if it doesn't exist)."