summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKyle Meyer <kyle@kyleam.com>2017-05-08 11:13:19 -0400
committerKyle Meyer <kyle@kyleam.com>2017-05-08 11:13:19 -0400
commitc1addc8252f360f44b329f09004202bfbbe92605 (patch)
tree06bcfce3c955aec798580479a14bc01b0be6ec32
parentf4fca13598ddba879b0b78bf47bfca9e9da718aa (diff)
downloadorg-mode-c1addc8252f360f44b329f09004202bfbbe92605.tar.gz
org-sort: Call org-sort-* functions non-interactively
* lisp/org.el (org-sort): Use funcall instead of org-call-with-arg, and make WITH-CASE an optional argument. * lisp/org-table.el (org-table-sort-lines): Make WITH-CASE an optional argument.
-rw-r--r--lisp/org-table.el2
-rw-r--r--lisp/org.el11
2 files changed, 6 insertions, 7 deletions
diff --git a/lisp/org-table.el b/lisp/org-table.el
index 8f7a4ad..8dc6ceb 100644
--- a/lisp/org-table.el
+++ b/lisp/org-table.el
@@ -1639,7 +1639,7 @@ In particular, this does handle wide and invisible characters."
dline -1 dline))))
;;;###autoload
-(defun org-table-sort-lines (with-case &optional sorting-type getkey-func compare-func)
+(defun org-table-sort-lines (&optional with-case sorting-type getkey-func compare-func)
"Sort table lines according to the column at point.
The position of point indicates the column to be used for
diff --git a/lisp/org.el b/lisp/org.el
index 0e41edb..7dc839c 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -8845,15 +8845,14 @@ with the original repeater."
;;; Outline Sorting
-(defun org-sort (with-case)
+(defun org-sort (&optional with-case)
"Call `org-sort-entries', `org-table-sort-lines' or `org-sort-list'.
Optional argument WITH-CASE means sort case-sensitively."
(interactive "P")
- (cond
- ((org-at-table-p) (org-call-with-arg 'org-table-sort-lines with-case))
- ((org-at-item-p) (org-call-with-arg 'org-sort-list with-case))
- (t
- (org-call-with-arg 'org-sort-entries with-case))))
+ (funcall (cond ((org-at-table-p) #'org-table-sort-lines)
+ ((org-at-item-p) #'org-sort-list)
+ (t #'org-sort-entries))
+ with-case))
(defun org-sort-remove-invisible (s)
"Remove invisible part of links and emphasis markers from string S."