]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix dired--insert-disk-space
authorMichael Albinus <michael.albinus@gmx.de>
Fri, 3 Dec 2021 14:50:09 +0000 (15:50 +0100)
committerMichael Albinus <michael.albinus@gmx.de>
Fri, 3 Dec 2021 14:50:09 +0000 (15:50 +0100)
* lisp/dired.el (dired--insert-disk-space): Handle case
`get-free-disk-space' returns nil.

lisp/dired.el

index d03c79df40d5b5171f2996d5e5af3046d641c116..d0e547ba0b157388faf3db50ca0129c7d3c0f311 100644 (file)
@@ -1650,7 +1650,7 @@ see `dired-use-ls-dired' for more details.")
         ;; Replace "total" with "total used in directory" to
         ;; avoid confusion.
         (replace-match "total used in directory" nil nil nil 1))
-      (when-let ((available (get-free-disk-space file)))
+      (if-let ((available (get-free-disk-space file)))
         (cond
          ((eq dired-free-space 'separate)
          (end-of-line)
@@ -1672,7 +1672,8 @@ see `dired-use-ls-dired' for more details.")
           (forward-line 1)
           (point))
          (t
-          beg))))))
+          beg))
+        beg))))
 
 (defun dired-insert-set-properties (beg end)
   "Add various text properties to the lines in the region, from BEG to END."