diff options
author | K. Handa <handa@gnu.org> | 2017-10-08 11:56:06 +0900 |
---|---|---|
committer | K. Handa <handa@gnu.org> | 2017-10-08 11:56:06 +0900 |
commit | a9b72976deec9b266950865581a626ec8f7b74f4 (patch) | |
tree | 7b5fb778bad612133b54ea3a39aa8356b6bdbaf7 /lisp/emacs-lisp/tabulated-list.el | |
parent | 64baaff8c5f70b7d637ac37304c4377e955b3f09 (diff) | |
parent | c194fb61c638490e3510864fe2750814af8c3719 (diff) | |
download | emacs-a9b72976deec9b266950865581a626ec8f7b74f4.tar.gz emacs-a9b72976deec9b266950865581a626ec8f7b74f4.tar.bz2 emacs-a9b72976deec9b266950865581a626ec8f7b74f4.zip |
Merge branch 'emacs-26' of git.sv.gnu.org:/srv/git/emacs into emacs-26
Diffstat (limited to 'lisp/emacs-lisp/tabulated-list.el')
-rw-r--r-- | lisp/emacs-lisp/tabulated-list.el | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/lisp/emacs-lisp/tabulated-list.el b/lisp/emacs-lisp/tabulated-list.el index e940588db7b..d1d7c0a8042 100644 --- a/lisp/emacs-lisp/tabulated-list.el +++ b/lisp/emacs-lisp/tabulated-list.el @@ -329,6 +329,8 @@ Check the current row, the previous one and the next row." (string-width (if (stringp nt) nt (car nt))))) tabulated-list--near-rows))) +(defvar tabulated-list-entry-lnum-width nil) + (defun tabulated-list-print (&optional remember-pos update) "Populate the current Tabulated List mode buffer. This sorts the `tabulated-list-entries' list if sorting is @@ -371,6 +373,7 @@ changing `tabulated-list-sort-key'." (unless tabulated-list-use-header-line (tabulated-list-print-fake-header))) ;; Finally, print the resulting list. + (setq tabulated-list-entry-lnum-width (tabulated-list-line-number-width)) (while entries (let* ((elt (car entries)) (tabulated-list--near-rows @@ -383,7 +386,7 @@ changing `tabulated-list-sort-key'." (equal entry-id id) (setq entry-id nil saved-pt (point))) - ;; If the buffer this empty, simply print each elt. + ;; If the buffer is empty, simply print each elt. (if (or (not update) (eobp)) (apply tabulated-list-printer elt) (while (let ((local-id (tabulated-list-get-id))) @@ -424,12 +427,10 @@ of column descriptors." (let ((beg (point)) (x (max tabulated-list-padding 0)) (ncols (length tabulated-list-format)) - (lnum-width (tabulated-list-line-number-width)) (inhibit-read-only t)) - (if display-line-numbers - (setq x (+ x lnum-width))) + (setq x (+ x tabulated-list-entry-lnum-width)) (if (> tabulated-list-padding 0) - (insert (make-string (- x lnum-width) ?\s))) + (insert (make-string (- x tabulated-list-entry-lnum-width) ?\s))) (let ((tabulated-list--near-rows ; Bind it if not bound yet (Bug#25506). (or (bound-and-true-p tabulated-list--near-rows) (list (or (tabulated-list-get-entry (point-at-bol 0)) |