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

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

[elpa] externals/mct d21edfb 26/70: Make mct--fit-completions-window mor


From: ELPA Syncer
Subject: [elpa] externals/mct d21edfb 26/70: Make mct--fit-completions-window more robust
Date: Thu, 11 Nov 2021 03:57:44 -0500 (EST)

branch: externals/mct
commit d21edfb0640f45df184985bac11fbf3428a887db
Author: Protesilaos Stavrou <info@protesilaos.com>
Commit: Protesilaos Stavrou <info@protesilaos.com>

    Make mct--fit-completions-window more robust
---
 mct.el | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/mct.el b/mct.el
index 2ba0f75..70c86b7 100644
--- a/mct.el
+++ b/mct.el
@@ -256,10 +256,10 @@ Add this to `completion-list-mode-hook'."
 
 (defun mct--fit-completions-window ()
   "Fit Completions' buffer to its window."
-  (setq-local window-resize-pixelwise t)
-  (select-window (mct--get-completion-window))
-  (fit-window-to-buffer (mct--get-completion-window)
-                        (floor (frame-height) 2) 1))
+  (when-let ((window (mct--get-completion-window)))
+    (with-current-buffer (window-buffer window)
+      (setq-local window-resize-pixelwise t))
+    (fit-window-to-buffer window (floor (frame-height) 2) 1)))
 
 (defun mct--input-string ()
   "Return the contents of the minibuffer as a string."



reply via email to

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