From 47e55a577b2084309864fe315b566916feca63cd Mon Sep 17 00:00:00 2001 From: Eshel Yaron Date: Wed, 3 Jul 2024 18:26:30 +0200 Subject: [PATCH] (completions-setup): Remove, move setup to 'completion-list-mode' --- lisp/minibuffer.el | 9 +-------- lisp/simple.el | 5 ++++- 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/lisp/minibuffer.el b/lisp/minibuffer.el index 4d8069836b1..e45c556465d 100644 --- a/lisp/minibuffer.el +++ b/lisp/minibuffer.el @@ -3057,13 +3057,6 @@ completions list." (if (eq (car bounds) (length result)) 'exact 'finished)))))))))))) -(defun completions-setup () - "Set up the current buffer for displaying a list of completions." - (completion-list-mode) - (when completion-tab-width (setq tab-width completion-tab-width)) - (when completions-highlight-face (cursor-face-highlight-mode 1)) - (face-remap-add-relative 'header-line 'completions-heading)) - (defun completions-display (completions &rest plist) "Display COMPLETIONS in the buffer specified by `standard-output'. @@ -3095,7 +3088,7 @@ PLIST is a property list with optional extra information about COMPLETIONS." (goto-char (prop-match-end pm)) (get-text-property (point) 'completion--string))))))))) (with-current-buffer buf - (completions-setup) + (completion-list-mode) (let ((inhibit-read-only t)) (erase-buffer) (delete-all-overlays) diff --git a/lisp/simple.el b/lisp/simple.el index ca44f1c5ea5..47047ffa617 100644 --- a/lisp/simple.el +++ b/lisp/simple.el @@ -10141,7 +10141,10 @@ back on `completion-list-insert-choice-function' when nil." (exit-minibuffer)))))))) (define-derived-mode completion-list-mode special-mode "Completions" - "Major mode for buffers showing lists of possible completions.") + "Major mode for buffers showing lists of possible completions." + (when completion-tab-width (setq tab-width completion-tab-width)) + (when completions-highlight-face (cursor-face-highlight-mode 1)) + (face-remap-add-relative 'header-line 'completions-heading)) (defun switch-to-completions () "Select the completion list window." -- 2.39.2