瀏覽代碼

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 14 年之前
父節點
當前提交
f194eb1719
共有 1 個文件被更改,包括 2 次插入3 次删除
  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)