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

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

[elpa] externals/corfu ec3e8cf 1/6: Print warning if corfu-mode is enabl


From: Protesilaos Stavrou
Subject: [elpa] externals/corfu ec3e8cf 1/6: Print warning if corfu-mode is enabled on text display.
Date: Thu, 29 Apr 2021 13:38:53 -0400 (EDT)

branch: externals/corfu
commit ec3e8cf927c35296192c50a90e3ae8224e2a8ac6
Author: Daniel Mendler <mail@daniel-mendler.de>
Commit: Daniel Mendler <mail@daniel-mendler.de>

    Print warning if corfu-mode is enabled on text display.
    
    Degrade gracefully, ensure that default completion stays functional.
---
 corfu.el | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/corfu.el b/corfu.el
index 33ffa3b..d0a3cef 100644
--- a/corfu.el
+++ b/corfu.el
@@ -656,8 +656,10 @@ Set to nil in order to disable confirmation."
   (remove-hook 'completion-in-region-mode-hook #'corfu--mode-hook 'local)
   (kill-local-variable 'completion-in-region-function)
   (when corfu-mode
-    (add-hook 'completion-in-region-mode-hook #'corfu--mode-hook nil 'local)
-    (setq-local completion-in-region-function #'corfu--completion-in-region)))
+    (if (or emacs-basic-display (not (display-graphic-p)))
+        (message "Corfu mode is only compatible with the graphics display.")
+      (add-hook 'completion-in-region-mode-hook #'corfu--mode-hook nil 'local)
+      (setq-local completion-in-region-function 
#'corfu--completion-in-region))))
 
 ;;;###autoload
 (define-globalized-minor-mode corfu-global-mode corfu-mode corfu--on)



reply via email to

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