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

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

[elpa] externals/ivy-hydra d52ee0a 301/395: ivy.el (ivy-completion-in-re


From: Basil L. Contovounesios
Subject: [elpa] externals/ivy-hydra d52ee0a 301/395: ivy.el (ivy-completion-in-region): Restrict new behavior to elisp code
Date: Thu, 25 Feb 2021 08:32:25 -0500 (EST)

branch: externals/ivy-hydra
commit d52ee0a3f0024bf7065f77497285b1e69dbbdb9f
Author: Oleh Krehel <ohwoeowho@gmail.com>
Commit: Oleh Krehel <ohwoeowho@gmail.com>

    ivy.el (ivy-completion-in-region): Restrict new behavior to elisp code
    
    It seems to be useful only for `elisp-completion-at-point'.
---
 ivy.el | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/ivy.el b/ivy.el
index ac8e133..829c978 100644
--- a/ivy.el
+++ b/ivy.el
@@ -2557,12 +2557,13 @@ See `completion-in-region' for further information."
                  (setq initial nil)
                  (setq predicate nil)
                  (setq collection comps))
-               (ivy-read (format "(%s): " str)
-                         (if (functionp collection) comps collection)
+               (if (memq major-mode '(lisp-interaction-mode emacs-lisp-mode))
+                   (setq initial (concat "^" initial))
+                 (setq collection comps)
+                 (setq predicate nil))
+               (ivy-read (format "(%s): " str) collection
                          :predicate predicate
-                         :initial-input (concat (unless (functionp collection)
-                                                  "^")
-                                                initial)
+                         :initial-input initial
                          :action #'ivy-completion-in-region-action
                          :unwind (lambda ()
                                    (unless (eq ivy-exit 'done)



reply via email to

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