org-sort: Read compare-func in interactive calls
commit9d9f5179e7c6b42ae89638c1f9b8bee523dec3c0
authorKyle Meyer <kyle@kyleam.com>
Tue, 9 May 2017 18:57:40 +0000 (9 14:57 -0400)
committerKyle Meyer <kyle@kyleam.com>
Thu, 18 May 2017 18:46:33 +0000 (18 14:46 -0400)
treeffeb0f33417509a43a5d239439ebbea6bbd4103a
parent2c9f6fcef9dce2ace56e542f49f5f289dd741ce7
org-sort: Read compare-func in interactive calls

* lisp/org-macs.el (org-read-function): New function.
* lisp/org-table.el (org-table-sort-lines): Make WITH-CASE an optional
argument to match org-sort-entries and org-sort-list.
* lisp/org.el (org-sort-entries):
* lisp/org-table.el (org-table-sort-lines):
* lisp/org-list.el (org-sort-list): Read COMPARE-FUNC when called
interactively rather than being restricted to the default behavior of
sort-subr's PREDICATE parameter.  Only prompt for for GETKEY-FUNC and
COMPARE-FUNC during an interactive call, like org-table-sort-lines
already did for GETKEY-FUNC, but use an argument rather than relying
on the brittle called-interactively-p.

Suggested-by: Zhitao Gong <zhitaao.gong@gmail.com>
<https://lists.gnu.org/archive/html/emacs-orgmode/2017-05/msg00040.html>
lisp/org-list.el
lisp/org-macs.el
lisp/org-table.el
lisp/org.el