]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix up previous list-buffers patch to work when there's no buffer
authorLars Ingebrigtsen <larsi@gnus.org>
Sat, 8 Aug 2020 11:01:42 +0000 (13:01 +0200)
committerLars Ingebrigtsen <larsi@gnus.org>
Sat, 8 Aug 2020 11:01:42 +0000 (13:01 +0200)
* lisp/buff-menu.el (Buffer-menu--dynamic-name-width): Use apply
#'max instead of seq-max since the list may be empty.

lisp/buff-menu.el

index 359d6381e8b6dc9b9327c150c9946de12fe55560..aa5c47ca7f40d0b3a8ef909700550e3556796d50 100644 (file)
@@ -77,9 +77,9 @@ but will never be narrower than 19 characters."
        ;; This gives 19 on an 80 column window, and take up
        ;; proportionally more space as the window widens.
        (min (truncate (/ (window-width) 4.2))
-            (seq-max (mapcar (lambda (b)
-                               (length (buffer-name b)))
-                             buffers)))))
+            (apply #'max 0 (mapcar (lambda (b)
+                                     (length (buffer-name b)))
+                                   buffers)))))
 
 (defcustom Buffer-menu-name-width #'Buffer-menu--dynamic-name-width
   "Width of buffer name column in the Buffer Menu.