[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/mct a55130a 06/70: Avoid hardcoding the "Completions" s
From: |
ELPA Syncer |
Subject: |
[elpa] externals/mct a55130a 06/70: Avoid hardcoding the "Completions" string |
Date: |
Thu, 11 Nov 2021 03:57:40 -0500 (EST) |
branch: externals/mct
commit a55130aa6981310a7f5f3bf6b7af19d93b7d203f
Author: Protesilaos Stavrou <info@protesilaos.com>
Commit: Protesilaos Stavrou <info@protesilaos.com>
Avoid hardcoding the "Completions" string
---
mct.el | 18 +++++++++---------
1 file changed, 9 insertions(+), 9 deletions(-)
diff --git a/mct.el b/mct.el
index dd4689d..dbeec15 100644
--- a/mct.el
+++ b/mct.el
@@ -207,7 +207,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)
- (fit-window-to-buffer (get-buffer-window "*Completions*")
+ (fit-window-to-buffer (mct--get-completion-window)
(floor (frame-height) 2) 1))
(defun mct--input-string ()
@@ -356,7 +356,7 @@ by `mct-completion-windows-regexp'."
(defun mct-list-completions-toggle ()
"Toggle the presentation of the completions' buffer."
(interactive nil mct-mode)
- (if (get-buffer-window "*Completions*" 0)
+ (if (mct--get-completion-window)
(minibuffer-hide-completions)
(mct--show-completions)))
@@ -378,7 +378,7 @@ by `mct-completion-windows-regexp'."
(defun mct--switch-to-completions ()
"Subroutine for switching to the completions' buffer."
- (unless (get-buffer-window "*Completions*" 0)
+ (unless (mct--get-completion-window)
(save-excursion (minibuffer-completion-help)))
(switch-to-completions)
(mct--fit-completions-window))
@@ -449,14 +449,14 @@ minibuffer."
(defun mct--line-completion (n)
"Select completion on Nth line."
- (with-current-buffer "*Completions*"
+ (with-current-buffer (window-buffer (mct--get-completion-window))
(goto-char (point-min))
(forward-line (1- n))
(choose-completion)))
(defun mct--line-bounds (n)
"Test if Nth line is in the buffer."
- (with-current-buffer "*Completions*"
+ (with-current-buffer (window-buffer (mct--get-completion-window))
(let ((bounds (count-lines (point-min) (point-max))))
(unless (<= n bounds)
(user-error "%d is not within the buffer bounds (%d)" n bounds)))))
@@ -471,7 +471,7 @@ minibuffer."
(defun mct--line-number-selection ()
"Show line numbers and select one of them."
- (with-current-buffer "*Completions*"
+ (with-current-buffer (window-buffer (mct--get-completion-window))
(let ((mct-show-completion-line-numbers t))
(if (bound-and-true-p display-line-numbers-mode)
(mct-goto-line)
@@ -495,7 +495,7 @@ Completions' buffer."
(let ((mct-remove-shadowed-file-names t)
(mct-live-update-delay most-positive-fixnum)
(enable-recursive-minibuffers t))
- (unless (get-buffer-window "*Completions*" 0)
+ (unless (mct--get-completion-window)
(mct--show-completions))
(if (or (and (derived-mode-p 'completion-list-mode)
(active-minibuffer-window))
@@ -535,10 +535,10 @@ Otherwise behave like `mct-choose-completion-exit'."
;; If we focus the Completions' buffer at least once, then
;; everything works as expected.
(when (or (and (minibufferp)
- (get-buffer-window "*Completions*" 0))
+ (mct--get-completion-window))
(and (derived-mode-p 'completion-list-mode)
(active-minibuffer-window)))
- (with-current-buffer "*Completions*"
+ (with-current-buffer (window-buffer (mct--get-completion-window))
(setq string (get-text-property (point) 'completion--string)))
(if string
(progn
- [elpa] externals/mct 79b2643 07/70: Remove unused user-error message, (continued)
- [elpa] externals/mct 79b2643 07/70: Remove unused user-error message, ELPA Syncer, 2021/11/11
- [elpa] externals/mct 609fd0a 12/70: Move findex and vindex annotations to their actual mentions, ELPA Syncer, 2021/11/11
- [elpa] externals/mct 4882ed6 17/70: Note display-buffer in mct-display-buffer-action, ELPA Syncer, 2021/11/11
- [elpa] externals/mct e75a6c6 19/70: Update mct-display-buffer-action with sample conf, ELPA Syncer, 2021/11/11
- [elpa] externals/mct 982b4ee 20/70: Note mct-completions-format needs mct-mode restart, ELPA Syncer, 2021/11/11
- [elpa] externals/mct 1b0ab0b 21/70: Untabify and re-indent, ELPA Syncer, 2021/11/11
- [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 <=
- [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, 2021/11/11
- [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