]> code.delx.au - gnu-emacs-elpa/commitdiff
(yas-choose-value): Accept strings as &rest argument
authorJoão Távora <joaotavora@gmail.com>
Mon, 30 Jul 2012 19:18:42 +0000 (20:18 +0100)
committerJoão Távora <joaotavora@gmail.com>
Tue, 31 Jul 2012 07:43:03 +0000 (08:43 +0100)
yasnippet.el

index 05087a5d1b8ec9cf3b1343ba569a2ed1e29af492..f9c0b001c91339ab80021cded22e219b58df9af2 100644 (file)
@@ -2749,10 +2749,16 @@ If found, the content of subexp group SUBEXP (default 0) is
           (match-string-no-properties grp str)
         str))))
 
-(defun yas-choose-value (possibilities)
-  "Prompt for a string in the list POSSIBILITIES and return it."
+(defun yas-choose-avalue (&rest possibilities)
+  "Prompt for a string in POSSIBILITIES and return it.
+
+The last element of POSSIBILITIES may be a list of strings."
   (unless (or yas-moving-away-p
               yas-modified-p)
+    (setq possibilities (nreverse possibilities))
+    (setq possibilities (if (listp (car possibilities))
+                            (append (reverse (car possibilities)) (rest possibilities))
+                                   possibilities))
     (some #'(lambda (fn)
               (funcall fn "Choose: " possibilities))
           yas-prompt-functions)))