Permalink
Browse files

(yas-choose-value): Accept strings as &rest argument

  • Loading branch information...
1 parent c566c92 commit 71c8e0ea469c2992a31d17b0722ebdeb789fd1bf @joaotavora committed Jul 30, 2012
Showing with 8 additions and 2 deletions.
  1. +8 −2 yasnippet.el
View
10 yasnippet.el
@@ -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)))

0 comments on commit 71c8e0e

Please sign in to comment.