]> git.eshelyaron.com Git - emacs.git/commitdiff
Improve support of display-line-numbers in package.el
authorEli Zaretskii <eliz@gnu.org>
Sat, 19 Aug 2017 11:05:51 +0000 (14:05 +0300)
committerEli Zaretskii <eliz@gnu.org>
Sat, 19 Aug 2017 11:05:51 +0000 (14:05 +0300)
* lisp/emacs-lisp/package.el (package-menu--refresh): Redisplay
the header.  (Bug#27895)
* lisp/emacs-lisp/tabulated-list.el
(tabulated-list-line-number-width): Fix the case when
display-line-numbers is nil.

lisp/emacs-lisp/package.el
lisp/emacs-lisp/tabulated-list.el

index 4245294457f65b8613994c43db6cc80dd7d5aa62..2404ccd14e91ec0d10e6db572b0e64cf78974eaf 100644 (file)
@@ -2751,6 +2751,7 @@ KEYWORDS should be nil or a list of keywords."
               (push pkg info-list))))))
 
     ;; Print the result.
+    (tabulated-list-init-header)
     (setq tabulated-list-entries
           (mapcar #'package-menu--print-info-simple info-list))))
 
index f900354b3f286c63849836be5e15ec1b510fc6fe..6844c25b1aa14c1ec78d8bc80b66ed1b5b484a6f 100644 (file)
@@ -191,11 +191,13 @@ Populated by `tabulated-list-init-header'.")
   ;; line-number-display-width returns the value for the selected
   ;; window, which might not be the window in which the current buffer
   ;; is displayed.
-  (let ((cbuf-window (get-buffer-window (current-buffer))))
-    (if (window-live-p cbuf-window)
-        (with-selected-window cbuf-window
-          (+ (line-number-display-width) 2))
-      (if display-line-numbers 4 0))))
+  (if (not display-line-numbers)
+           0
+    (let ((cbuf-window (get-buffer-window (current-buffer))))
+      (if (window-live-p cbuf-window)
+          (with-selected-window cbuf-window
+            (+ (line-number-display-width) 2))
+        4))))
 
 (defun tabulated-list-init-header ()
   "Set up header line for the Tabulated List buffer."