[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/ivy-hydra 1c1573e 167/395: ivy.el (ivy--update-prompt):
From: |
Basil L. Contovounesios |
Subject: |
[elpa] externals/ivy-hydra 1c1573e 167/395: ivy.el (ivy--update-prompt): Handle auto-insert.el |
Date: |
Thu, 25 Feb 2021 08:31:55 -0500 (EST) |
branch: externals/ivy-hydra
commit 1c1573ea16c2db32e3e393b952e37bf1a66809fd
Author: Oleh Krehel <ohwoeowho@gmail.com>
Commit: Oleh Krehel <ohwoeowho@gmail.com>
ivy.el (ivy--update-prompt): Handle auto-insert.el
Fixes #2429
---
ivy.el | 76 ++++++++++++++++++++++++++++++++++++------------------------------
1 file changed, 41 insertions(+), 35 deletions(-)
diff --git a/ivy.el b/ivy.el
index b06bc7c..9812d59 100644
--- a/ivy.el
+++ b/ivy.el
@@ -2110,17 +2110,25 @@ found, it falls back to the key t."
(remove-list-of-text-properties 0 (length str) props str))
str)
+(defun ivy--update-prompt (prompt)
+ (cond ((equal prompt "Keyword, C-h: ")
+ ;; auto-insert.el
+ "Keyword (C-M-j to end): ")
+ (t
+ ;; misearch.el
+ (replace-regexp-in-string "RET to end" "C-M-j to end" prompt))))
+
;;** Entry Point
;;;###autoload
(cl-defun ivy-read (prompt collection
- &key
- predicate require-match initial-input
- history preselect def keymap update-fn sort
- action multi-action
- unwind re-builder matcher
- dynamic-collection
- extra-props
- caller)
+ &key
+ predicate require-match initial-input
+ history preselect def keymap update-fn sort
+ action multi-action
+ unwind re-builder matcher
+ dynamic-collection
+ extra-props
+ caller)
"Read a string in the minibuffer, with completion.
PROMPT is a string, normally ending in a colon and a space.
@@ -2198,7 +2206,7 @@ customizations apply to the current completion session."
(setq unwind (or unwind (ivy-alist-setting ivy-unwind-fns-alist caller)))
(setq ivy-last
(make-ivy-state
- :prompt prompt
+ :prompt (ivy--update-prompt prompt)
:collection collection
:predicate predicate
:require-match require-match
@@ -2233,30 +2241,30 @@ customizations apply to the current completion session."
:def def))
(ivy--reset-state ivy-last)
(unwind-protect
- (minibuffer-with-setup-hook
- #'ivy--minibuffer-setup
- (let* ((hist (or history 'ivy-history))
- (minibuffer-completion-table collection)
- (minibuffer-completion-predicate predicate)
- (ivy-height (ivy--height caller))
- (resize-mini-windows (unless (display-graphic-p)
- 'grow-only)))
- (if (and ivy-auto-select-single-candidate
- ivy--all-candidates
- (null (cdr ivy--all-candidates)))
- (progn
- (setf (ivy-state-current ivy-last)
- (car ivy--all-candidates))
- (setq ivy-exit 'done))
- (read-from-minibuffer
- prompt
- (ivy-state-initial-input ivy-last)
- (make-composed-keymap keymap ivy-minibuffer-map)
- nil
- hist)
- (pop (symbol-value hist)))
- (when (eq ivy-exit 'done)
- (ivy--update-history hist))))
+ (minibuffer-with-setup-hook
+ #'ivy--minibuffer-setup
+ (let* ((hist (or history 'ivy-history))
+ (minibuffer-completion-table collection)
+ (minibuffer-completion-predicate predicate)
+ (ivy-height (ivy--height caller))
+ (resize-mini-windows (unless (display-graphic-p)
+ 'grow-only)))
+ (if (and ivy-auto-select-single-candidate
+ ivy--all-candidates
+ (null (cdr ivy--all-candidates)))
+ (progn
+ (setf (ivy-state-current ivy-last)
+ (car ivy--all-candidates))
+ (setq ivy-exit 'done))
+ (read-from-minibuffer
+ prompt
+ (ivy-state-initial-input ivy-last)
+ (make-composed-keymap keymap ivy-minibuffer-map)
+ nil
+ hist)
+ (pop (symbol-value hist)))
+ (when (eq ivy-exit 'done)
+ (ivy--update-history hist))))
(ivy--cleanup))
(ivy-call)))
@@ -2393,8 +2401,6 @@ This is useful for recursive `ivy-read'."
(equal (ivy--get-action ivy-last) 'identity))
(setq initial-input nil))))
((eq collection #'internal-complete-buffer)
- (setq prompt
- (replace-regexp-in-string "RET to end" "C-M-j to end"
prompt))
(setq coll (ivy--buffer-list
""
(and ivy-use-virtual-buffers
- [elpa] externals/ivy-hydra 98a29b6 148/395: Fix C-<backspace> not working in counsel-file-jump, (continued)
- [elpa] externals/ivy-hydra 98a29b6 148/395: Fix C-<backspace> not working in counsel-file-jump, Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra 19bc4ed 149/395: ivy.el (ivy-ignore-buffers): Ignore *tramp/ buffers, Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra 982a5ac 150/395: ivy.el (ivy--tramp-candidates): The initial directory on remote should be "/", Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra 554c178 158/395: ivy.el (ivy-set-actions): Allow to override the default action using "o", Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra 0cff3e1 157/395: swiper.el (swiper): Add isearch-clean-overlays, Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra 35d015b 166/395: ivy.el (ivy-avy): Configure no-counsel-M-x, Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra 18d7ff9 168/395: ivy.el (ivy--set-candidates): Delete duplicates, Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra b9eb3c1 162/395: swiper.el (swiper--line-number): Works with ivy-mark, Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra ba73e45 156/395: ivy.el (ivy-read-action): Avoid ivy-read-action-ivy overwriting ivy--directory, Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra 328da1f 170/395: counsel.el (counsel-rg): Split command args in a more familiar way, Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra 1c1573e 167/395: ivy.el (ivy--update-prompt): Handle auto-insert.el,
Basil L. Contovounesios <=
- [elpa] externals/ivy-hydra 45a3609 176/395: counsel.el (counsel-rg-base-command): Add "-M 120" by default, Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra 0258725 175/395: counsel.el: Fix candidate splitting when eol is CR or CRLF, Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra 8fae568 184/395: counsel.el (counsel-org-link): Add, Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra 9b36d9c 186/395: swiper.el (swiper-isearch): Use ivy-init-fns-alist, Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra 9e1513f 195/395: ivy.el (ivy--split): Don't split consecutive group brackets, Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra 7b9b3cc 200/395: ivy.el (ivy--switch-buffer-matcher): Complete remote dirs via ":", Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra 829cf8a 212/395: ivy.el (ivy--done): Set ivy-text, Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra 95896df 221/395: Honour sentence-end-double-space in recent change, Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra c0a960b 216/395: ivy.el (ivy-read): Don't error on "Selecting deleted buffer", Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra 8277a70 197/395: ivy.el (ivy-switch-buffer-transformer): Simplify, Basil L. Contovounesios, 2021/02/25