emacs-elpa-diffs
[Top][All Lists]
Advanced

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

[elpa] master adac116 126/167: Make ivy-completing-read handle history a


From: Oleh Krehel
Subject: [elpa] master adac116 126/167: Make ivy-completing-read handle history as cons
Date: Tue, 08 Dec 2015 10:50:29 +0000

branch: master
commit adac116cd79d26585263b90c4559fef8177c4a1c
Author: Samuel Loury <address@hidden>
Commit: Oleh Krehel <address@hidden>

    Make ivy-completing-read handle history as cons
    
    The ivy-read function assumes that history is a symbol, hence
    ivy-completing-read now makes sure that a symbol is given to
    ivy-read.
    
    Moreover, it makes sure that the value of initial-input is
    coherent with the value of the HISTPOS part of the history
    variable if it exists.
    
    Fixes #295
---
 ivy.el |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/ivy.el b/ivy.el
index 92b87fd..fe2d125 100644
--- a/ivy.el
+++ b/ivy.el
@@ -1238,6 +1238,12 @@ DEF is the default value.
 _INHERIT-INPUT-METHOD is ignored for now.
 
 The history, defaults and input-method arguments are ignored for now."
+  ;; See the doc of `completing-read'.
+  (when (consp history)
+    (when (numberp (cdr history))
+      (setq initial-input (nth (cdr history)
+                               (symbol-value (car history)))))
+    (setq history (car history)))
   (ivy-read (replace-regexp-in-string "%" "%%" prompt)
             collection
             :predicate predicate



reply via email to

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