[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master e9c274a 236/348: Allow to customize ivy-display-function p
From: |
Oleh Krehel |
Subject: |
[elpa] master e9c274a 236/348: Allow to customize ivy-display-function per caller |
Date: |
Sat, 8 Apr 2017 11:04:05 -0400 (EDT) |
branch: master
commit e9c274a221ee00aabf72db05c6c7a9d140ec202c
Author: Oleh Krehel <address@hidden>
Commit: Oleh Krehel <address@hidden>
Allow to customize ivy-display-function per caller
* ivy.el (ivy-display-functions-alist): New defvar.
(ivy-read): Use `ivy-display-functions-alist' to set
`ivy-display-function'.
(ivy-completion-in-region): Don't hardcode `ivy-display-function'.
Fixes #788
---
ivy.el | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)
diff --git a/ivy.el b/ivy.el
index bd2d5f8..1c8bd40 100644
--- a/ivy.el
+++ b/ivy.el
@@ -184,6 +184,10 @@ See
https://github.com/abo-abo/swiper/wiki/ivy-display-function."
(const :tag "Popup" ivy-display-function-popup)
(const :tag "Overlay" ivy-display-function-overlay)))
+(defvar ivy-display-functions-alist
+ '((ivy-completion-in-region . ivy-display-function-overlay))
+ "An alist for customizing `ivy-display-function'.")
+
(defvar ivy--actions-list nil
"A list of extra actions per command.")
@@ -1422,7 +1426,9 @@ customizations apply to the current completion session."
(transformer-fn
(plist-get ivy--display-transformers-list
(or caller (and (functionp collection)
- collection)))))
+ collection))))
+ (ivy-display-function (unless (window-minibuffer-p)
+ (cdr (assoc caller
ivy-display-functions-alist)))))
(setq ivy-last
(make-ivy-state
:prompt prompt
@@ -1787,8 +1793,6 @@ The previous string is between `ivy-completion-beg' and
`ivy-completion-end'."
(completion-ignore-case case-fold-search)
(comps
(completion-all-completions str collection predicate (- end start)))
- (ivy-display-function (unless (window-minibuffer-p)
- #'ivy-display-function-overlay))
(ivy--prompts-list (if (window-minibuffer-p)
ivy--prompts-list
'(ivy-completion-in-region (lambda nil)))))
@@ -1819,7 +1823,6 @@ The previous string is between `ivy-completion-beg' and
`ivy-completion-end'."
(mapcar #'substring-no-properties comps)
:predicate predicate
:action #'ivy-completion-in-region-action
- :unwind #'ivy-overlay-cleanup
:require-match t
:caller 'ivy-completion-in-region)
t)))))))
- [elpa] master 36b00cb 155/348: Use EVM in travis to test across multiple Emacs versions, (continued)
- [elpa] master 36b00cb 155/348: Use EVM in travis to test across multiple Emacs versions, Oleh Krehel, 2017/04/08
- [elpa] master f6bd64b 164/348: ivy.el (ivy--flx-featurep): New defvar, Oleh Krehel, 2017/04/08
- [elpa] master fc5c8fc 159/348: Fix ivy-occur-press for swiper, Oleh Krehel, 2017/04/08
- [elpa] master e98883f 162/348: Improve fuzzy swiper highlight, Oleh Krehel, 2017/04/08
- [elpa] master 9b28927 187/348: counsel.el (counsel-hydra-heads): Fixup, Oleh Krehel, 2017/04/08
- [elpa] master 00219da 181/348: Fix for older Emacs, Oleh Krehel, 2017/04/08
- [elpa] master 8f87f74 178/348: counsel.el (counsel-git-grep): Update for Windows, Oleh Krehel, 2017/04/08
- [elpa] master 79105a5 208/348: counsel.el (counsel-info-lookup-symbol): Add preselect, Oleh Krehel, 2017/04/08
- [elpa] master 222a5e6 217/348: ivy.el (ivy--virtual-buffers): Move to silence compiler, Oleh Krehel, 2017/04/08
- [elpa] master 35b5d29 230/348: New example to show how to associate values, Oleh Krehel, 2017/04/08
- [elpa] master e9c274a 236/348: Allow to customize ivy-display-function per caller,
Oleh Krehel <=
- [elpa] master c14ceac 245/348: Add support for counsel-find-library, Oleh Krehel, 2017/04/08
- [elpa] master ca84f24 269/348: Add highlighter function configuration to ivy, Oleh Krehel, 2017/04/08
- [elpa] master 5701444 314/348: ivy.el (ivy-occur-revert-buffer): Restore ivy-occur-last, Oleh Krehel, 2017/04/08
- [elpa] master 13def15 318/348: ivy.el (ivy-case-fold-search): Add additional value 'always, Oleh Krehel, 2017/04/08
- [elpa] master 54c5447 319/348: counsel.el (counsel-grep-function): Add shell-quote-argument, Oleh Krehel, 2017/04/08
- [elpa] master bf8dc5f 326/348: Make swiper-avy work with more regexp builders, Oleh Krehel, 2017/04/08
- [elpa] master 03f90af 324/348: ivy.el (ivy-rotate-sort): Guard against nil sort, Oleh Krehel, 2017/04/08
- [elpa] master ac944ea 325/348: ivy.el: Remove with-ivy-window, Oleh Krehel, 2017/04/08
- [elpa] master 18da759 320/348: ivy.el: Remove ivy--current, Oleh Krehel, 2017/04/08
- [elpa] master 20744aa 337/348: doc/Changelog.org: Prepare for 0.9.0, Oleh Krehel, 2017/04/08