summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarsten Dominik <carsten.dominik@gmail.com>2012-10-09 09:27:01 +0200
committerCarsten Dominik <carsten.dominik@gmail.com>2012-10-09 09:27:01 +0200
commit975b7f4608d2e5933f92497835beaab57a6e83b0 (patch)
tree16ce2faa9c9c13fc0f3ef846781c9475f69ca985
parent8ec79bff9a428ce6d915b8cb75b2dbeee8d76c13 (diff)
parent651dfdfe33dca6b719c4c7dc23880fdd09e67b76 (diff)
downloadorg-mode-975b7f4608d2e5933f92497835beaab57a6e83b0.tar.gz
Merge branch 'make-sorting-functions-honor-arguments'
-rw-r--r--lisp/org-list.el17
-rw-r--r--lisp/org.el12
2 files changed, 17 insertions, 12 deletions
diff --git a/lisp/org-list.el b/lisp/org-list.el
index 10f5e6e..d97e8b4 100644
--- a/lisp/org-list.el
+++ b/lisp/org-list.el
@@ -2805,13 +2805,16 @@ COMPARE-FUNC to compare entries."
(start (org-list-get-list-begin (point-at-bol) struct prevs))
(end (org-list-get-list-end (point-at-bol) struct prevs))
(sorting-type
- (progn
- (message
- "Sort plain list: [a]lpha [n]umeric [t]ime [f]unc A/N/T/F means reversed:")
- (read-char-exclusive)))
- (getkey-func (and (= (downcase sorting-type) ?f)
- (intern (org-icompleting-read "Sort using function: "
- obarray 'fboundp t nil nil)))))
+ (or sorting-type
+ (progn
+ (message
+ "Sort plain list: [a]lpha [n]umeric [t]ime [f]unc A/N/T/F means reversed:")
+ (read-char-exclusive))))
+ (getkey-func
+ (or getkey-func
+ (and (= (downcase sorting-type) ?f)
+ (intern (org-icompleting-read "Sort using function: "
+ obarray 'fboundp t nil nil))))))
(message "Sorting items...")
(save-restriction
(narrow-to-region start end)
diff --git a/lisp/org.el b/lisp/org.el
index 808a725..4a60e90 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -8132,13 +8132,15 @@ WITH-CASE, the sorting considers case as well."
what)
(setq sorting-type (read-char-exclusive))
- (and (= (downcase sorting-type) ?f)
- (setq getkey-func
- (org-icompleting-read "Sort using function: "
- obarray 'fboundp t nil nil))
- (setq getkey-func (intern getkey-func)))
+ (unless getkey-func
+ (and (= (downcase sorting-type) ?f)
+ (setq getkey-func
+ (org-icompleting-read "Sort using function: "
+ obarray 'fboundp t nil nil))
+ (setq getkey-func (intern getkey-func))))
(and (= (downcase sorting-type) ?r)
+ (not property)
(setq property
(org-icompleting-read "Property: "
(mapcar 'list (org-buffer-property-keys t))