branch: elpa/dirvish commit 08d0a6b3d22864fde652198e964e2d706b6b175b Author: Alex Lu <hellosimon1...@hotmail.com> Commit: Alex Lu <hellosimon1...@hotmail.com>
fix(core): guard around null `dirvish-curr` for mode-line (#298) --- dirvish.el | 6 +++--- docs/CUSTOMIZING.org | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/dirvish.el b/dirvish.el index a2b9af7cb3..3ed45f465a 100644 --- a/dirvish.el +++ b/dirvish.el @@ -1015,8 +1015,8 @@ LEFT and RIGHT are segments aligned to left/right respectively. If HEADER, set the `dirvish--header-line-fmt' instead." `((:eval (let* ((dv (dirvish-curr)) - (fullframe-p (dv-curr-layout dv)) - (buf (cdr (dv-index dv))) + (fullframe-p (and dv (dv-curr-layout dv))) + (buf (and dv (cdr (dv-index dv)))) (expand (lambda (segs) (cl-loop for s in segs collect @@ -1029,7 +1029,7 @@ If HEADER, set the `dirvish--header-line-fmt' instead." ((integerp ml-height) (/ (float ml-height) default)) (t 1))) (win-width (floor (/ (window-width) scale))) - (str-l "DIRVISH: Context buffer is not a live buffer") + (str-l "DIRVISH: Context buffer is not a Dirvish buffer") (str-r (propertize "WARNING" 'face 'dired-warning)) (len-r 7)) (when (buffer-live-p buf) diff --git a/docs/CUSTOMIZING.org b/docs/CUSTOMIZING.org index 67b83c4d03..7e15be5e5f 100644 --- a/docs/CUSTOMIZING.org +++ b/docs/CUSTOMIZING.org @@ -232,14 +232,14 @@ Dired, you can create a directory previewer that utilizes the ~eza~ command: #+begin_src emacs-lisp (dirvish-define-preview eza (file) - "Use `exa' to generate directory preview." + "Use `eza' to generate directory preview." :require ("eza") ; tell Dirvish to check if we have the executable (when (file-directory-p file) ; we only interest in directories here `(shell . ("eza" "-al" "--color=always" "--icons=always" "--group-directories-first" ,file)))) (setq dirvish-preview-dispatchers - (cl-substitute 'dired 'exa dirvish-preview-dispatchers)) + (cl-substitute 'eza 'dired dirvish-preview-dispatchers)) #+end_src This makes Dirvish use the output from ~exa~ shell command as your preview content