branch: externals/mct
commit 85ecd5a53c021983e21d9ef215310673eeaae896
Author: Protesilaos Stavrou <i...@protesilaos.com>
Commit: Protesilaos Stavrou <i...@protesilaos.com>

    Make check for first candidate account for completions-header-format (Emacs 
29)
---
 mct.el | 25 +++++++++++++------------
 1 file changed, 13 insertions(+), 12 deletions(-)

diff --git a/mct.el b/mct.el
index de03c41f5d..ca3d58c0c1 100644
--- a/mct.el
+++ b/mct.el
@@ -331,18 +331,19 @@ This function can be used as the value of the user option
 ;; beginning of the line, unless the point was moved forward).
 (defun mct--setup-clean-completions ()
   "Keep only completion candidates in the Completions."
-  (with-current-buffer standard-output
-    (unless (mct--first-line-completion-p)
-      (goto-char (point-min))
-      (let ((inhibit-read-only t))
-        (delete-region (line-beginning-position) (1+ (line-end-position)))
-        (insert (propertize " "
-                            'cursor-sensor-functions
-                            (list
-                             (lambda (_win prev dir)
-                               (when (eq dir 'entered)
-                                 (goto-char prev))))))
-        (put-text-property (point-min) (point) 'invisible t)))))
+  (unless completions-header-format
+    (with-current-buffer standard-output
+      (unless (mct--first-line-completion-p)
+        (goto-char (point-min))
+        (let ((inhibit-read-only t))
+          (delete-region (line-beginning-position) (1+ (line-end-position)))
+          (insert (propertize " "
+                              'cursor-sensor-functions
+                              (list
+                               (lambda (_win prev dir)
+                                 (when (eq dir 'entered)
+                                   (goto-char prev))))))
+          (put-text-property (point-min) (point) 'invisible t))))))
 
 (defun mct-frame-height-third ()
   "Return round number of 1/3 of `frame-height'.

Reply via email to