[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/corfu-doc 48f629a0c2 87/95: Add new option to choose th
From: |
ELPA Syncer |
Subject: |
[elpa] externals/corfu-doc 48f629a0c2 87/95: Add new option to choose the method to transition the doc popup |
Date: |
Tue, 19 Jul 2022 15:58:07 -0400 (EDT) |
branch: externals/corfu-doc
commit 48f629a0c225baaed3b1bc4d1a749fbe0a0ee5f4
Author: Yuwei Tian <ibluefocus@outlook.com>
Commit: Yuwei Tian <ibluefocus@outlook.com>
Add new option to choose the method to transition the doc popup
* corfu-doc.el (corfu-doc-hide-threshold): Remove variable.
* README.org: update documentation.
---
README.org | 8 --------
corfu-doc.el | 40 +++++++++++++++++++++++++++-------------
2 files changed, 27 insertions(+), 21 deletions(-)
diff --git a/README.org b/README.org
index a2271697a1..50d869e977 100644
--- a/README.org
+++ b/README.org
@@ -24,14 +24,6 @@ Enable it with =M-x corfu-doc-mode= or by using
=corfu-mode-hook=:
(add-hook 'corfu-mode-hook #'corfu-doc-mode)
#+end_src
-You can adjust the time it takes to show the documentation popup by changing
-=corfu-doc-delay=. You could control whether to hide the documentation popup
-immediately or just clear the documentation frame content when browsing the
-candidates by setting the value of =corfu-doc-hide-threshold= smaller or
greater
-than the value of =corfu-doc-delay=. You could try to set the value of
-=corfu-doc-delay= to =0= to reduce the popup flickering if your computer has
-good performance, it may cause operation jams.
-
** Scroll the documentation
Bind keys =M-p= and =M-n= to commands =corfu-doc-scroll-down= and
diff --git a/corfu-doc.el b/corfu-doc.el
index 4387189079..3c0db30a09 100644
--- a/corfu-doc.el
+++ b/corfu-doc.el
@@ -54,13 +54,27 @@ The value of nil means no delay."
(const :tag "immediate (0)" 0)
(number :tag "seconds")))
-(defcustom corfu-doc-hide-threshold 0.2
- "Threshold value to hide the documentation popup when browsing candidates.
+(defcustom corfu-doc-transition nil
+ "The method to transition the documentaion popup when browsing candidates.
-When the selected candidate is changed, if the value of `corfu-doc-delay'
-is greater than this threshold value, the documentation popup frame will
-be hided immediately. Else, just clear the doc frame content."
- :type 'float)
+The documentaion popup transition only works when `corfu-auto-delay'
+is non-nil and its value is greater than 0.
+
+If this is nil, there is no transition (do nothing), the doc popup
+preserves the content of the last candidate.
+
+If the value is 'clear, the documentation content of the last candidate
+will be cleared on documentation popup transition.
+
+If the value is 'hide, the documentation popup will be hidden
+when brwosing candidates.
+
+It is recommended to select the corresponding transition method
+according to the value of `corfu-doc-delay' to reduce flicker or
+documentation update delay."
+ :type '(choice (const :tag "no transition (nil)" nil)
+ (const :tag "clear content" clear)
+ (const :tag "hide popup" hide)))
(defcustom corfu-doc-max-width 60
"The max width of the corfu doc frame in characters."
@@ -489,16 +503,16 @@ The optional CANDIDATE-INDEX is the the current
completion candidate index."
corfu-doc--cf-popup-edges)))
(defun corfu-doc--popup-transition ()
- "Transition when showing or updating the doc popup."
+ "Transition when updating the documentation popup."
(when (corfu-doc--popup-visible-p)
(if (and corfu-doc-mode corfu-doc-auto)
(when (and (not (null corfu-doc-delay)) (> corfu-doc-delay 0))
- (if (> corfu-doc-delay corfu-doc-hide-threshold)
- (corfu-doc--make-popup-invisible)
- ;; clear buffer and update popup position immediately
- (corfu-doc--clear-buffer)
- (when (corfu-doc--cf-popup-edges-changed-p)
- (corfu-doc--refresh-popup))))
+ (pcase corfu-doc-transition
+ ('clear
+ (corfu-doc--clear-buffer)
+ (corfu-doc--refresh-popup))
+ ('hide (corfu-doc--make-popup-invisible))
+ (_ (corfu-doc--refresh-popup))))
(corfu-doc--popup-hide))))
(defun corfu-doc--popup-show (&rest _args)
- [elpa] externals/corfu-doc 95a1a1731d 51/95: Add contributions note, (continued)
- [elpa] externals/corfu-doc 95a1a1731d 51/95: Add contributions note, ELPA Syncer, 2022/07/19
- [elpa] externals/corfu-doc 122e1f5900 32/95: Only record candidate that has displayed the doc popup, ELPA Syncer, 2022/07/19
- [elpa] externals/corfu-doc 1c99932d33 57/95: Support displaying the doc frame within the parent frame, ELPA Syncer, 2022/07/19
- [elpa] externals/corfu-doc 6706526c0d 72/95: Require emacs 27.1, ELPA Syncer, 2022/07/19
- [elpa] externals/corfu-doc f9566cf13f 80/95: Version 0.6.3, ELPA Syncer, 2022/07/19
- [elpa] externals/corfu-doc 4119d58e8e 76/95: Rename calculating doc popup position function, ELPA Syncer, 2022/07/19
- [elpa] externals/corfu-doc a0508b031e 85/95: Inline the function to scroll the doc popup, ELPA Syncer, 2022/07/19
- [elpa] externals/corfu-doc 0c5bd800f6 71/95: Fix frame flicker When display the doc immediately, ELPA Syncer, 2022/07/19
- [elpa] externals/corfu-doc 7f7e251173 92/95: Fix #19: display a warning when child frames unavailable, ELPA Syncer, 2022/07/19
- [elpa] externals/corfu-doc cfca07f581 81/95: Require corfu 0.25, ELPA Syncer, 2022/07/19
- [elpa] externals/corfu-doc 48f629a0c2 87/95: Add new option to choose the method to transition the doc popup,
ELPA Syncer <=
- [elpa] externals/corfu-doc b5477fd110 90/95: Version 0.7, ELPA Syncer, 2022/07/19
- [elpa] externals/corfu-doc d05a3caeb8 02/95: Hide doc frame when there are no candidates, ELPA Syncer, 2022/07/19
- [elpa] externals/corfu-doc 53b58bbc70 01/95: Initial commit, ELPA Syncer, 2022/07/19
- [elpa] externals/corfu-doc 000388fe97 06/95: Silent a compiler warning, ELPA Syncer, 2022/07/19
- [elpa] externals/corfu-doc f89ddb7c65 12/95: Sync corfu's update on redisplay hack, ELPA Syncer, 2022/07/19
- [elpa] externals/corfu-doc 7c546a3eae 16/95: Hide popup frame when candidate documentation is empty, ELPA Syncer, 2022/07/19
- [elpa] externals/corfu-doc f030d58176 17/95: Version 0.0.4, ELPA Syncer, 2022/07/19
- [elpa] externals/corfu-doc eac54c356a 07/95: Version 0.0.2, ELPA Syncer, 2022/07/19
- [elpa] externals/corfu-doc 807af9fb2e 08/95: Fix #2: fix frame position calculation when there are multiple displays, ELPA Syncer, 2022/07/19
- [elpa] externals/corfu-doc c2460635d9 19/95: Inhibit message when fetching the candidate documentation, ELPA Syncer, 2022/07/19