From 71c8e0ea469c2992a31d17b0722ebdeb789fd1bf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20T=C3=A1vora?= Date: Mon, 30 Jul 2012 20:18:42 +0100 Subject: [PATCH] (yas-choose-value): Accept strings as &rest argument --- yasnippet.el | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/yasnippet.el b/yasnippet.el index 05087a5..f9c0b00 100644 --- a/yasnippet.el +++ b/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)))