Browse Source

org-list: fix bug when sorting a list with a custom function

* lisp/org-list.el (org-sort-list): function tries to intern
  getkey-func before it is defined, so it's always nil.

Based on a patch from Le Wang.
Nicolas Goaziou 8 years ago
parent
commit
f194eb1719
1 changed files with 2 additions and 3 deletions
  1. 2 3
      lisp/org-list.el

+ 2 - 3
lisp/org-list.el

@@ -2558,9 +2558,8 @@ compare entries."
 	     "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)
-			   (org-icompleting-read "Sort using function: "
-						 obarray 'fboundp t nil nil)
-			   (intern getkey-func))))
+			   (intern (org-icompleting-read "Sort using function: "
+							 obarray 'fboundp t nil nil)))))
     (message "Sorting items...")
     (save-restriction
       (narrow-to-region start end)