diff options
| author | Artur Malabarba | 2015-10-07 14:09:09 +0100 |
|---|---|---|
| committer | Artur Malabarba | 2015-10-07 15:13:07 +0100 |
| commit | e60a1e2717ded78f062719b2cd8c41f358cf0198 (patch) | |
| tree | 816e806b8502d49d9116385224bb6e32e6e904fe | |
| parent | 9ed9b7dc953c787518f12da4fa2d28fccf8c1b24 (diff) | |
| download | emacs-e60a1e2717ded78f062719b2cd8c41f358cf0198.tar.gz emacs-e60a1e2717ded78f062719b2cd8c41f358cf0198.zip | |
* lisp/emacs-lisp/tabulated-list.el (tabulated-list-sort):
Check if column can be sorted before trying. (Bug#21639)
| -rw-r--r-- | lisp/emacs-lisp/tabulated-list.el | 4 |
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." | |||
| 520 | (car (aref tabulated-list-format n)) | 520 | (car (aref tabulated-list-format n)) |
| 521 | (get-text-property (point) | 521 | (get-text-property (point) |
| 522 | 'tabulated-list-column-name)))) | 522 | 'tabulated-list-column-name)))) |
| 523 | (tabulated-list--sort-by-column-name name))) | 523 | (if (nth 2 (assoc name (append tabulated-list-format nil))) |
| 524 | (tabulated-list--sort-by-column-name name) | ||
| 525 | (user-error "Cannot sort by %s" name)))) | ||
| 524 | 526 | ||
| 525 | (defun tabulated-list--sort-by-column-name (name) | 527 | (defun tabulated-list--sort-by-column-name (name) |
| 526 | (when (and name (derived-mode-p 'tabulated-list-mode)) | 528 | (when (and name (derived-mode-p 'tabulated-list-mode)) |