emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master 4de13ef: Signal a better error in tabulated-list-sort


From: Lars Ingebrigtsen
Subject: master 4de13ef: Signal a better error in tabulated-list-sort
Date: Mon, 29 Nov 2021 10:39:12 -0500 (EST)

branch: master
commit 4de13ef147a4c88c33fe608ee7ca5bd4212476ee
Author: Lars Ingebrigtsen <larsi@gnus.org>
Commit: Lars Ingebrigtsen <larsi@gnus.org>

    Signal a better error in tabulated-list-sort
    
    * lisp/emacs-lisp/tabulated-list.el (tabulated-list-sort): Signal
    error earlier on invalid column numbers (bug#52154).
---
 lisp/emacs-lisp/tabulated-list.el | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/lisp/emacs-lisp/tabulated-list.el 
b/lisp/emacs-lisp/tabulated-list.el
index 8f6c655..075fe83 100644
--- a/lisp/emacs-lisp/tabulated-list.el
+++ b/lisp/emacs-lisp/tabulated-list.el
@@ -684,6 +684,10 @@ With a numeric prefix argument N, sort the Nth column.
 If the numeric prefix is -1, restore order the list was
 originally displayed in."
   (interactive "P")
+  (when (and n
+             (or (>= n (length tabulated-list-format))
+                 (< n -1)))
+    (user-error "Invalid column number"))
   (if (equal n -1)
       ;; Restore original order.
       (progn



reply via email to

[Prev in Thread] Current Thread [Next in Thread]