aboutsummaryrefslogtreecommitdiff
path: root/sx.el
diff options
context:
space:
mode:
authorArtur Malabarba <bruce.connor.am@gmail.com>2014-12-27 23:06:00 -0200
committerArtur Malabarba <bruce.connor.am@gmail.com>2014-12-27 23:10:34 -0200
commitc37022ffbc52b900d81eee05f3c2c3d5fe6fee01 (patch)
treece2542f664233a19c3391802137999675fd988ef /sx.el
parent2012346d11a04f7cd9871fced0df2417b5503336 (diff)
Initial implementation of sx-completing-read
Diffstat (limited to 'sx.el')
-rw-r--r--sx.el5
1 files changed, 5 insertions, 0 deletions
diff --git a/sx.el b/sx.el
index a63c155..c2d1164 100644
--- a/sx.el
+++ b/sx.el
@@ -183,6 +183,11 @@ See `sx-question-get-questions' and `sx-question-get-question'.")
;;; Utility Functions
+(defun sx-completing-read (&rest args)
+ "Like `completing-read', but possibly use ido.
+All ARGS are passed to `completing-read' or `ido-completing-read'."
+ (apply (if ido-mode #'ido-completing-read #'completing-read)
+ args))
(defmacro sx-sorted-insert-skip-first (newelt list &optional predicate)
"Inserted NEWELT into LIST sorted by PREDICATE.