Fix up previous list-buffers patch to work when there's no buffer

* lisp/buff-menu.el (Buffer-menu--dynamic-name-width): Use apply
#'max instead of seq-max since the list may be empty.
This commit is contained in:
Lars Ingebrigtsen 2020-08-08 13:01:42 +02:00
parent 119c34cc0a
commit f07bbb67d1

View file

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