]> git.eshelyaron.com Git - emacs.git/commitdiff
(completions-setup): Remove, move setup to 'completion-list-mode'
authorEshel Yaron <me@eshelyaron.com>
Wed, 3 Jul 2024 16:26:30 +0000 (18:26 +0200)
committerEshel Yaron <me@eshelyaron.com>
Wed, 3 Jul 2024 16:26:30 +0000 (18:26 +0200)
lisp/minibuffer.el
lisp/simple.el

index 4d8069836b164715e93b7982821ee32674ba5176..e45c556465d15aeb7b84cf542e9ea6eafe36e61d 100644 (file)
@@ -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)
index ca44f1c5ea5e226fac4432bd9daadf29efd73861..47047ffa617667ef3e2b3fdf080435c4c5bbccb5 100644 (file)
@@ -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."