]> git.eshelyaron.com Git - emacs.git/commitdiff
* lisp/emacs-lisp/tabulated-list.el (tabulated-list-print): Fix bug
authorArtur Malabarba <bruce.connor.am@gmail.com>
Fri, 31 Jul 2015 11:51:04 +0000 (12:51 +0100)
committerArtur Malabarba <bruce.connor.am@gmail.com>
Fri, 31 Jul 2015 11:51:22 +0000 (12:51 +0100)
When updating the very last entry, tabulated-list-print would
erase it and then try to look at the next one (which obviously
isn't there).

lisp/emacs-lisp/tabulated-list.el

index 9119c3a5adeb4e7fdd3c9ec668b79d3ee8d91151..cd61eb9ae56afefc7f691976ac607d5aeba313d5 100644 (file)
@@ -356,10 +356,11 @@ changing `tabulated-list-sort-key'."
                           nil)
                          ;; If this entry sorts after id (or it's the
                          ;; end), then just insert id and move on.
-                         ((funcall sorter elt
-                                   ;; FIXME: Might be faster if
-                                   ;; don't construct this list.
-                                   (list local-id (tabulated-list-get-entry)))
+                         ((or (not local-id)
+                              (funcall sorter elt
+                                       ;; FIXME: Might be faster if
+                                       ;; don't construct this list.
+                                       (list local-id (tabulated-list-get-entry))))
                           (apply tabulated-list-printer elt)
                           nil)
                          ;; We find an entry that sorts before id,