From: Artur Malabarba Date: Wed, 7 Oct 2015 13:09:09 +0000 (+0100) Subject: * lisp/emacs-lisp/tabulated-list.el (tabulated-list-sort): X-Git-Tag: emacs-25.0.90~1204 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=e60a1e2717ded78f062719b2cd8c41f358cf0198;p=emacs.git * lisp/emacs-lisp/tabulated-list.el (tabulated-list-sort): Check if column can be sorted before trying. (Bug#21639) --- 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))