summaryrefslogtreecommitdiff
path: root/lisp/emacs-lisp
diff options
context:
space:
mode:
authorArtur Malabarba <bruce.connor.am@gmail.com>2015-10-07 14:09:09 +0100
committerArtur Malabarba <bruce.connor.am@gmail.com>2015-10-07 15:13:07 +0100
commite60a1e2717ded78f062719b2cd8c41f358cf0198 (patch)
tree816e806b8502d49d9116385224bb6e32e6e904fe /lisp/emacs-lisp
parent9ed9b7dc953c787518f12da4fa2d28fccf8c1b24 (diff)
downloademacs-e60a1e2717ded78f062719b2cd8c41f358cf0198.tar.gz
emacs-e60a1e2717ded78f062719b2cd8c41f358cf0198.tar.bz2
emacs-e60a1e2717ded78f062719b2cd8c41f358cf0198.zip
* lisp/emacs-lisp/tabulated-list.el (tabulated-list-sort):
Check if column can be sorted before trying. (Bug#21639)
Diffstat (limited to 'lisp/emacs-lisp')
-rw-r--r--lisp/emacs-lisp/tabulated-list.el4
1 files changed, 3 insertions, 1 deletions
diff --git a/lisp/emacs-lisp/tabulated-list.el b/lisp/emacs-lisp/tabulated-list.el
index 47ecd2b7922..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))