summaryrefslogtreecommitdiff
path: root/lisp/emacs-lisp/tabulated-list.el
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/emacs-lisp/tabulated-list.el')
-rw-r--r--lisp/emacs-lisp/tabulated-list.el8
1 files changed, 3 insertions, 5 deletions
diff --git a/lisp/emacs-lisp/tabulated-list.el b/lisp/emacs-lisp/tabulated-list.el
index cd61eb9ae56..4bd8a19937d 100644
--- a/lisp/emacs-lisp/tabulated-list.el
+++ b/lisp/emacs-lisp/tabulated-list.el
@@ -520,7 +520,9 @@ With a numeric prefix argument N, sort the Nth column."
(car (aref tabulated-list-format n))
(get-text-property (point)
'tabulated-list-column-name))))
- (tabulated-list--sort-by-column-name name)))
+ (if (nth 2 (assoc name (append tabulated-list-format nil)))
+ (tabulated-list--sort-by-column-name name)
+ (user-error "Cannot sort by %s" name))))
(defun tabulated-list--sort-by-column-name (name)
(when (and name (derived-mode-p 'tabulated-list-mode))
@@ -581,8 +583,4 @@ as the ewoc pretty-printer."
(provide 'tabulated-list)
-;; Local Variables:
-;; coding: utf-8
-;; End:
-
;;; tabulated-list.el ends here