[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] master de2e819 20/63: Allow % in prompt string

From: Oleh Krehel
Subject: [elpa] master de2e819 20/63: Allow % in prompt string
Date: Fri, 21 Aug 2015 12:08:35 +0000

branch: master
commit de2e81927b3362b346a6c7063a335448158776a1
Author: Erik Hetzner <address@hidden>
Commit: Erik Hetzner <address@hidden>

    Allow % in prompt string
    - quote % when passing prompt from ivy-completing-read to ivy-read
    - add documentation in ivy-read that all % should be quoted
 ivy.el |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/ivy.el b/ivy.el
index 58b2529..e79bb9a 100644
--- a/ivy.el
+++ b/ivy.el
@@ -770,7 +770,8 @@ Directories come first."
 PROMPT is a string to prompt with; normally it ends in a colon
 and a space.  When PROMPT contains %d, it will be updated with
-the current number of matching candidates.
+the current number of matching candidates.  If % appears elsewhere
+in the PROMPT it should be quoted as %%.
 See also `ivy-count-format'.
 COLLECTION is a list of strings.
@@ -985,7 +986,8 @@ DEF is the default value.
 _INHERIT-INPUT-METHOD is ignored for now.
 The history, defaults and input-method arguments are ignored for now."
-  (ivy-read prompt collection
+  (ivy-read (replace-regexp-in-string "%" "%%" prompt)
+            collection
             :predicate predicate
             :require-match require-match
             :initial-input (if (consp initial-input)

reply via email to

[Prev in Thread] Current Thread [Next in Thread]