[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/mct 436b24e 13/70: Allow customizing how the Completion
From: |
ELPA Syncer |
Subject: |
[elpa] externals/mct 436b24e 13/70: Allow customizing how the Completions buffer is displayed |
Date: |
Thu, 11 Nov 2021 03:57:42 -0500 (EST) |
branch: externals/mct
commit 436b24e59d2981e9732f7e7a127daefc28a9c0f7
Author: Philip Kaludercic <philipk@posteo.net>
Commit: Protesilaos Stavrou <info@protesilaos.com>
Allow customizing how the Completions buffer is displayed
---
mct.el | 31 ++++++++++++++++++++++++-------
1 file changed, 24 insertions(+), 7 deletions(-)
diff --git a/mct.el b/mct.el
index 7c294ac..acbbfaf 100644
--- a/mct.el
+++ b/mct.el
@@ -118,6 +118,21 @@ delay introduced by `mct-live-update-delay'."
:type '(repeat symbol)
:group 'mct)
+(defcustom mct-display-buffer-action
+ '((display-buffer-in-side-window)
+ (side . bottom))
+ "The action used to display the Completions' buffer.
+
+The value has the form (FUNCTION . ALIST), where FUNCTIONS is
+either an \"action function\" or a possibly empty list of action
+functions. ALIST is a possibly empty \"action alist\".
+See Info node `(elisp) Displaying Buffers' for more details."
+ :type '(cons (choice (function :tag "Display Function")
+ (repeat :tag "Display Functions" function))
+ alist)
+ :group 'mct)
+
+
;;;; Basic helper functions
;; Copied from icomplete.el
@@ -217,6 +232,7 @@ 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))
@@ -248,8 +264,7 @@ Meant to be added to `after-change-functions'."
;; don't ring the bell in
`minibuffer-completion-help'
;; when <= 1 completion exists.
(ring-bell-function #'ignore))
- (minibuffer-completion-help)
- (mct--fit-completions-window))))
+ (mct--show-completions))))
(quit (abort-recursive-edit)))
(minibuffer-hide-completions))))))
@@ -337,8 +352,11 @@ Meant to be added to `after-change-functions'."
(defun mct--show-completions ()
"Show the completions' buffer."
- (save-excursion (minibuffer-completion-help))
- (mct--fit-completions-window))
+ (let ((display-buffer-alist
+ (cons (cons mct-completion-windows-regexp mct-display-buffer-action)
+ display-buffer-alist)))
+ (save-excursion (minibuffer-completion-help)))
+ (fit-window-to-buffer (mct--get-completion-window)))
;;;###autoload
(defun mct-focus-mini-or-completions ()
@@ -390,9 +408,8 @@ by `mct-completion-windows-regexp'."
(defun mct--switch-to-completions ()
"Subroutine for switching to the completions' buffer."
(unless (mct--get-completion-window)
- (save-excursion (minibuffer-completion-help)))
- (switch-to-completions)
- (mct--fit-completions-window))
+ (mct--show-completions))
+ (switch-to-completions))
(defun mct-switch-to-completions-top ()
"Switch to the top of the completions' buffer."
- [elpa] externals/mct 5c0e138 22/70: Recompile texi/info manuald, (continued)
- [elpa] externals/mct 5c0e138 22/70: Recompile texi/info manuald, ELPA Syncer, 2021/11/11
- [elpa] externals/mct 45c272e 25/70: Add a .dir-locals.el file, ELPA Syncer, 2021/11/11
- [elpa] externals/mct 295bac0 28/70: Generate mct.info and mct.texi using a Makefile, ELPA Syncer, 2021/11/11
- [elpa] externals/mct 789174f 31/70: Update sample code with useful built-in extras, ELPA Syncer, 2021/11/11
- [elpa] externals/mct a55130a 06/70: Avoid hardcoding the "Completions" string, ELPA Syncer, 2021/11/11
- [elpa] externals/mct b392b0b 15/70: Allow for completions-format to be configured by the user, ELPA Syncer, 2021/11/11
- [elpa] externals/mct c36c7e8 11/70: Add new option mct-live-completion, ELPA Syncer, 2021/11/11
- [elpa] externals/mct 1084f58 16/70: Clarify mct-live-completion doc string, ELPA Syncer, 2021/11/11
- [elpa] externals/mct 310cc42 01/70: Initial commit, ELPA Syncer, 2021/11/11
- [elpa] externals/mct ccce90d 08/70: Make line number selection always exit minibuffer, ELPA Syncer, 2021/11/11
- [elpa] externals/mct 436b24e 13/70: Allow customizing how the Completions buffer is displayed,
ELPA Syncer <=
- [elpa] externals/mct 9e0d523 18/70: Change default value of mct-display-buffer-action, ELPA Syncer, 2021/11/11
- [elpa] externals/mct 51c1e17 23/70: Reuse existing Completions' before re-displaying, ELPA Syncer, 2021/11/11
- [elpa] externals/mct 0d98ba7 30/70: Include mct-display-buffer-action in the manual, ELPA Syncer, 2021/11/11
- [elpa] externals/mct 08f806e 29/70: Do not set completions-detailed, ELPA Syncer, 2021/11/11
- [elpa] externals/mct 25f876c 34/70: Do not use line-based completion in grid views, ELPA Syncer, 2021/11/11
- [elpa] externals/mct 8522a67 38/70: Add mct-choose-completion-no-exit command, ELPA Syncer, 2021/11/11
- [elpa] externals/mct 2e8c44a 40/70: Tweak mct-beginning-of-buffer, ELPA Syncer, 2021/11/11
- [elpa] externals/mct 099e204 42/70: Make mct-choose-completion-dwim never exit, ELPA Syncer, 2021/11/11
- [elpa] externals/mct be15b4b 44/70: Re-order mct-completion-list-mode-map, ELPA Syncer, 2021/11/11
- [elpa] externals/mct 640ce43 24/70: Update code sample in mct-display-buffer-action, ELPA Syncer, 2021/11/11