diff options
author | Eli Zaretskii <eliz@gnu.org> | 2017-08-19 14:05:51 +0300 |
---|---|---|
committer | Eli Zaretskii <eliz@gnu.org> | 2017-08-19 14:05:51 +0300 |
commit | 2c7721373836633557975cc583677dfd8997e764 (patch) | |
tree | e56cafd58bdab8d4c9f87877a71dc247bc7eac42 /lisp/emacs-lisp/tabulated-list.el | |
parent | 5070717802d9be51085d187a10a5f4930b9a1471 (diff) | |
download | emacs-2c7721373836633557975cc583677dfd8997e764.tar.gz emacs-2c7721373836633557975cc583677dfd8997e764.tar.bz2 emacs-2c7721373836633557975cc583677dfd8997e764.zip |
Improve support of display-line-numbers in package.el
* 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.
Diffstat (limited to 'lisp/emacs-lisp/tabulated-list.el')
-rw-r--r-- | lisp/emacs-lisp/tabulated-list.el | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/lisp/emacs-lisp/tabulated-list.el b/lisp/emacs-lisp/tabulated-list.el index f900354b3f2..6844c25b1aa 100644 --- a/lisp/emacs-lisp/tabulated-list.el +++ b/lisp/emacs-lisp/tabulated-list.el @@ -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." |