[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master f40b08a 293/399: ivy-display-function: obsolete this varib
From: |
Oleh Krehel |
Subject: |
[elpa] master f40b08a 293/399: ivy-display-function: obsolete this varible in favor ivy-display-functions-alist |
Date: |
Sat, 20 Jul 2019 14:57:43 -0400 (EDT) |
branch: master
commit f40b08a2657d2a65a1cf711dca1fd568bc6eabbe
Author: Feng Shu <address@hidden>
Commit: Feng Shu <address@hidden>
ivy-display-function: obsolete this varible in favor
ivy-display-functions-alist
* ivy.el (ivy-display-function): make-obsolete ivy-display-function
variable.
(ivy--display-function): new variable.
(ivy-display-functions-alist): defvar -> defcustom.
(ivy-read, ivy--display-function-prop, ivy--insert-minibuffer): use
ivy--display-function instead.
---
ivy.el | 47 ++++++++++++++++++++++++++++++++---------------
1 file changed, 32 insertions(+), 15 deletions(-)
diff --git a/ivy.el b/ivy.el
index bfcaf08..de0c35b 100644
--- a/ivy.el
+++ b/ivy.el
@@ -224,7 +224,7 @@ Only \"./\" and \"../\" apply here. They appear in reverse
order."
"When non-nil, add recent files and bookmarks to `ivy-switch-buffer'."
:type 'boolean)
-(defcustom ivy-display-function nil
+(defvar ivy-display-function nil
"Determine where to display candidates.
When nil (the default), candidates are shown in the minibuffer.
Otherwise, this can be set to a function which takes a string
@@ -235,21 +235,38 @@ This user option acts as a global default for Ivy-based
completion commands. You can customize the display function on a
per-command basis via `ivy-display-functions-alist', which see.
See also URL
-`https://github.com/abo-abo/swiper/wiki/ivy-display-function'."
- :type '(choice
- (const :tag "Minibuffer" nil)
- (const :tag "LV" ivy-display-function-lv)
- (const :tag "Popup" ivy-display-function-popup)
- (const :tag "Overlay" ivy-display-function-overlay)))
+`https://github.com/abo-abo/swiper/wiki/ivy-display-function'.")
+
+(make-obsolete-variable
+ 'ivy-display-function 'ivy-display-functions-alist "<2019-12-05 Mon>")
+
+(defvar ivy--display-function nil
+ "The display-function is used in current.")
(defvar ivy-display-functions-props
'((ivy-display-function-overlay :cleanup ivy-overlay-cleanup))
"Map Ivy display functions to their property lists.
Examples of properties include associated `:cleanup' functions.")
-(defvar ivy-display-functions-alist
- '((ivy-completion-in-region . ivy-display-function-overlay))
- "An alist for customizing `ivy-display-function'.")
+(defcustom ivy-display-functions-alist
+ '((ivy-completion-in-region . ivy-display-function-overlay)
+ (t . nil))
+ "An alist for customizing display-function.
+
+display-function determine where to display candidates. it takes
+a string argument comprising the current matching candidates and
+displays it somewhere.
+
+When display-function is nil, candidates are shown in the
+minibuffer."
+ :type '(alist
+ :key-type symbol
+ :value-type '(choice
+ (const :tag "Minibuffer" nil)
+ (const :tag "LV" ivy-display-function-lv)
+ (const :tag "Popup" ivy-display-function-popup)
+ (const :tag "Overlay" ivy-display-function-overlay)
+ (function :tag "Custom function"))))
(defvar ivy-completing-read-dynamic-collection nil
"Run `ivy-completing-read' with `:dynamic-collection t`.")
@@ -1917,7 +1934,7 @@ customizations apply to the current completion session."
(cond (caller)
((functionp collection)
collection))))
- (ivy-display-function
+ (ivy--display-function
(when (or ivy-recursive-last
(not (window-minibuffer-p)))
(or ivy-display-function
@@ -2000,8 +2017,8 @@ customizations apply to the current completion session."
(ivy--remove-props (ivy-state-current ivy-last) 'idx))))
(defun ivy--display-function-prop (prop)
- "Return PROP associated with current `ivy-display-function'."
- (plist-get (cdr (assq ivy-display-function
+ "Return PROP associated with current `ivy--display-function'."
+ (plist-get (cdr (assq ivy--display-function
ivy-display-functions-props))
prop))
@@ -3014,8 +3031,8 @@ Should be run via minibuffer `post-command-hook'."
(ivy--insert-prompt)
;; Do nothing if while-no-input was aborted.
(when (stringp text)
- (if ivy-display-function
- (funcall ivy-display-function text)
+ (if ivy--display-function
+ (funcall ivy--display-function text)
(ivy-display-function-fallback text)))
(ivy--resize-minibuffer-to-fit)
;; prevent region growing due to text remove/add
- [elpa] master 13da38a 287/399: ivy.el (ivy-help): Hide Org markup buffer-locally, (continued)
- [elpa] master 13da38a 287/399: ivy.el (ivy-help): Hide Org markup buffer-locally, Oleh Krehel, 2019/07/20
- [elpa] master 0134255 281/399: ivy.el (ivy--highlight-default): Use single face for adjacent groups, Oleh Krehel, 2019/07/20
- [elpa] master b7e9dfd 277/399: counsel.el: Fix a couple of typos, Oleh Krehel, 2019/07/20
- [elpa] master 92d5335 291/399: Add counsel-up-level command, Oleh Krehel, 2019/07/20
- [elpa] master 7e8622f 286/399: ivy.el (ivy-read-action): Fix, Oleh Krehel, 2019/07/20
- [elpa] master 0a26144 280/399: ivy.el (ivy--highlight-default): Handle unmatched groups, Oleh Krehel, 2019/07/20
- [elpa] master 8905b8b 278/399: counsel.el: Pacify byte-compiler, Oleh Krehel, 2019/07/20
- [elpa] master af5b594 283/399: ivy.el (ivy--occur-insert-lines): Fix typo bug, Oleh Krehel, 2019/07/20
- [elpa] master 04f56ca 282/399: ivy.el (ivy--recompute-index): Use configured flx candidate limit, Oleh Krehel, 2019/07/20
- [elpa] master e69ddc3 295/399: ivy.el (ivy-sort-function-buffer): Unify prefix and star-prefix matches, Oleh Krehel, 2019/07/20
- [elpa] master f40b08a 293/399: ivy-display-function: obsolete this varible in favor ivy-display-functions-alist,
Oleh Krehel <=
- [elpa] master 332f990 285/399: ivy.el: Fix compiler warning, Oleh Krehel, 2019/07/20
- [elpa] master 779db1e 292/399: ivy.el (ivy--occur-insert-lines): Add copy-sequence, Oleh Krehel, 2019/07/20
- [elpa] master a73e24d 288/399: Do not insert initial input if nil, Oleh Krehel, 2019/07/20
- [elpa] master 0b26219 301/399: counsel.el (counsel--file-name-filter): Move ignore-re binding., Oleh Krehel, 2019/07/20
- [elpa] master ef6d3db 297/399: ivy-overlay.el (ivy-display-function-overlay): Bring back org-indent-mode logic, Oleh Krehel, 2019/07/20
- [elpa] master 7feb14f 289/399: ivy.el (ivy-format-functions-alist): New defcustom, obsoletes ivy-format-function, Oleh Krehel, 2019/07/20
- [elpa] master b528f0f 299/399: ivy-overlay.el (ivy-display-function-overlay): Fix org-indent-mode once more, Oleh Krehel, 2019/07/20
- [elpa] master ef1e8d5 294/399: ivy.el (ivy-read): Don't use ivy-display-function, Oleh Krehel, 2019/07/20
- [elpa] master 57a57d1 302/399: swiper.el (swiper--multi-candidates): Simplify, Oleh Krehel, 2019/07/20
- [elpa] master 44b2d7d 300/399: ivy.el (ivy-insert-current-full): Add and bind to "C-M-y", Oleh Krehel, 2019/07/20