Browse Source

Make `org-set-effort' access effort values by index

Carsten Dominik 15 years ago
parent
commit
a1fea8b3d1
2 changed files with 10 additions and 1 deletions
  1. 1 0
      lisp/ChangeLog
  2. 9 1
      lisp/org.el

+ 1 - 0
lisp/ChangeLog

@@ -5,6 +5,7 @@
 	(org-cycle-level-after-item/entry-creation): New option.
 	(org-flag-subtree): New function.
 	(org-hide-archived-subtrees): Call `org-flag-subtree'.
+	(org-set-effort): Indexed access.
 
 	* org-list.el (org-cycle-item-indentation): New function.
 

+ 9 - 1
lisp/org.el

@@ -12032,7 +12032,15 @@ allowed value."
 		(or (car (nth (1- value) allowed))
 		    (car (org-last allowed))))
 	       (allowed
-		(org-completing-read "Value: " allowed nil 'req-match))
+		(message "Select 1-9,0, [RET]: %s" (mapconcat 'car allowed " "))
+		(setq rpl (read-char-exclusive))
+		(if (equal rpl ?\r)
+		    (setq val cur)
+		  (setq rpl (- rpl ?0))
+		  (if (equal rpl 0) (setq rpl 10))
+		  (if (and (> rpl 0) (<= rpl (length allowed)))
+		      (car (nth (1- rpl) allowed))
+		    (org-completing-read "Value: " allowed nil))))
 	       (t
 		(let (org-completion-use-ido org-completion-use-iswitchb)
 		  (org-completing-read