[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/mct fbd2bf7183 09/21: DEPRECATE mct-display-buffer-acti
From: |
ELPA Syncer |
Subject: |
[elpa] externals/mct fbd2bf7183 09/21: DEPRECATE mct-display-buffer-action |
Date: |
Sat, 25 Mar 2023 15:59:00 -0400 (EDT) |
branch: externals/mct
commit fbd2bf71831098b00163684d491eb6bc98225594
Author: Protesilaos Stavrou <info@protesilaos.com>
Commit: Protesilaos Stavrou <info@protesilaos.com>
DEPRECATE mct-display-buffer-action
---
README.org | 90 +-------------------------------------------------------------
mct.el | 30 ++-------------------
2 files changed, 3 insertions(+), 117 deletions(-)
diff --git a/README.org b/README.org
index a3bde1f4f0..dc0dcb5da2 100644
--- a/README.org
+++ b/README.org
@@ -567,12 +567,6 @@ The display of the =*Completions*= can be toggled at any
time from inside
the minibuffer with =C-l= (mnemonic is "[l]ist completions" and the
command is ~mct-list-completions-toggle~).
-#+vindex: mct-display-buffer-action
-By default, the =*Completions*= buffer appears in a window at the bottom
-of the frame. Users can change its placement by configuring the
-variable ~mct-display-buffer-action~ (its doc string explains how and
-provides sample code).
-
This is not the same for in-buffer completion performed by
~mct-region-mode~ ([[#h:97eb5898-1e52-4338-bd55-8c52f9d8ccd3][Interaction
model of mct-region-mode]]).
@@ -840,16 +834,6 @@ And with more options:
;; disables live completions altogether.
(setq mct-completion-blocklist nil)
-;; You can place the Completions' buffer wherever you want, by following
-;; the syntax of `display-buffer'. For example, try this:
-
-;; (setq mct-display-buffer-action
-;; (quote ((display-buffer-reuse-window
-;; display-buffer-in-side-window)
-;; (side . left)
-;; (slot . 99)
-;; (window-width . 0.3))))
-
(mct-minibuffer-mode 1)
;; Optionally use MCT for in-buffer completion (though `corfu' is a
@@ -1071,76 +1055,6 @@ Add this to your own configuration file instead:
(define-key minibuffer-local-filename-completion-map (kbd "DEL")
#'my-backward-updir)
#+end_src
-** MCT in the current or the other window
-:PROPERTIES:
-:CUSTOM_ID: h:891c7841-9cdc-42df-bba9-45f7409b807c
-:END:
-
-Over at the [[https://git.sr.ht/~abcdw/rde][rde project]], Andrew Tropin
configures MCT to display the
-Completions' buffer in either of two places:
-
-+ Current window :: This is the default behaviour. It means that
- completions are presented where the user is already focused on,
- instead of the bottom of the display or some side window.
-
-+ Other window :: The least recently used window when the command that
- performs completion matches certain categories whose candidates are
- best shown next to the current window/context. For example, Imenu
- (and extensions like ~consult-imenu~) creates a dynamically generated
- index of "points of interest" in the current buffer, so it is useful
- to have this displayed in the other window.
-
-Implementation details and particular preferences aside, this is a great
-example of using the various ~display-buffer~ functions to control the
-placement of the =*Completions*= buffer.
-
-#+begin_src emacs-lisp
-(defvar rde-completion-categories-other-window
- '(imenu)
- "Completion categories that has to be in other window than
-current, otherwise preview functionallity will fail the party.")
-
-(defvar rde-completion-categories-not-show-candidates-on-setup
- '(command variable function)
- "Completion categories that has to be in other window than
-current, otherwise preview functionallity will fail the party.")
-
-(defun rde-display-mct-buffer-pop-up-if-apropriate (buffer alist)
- "Call `display-buffer-pop-up-window' if the completion category
-one of `rde-completion-categories-other-window', it will make
-sure that we don't use same window for completions, which should
-be in separate window."
- (if (memq (mct--completion-category)
- rde-completion-categories-other-window)
- (display-buffer-pop-up-window buffer alist)
- nil))
-
-(defun rde-display-mct-buffer-apropriate-window (buffer alist)
- "Displays completion buffer in the same window, where completion
-was initiated (most recent one), but in case, when compeltion
-buffer should be displayed in other window use least recent one."
- (let* ((window (if (memq (mct--completion-category)
- rde-completion-categories-other-window)
- (get-lru-window (selected-frame) nil nil)
- (get-mru-window (selected-frame) nil nil))))
- (window--display-buffer buffer window 'reuse alist)))
-
-(setq mct-display-buffer-action
- (quote ((display-buffer-reuse-window
- rde-display-mct-buffer-pop-up-if-apropriate
- rde-display-mct-buffer-apropriate-window))))
-
-(defun rde-mct-show-completions ()
- "Instantly shows completion candidates for categories listed in
-`rde-completion-categories-show-candidates-on-setup'."
- (unless (memq (mct--completion-category)
- rde-completion-categories-not-show-candidates-on-setup)
- (setq-local mct-minimum-input 0)
- (mct--live-completions)))
-
-(add-hook 'minibuffer-setup-hook 'rde-mct-show-completions)
-#+end_src
-
* Third-party extensions
:PROPERTIES:
:CUSTOM_ID: h:03227254-d467-4147-b8cf-2fe05a2e279b
@@ -1268,9 +1182,7 @@ They all make for a natural complement to the standard
Emacs experience
The presence of a fully fledged buffer means that the user can invoke
all relevant commands at their disposal, such as to write the buffer
to a file for future review, use Isearch to move around, copy a string
- or rectangle to a register, and so on. Also, the placement of such a
- buffer is configurable (as with all buffers---though refer, in
- particular, to ~mct-display-buffer-action~).
+ or rectangle to a register, and so on.
Vertico has official extensions which can make it work exactly like
MCT without any of MCT's drawbacks. These extensions can also expand
diff --git a/mct.el b/mct.el
index dbc2d059eb..c381bd6f83 100644
--- a/mct.el
+++ b/mct.el
@@ -177,30 +177,6 @@ Read the manual for known completion categories."
:type '(repeat symbol)
:group 'mct)
-(defcustom mct-display-buffer-action
- '((display-buffer-reuse-window display-buffer-at-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\".
-
-Sample configuration:
-
- (setq mct-display-buffer-action
- (quote ((display-buffer-reuse-window
- display-buffer-in-side-window)
- (side . left)
- (slot . 99)
- (window-width . 0.3))))
-
-See Info node `(elisp) Displaying Buffers' for more details
-and/or the documentation string of `display-buffer'."
- :type '(cons (choice (function :tag "Display Function")
- (repeat :tag "Display Functions" function))
- alist)
- :group 'mct)
-
(defcustom mct-completions-format 'one-column
"Set the presentation of candidates in the Completions' buffer.
See `completions-format' for possible values."
@@ -208,6 +184,7 @@ See `completions-format' for possible values."
:group 'mct)
(make-obsolete 'mct-region-completions-format 'mct-completions-format "0.5.0")
+(make-obsolete-variable 'mct-display-buffer-action nil "1.0.0")
(defcustom mct-persist-dynamic-completion t
"When non-nil, keep dynamic completion live.
@@ -523,11 +500,8 @@ Apply APP by first setting up the minibuffer to work with
Mct."
(buffer-name (window-buffer window))))))
(defun mct--show-completions ()
- (let ((display-buffer-alist
- (cons (cons mct--completions-window-name mct-display-buffer-action)
- display-buffer-alist))
- ;; don't ring the bell in `minibuffer-completion-help'
"Show the Completions buffer."
+ (let (;; don't ring the bell in `minibuffer-completion-help'
;; when <= 1 completion exists.
(ring-bell-function #'ignore)
(message-log-max nil)
- [elpa] externals/mct updated (3f15ff6f62 -> ea1edfff5e), ELPA Syncer, 2023/03/25
- [elpa] externals/mct cef37c3bc8 02/21: Remove files that will not be used henceforth (DEVELOPMENT RESTART), ELPA Syncer, 2023/03/25
- [elpa] externals/mct fbd2bf7183 09/21: DEPRECATE mct-display-buffer-action,
ELPA Syncer <=
- [elpa] externals/mct 443e2bd76b 06/21: DEPRECATE mct-apply-completion-stripes, ELPA Syncer, 2023/03/25
- [elpa] externals/mct b95aa0f8e5 01/21: Development restarts; remove old notices, ELPA Syncer, 2023/03/25
- [elpa] externals/mct 33df7c9b43 13/21: Use line-{beginning, end}-position where relevant, ELPA Syncer, 2023/03/25
- [elpa] externals/mct 96a486eff4 17/21: Remove reference to Emacs 27; 28 is the minimum, ELPA Syncer, 2023/03/25
- [elpa] externals/mct f52ee53d39 20/21: DELETE mct-region-mode; remove remaining extras, ELPA Syncer, 2023/03/25
- [elpa] externals/mct ea1edfff5e 21/21: Merge branch 'restart-development', ELPA Syncer, 2023/03/25
- [elpa] externals/mct 00a8dccf82 08/21: Fix mct-live-completion :type for one option, ELPA Syncer, 2023/03/25
- [elpa] externals/mct c342943ae8 14/21: Add README.md to make it easier for all Git forges, ELPA Syncer, 2023/03/25
- [elpa] externals/mct d90dd8372f 18/21: Update package information, ELPA Syncer, 2023/03/25
- [elpa] externals/mct 4f0088b2a2 19/21: Make the blocklist take precedence over the passlist, ELPA Syncer, 2023/03/25