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

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

[elpa] externals/corfu-doc 8170be8375 77/95: Fix duplicate code


From: ELPA Syncer
Subject: [elpa] externals/corfu-doc 8170be8375 77/95: Fix duplicate code
Date: Tue, 19 Jul 2022 15:58:06 -0400 (EDT)

branch: externals/corfu-doc
commit 8170be83750dc645257b292bc434e32692e127cc
Author: Yuwei Tian <ibluefocus@outlook.com>
Commit: Yuwei Tian <ibluefocus@outlook.com>

    Fix duplicate code
---
 corfu-doc.el | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/corfu-doc.el b/corfu-doc.el
index 9e81173606..10d6ad8011 100644
--- a/corfu-doc.el
+++ b/corfu-doc.el
@@ -412,8 +412,8 @@ FWIDTH and FHEIGHT."
            (equal candidate-index corfu--index))))
 
 (defun corfu-doc--manual-popup-show (&optional candidate-index)
-  (unless (corfu-doc--popup-support-p)
     (error "Corfu-doc requires child frames to display documentation."))
+  (unless (corfu--popup-support-p)
   (when (corfu-doc--should-show-popup candidate-index)
     (when-let ((candidate (corfu-doc--get-candidate))
                (cf-popup-edges (corfu-doc--get-cf-popup-edges)))
@@ -458,9 +458,6 @@ FWIDTH and FHEIGHT."
      (advice-remove 'corfu--popup-show #'corfu-doc--popup-show)
      (advice-remove 'corfu--popup-hide #'corfu-doc--popup-hide))))
 
-(defun corfu-doc--popup-support-p ()
-  (display-graphic-p))
-
 (defun corfu-doc--popup-visible-p ()
   (and (frame-live-p corfu-doc--frame)
        (frame-visible-p corfu-doc--frame)))
@@ -487,7 +484,7 @@ FWIDTH and FHEIGHT."
   (when corfu-doc--auto-timer
     (cancel-timer corfu-doc--auto-timer)
     (setq corfu-doc--auto-timer nil))
-  (when (corfu-doc--popup-support-p)
+  (when (corfu--popup-support-p)
     (if-let ((candidate (corfu-doc--get-candidate)))
         (progn
           (if (corfu-doc--should-refresh-popup candidate)



reply via email to

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