emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/mct 76d3ee9f0a 10/21: DEPRECATE mct-completions-format


From: ELPA Syncer
Subject: [elpa] externals/mct 76d3ee9f0a 10/21: DEPRECATE mct-completions-format
Date: Sat, 25 Mar 2023 15:59:01 -0400 (EDT)

branch: externals/mct
commit 76d3ee9f0a614ea539027ffae446c78f90d786f6
Author: Protesilaos Stavrou <info@protesilaos.com>
Commit: Protesilaos Stavrou <info@protesilaos.com>

    DEPRECATE mct-completions-format
---
 README.org | 23 ------------------
 mct.el     | 81 ++++----------------------------------------------------------
 2 files changed, 4 insertions(+), 100 deletions(-)

diff --git a/README.org b/README.org
index dc0dcb5da2..71bc748959 100644
--- a/README.org
+++ b/README.org
@@ -90,28 +90,6 @@ input threshold as well as a slight delay before it pops up 
the
 MCT is highly configurable to adapt to the varying needs of users.  This
 section documents each user option.
 
-** Format of the Completions
-:PROPERTIES:
-:CUSTOM_ID: h:2706287d-c887-4356-a6f4-f6c7f9824ffe
-:END:
-#+vindex: mct-completions-format
-
-Brief: Set the presentation of candidates in the Completions' buffer.
-
-Symbol: ~mct-completions-format~ (=choice= type)
-
-Possible values:
-
-1. ~one-column~ (default---only works on Emacs 28 or higher)
-2. ~horizontal~
-3. ~vertical~
-
-By default, MCT tries to display completion candidates in a single
-column.  This only works for Emacs version 28 or higher.  In older
-versions of Emacs, the choices are between two grid views as explained
-in the built-in user option ~completions-format~, with the fallback being
-the ~horizontal~ style.
-
 ** Live completion
 :PROPERTIES:
 :CUSTOM_ID: h:1a85ed4c-f54d-482b-9915-563f60c64f15
@@ -811,7 +789,6 @@ And with more options:
 (setq mct-live-completion t)
 (setq mct-live-update-delay 0.6)
 (setq mct-persist-dynamic-completion t)
-(setq mct-completions-format 'one-column)
 
 ;; This is for commands or completion categories that should always pop
 ;; up the completions' buffer.  It circumvents the default method of
diff --git a/mct.el b/mct.el
index c381bd6f83..2e60c42f77 100644
--- a/mct.el
+++ b/mct.el
@@ -177,14 +177,8 @@ Read the manual for known completion categories."
   :type '(repeat symbol)
   :group 'mct)
 
-(defcustom mct-completions-format 'one-column
-  "Set the presentation of candidates in the Completions' buffer.
-See `completions-format' for possible values."
-  :type '(choice (const horizontal) (const vertical) (const one-column))
-  :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")
+(make-obsolete-variable 'mct-completions-format nil "1.0.0")
 
 (defcustom mct-persist-dynamic-completion t
   "When non-nil, keep dynamic completion live.
@@ -270,7 +264,6 @@ affairs."
 (defvar mct--dynamic-completion-categories '(file)
   "Completion categories that perform dynamic completion.")
 
-
 (define-obsolete-variable-alias
   'mct-hl-line 'mct-highlight-candidate "0.3.0")
 ;;;; Basics of intersection between minibuffer and Completions buffer
@@ -427,21 +420,9 @@ Meant to be added to `after-change-functions'."
     (buffer-local-value 'mct-region-mode buf)))
 
 (defun mct--minibuffer-completion-help-advice (&rest app)
-  "Prepare advice around `display-completion-list'.
-Apply APP by first let binding the `completions-format' to
-`mct-completions-format'."
+  "Prepare APP advice around `display-completion-list'."
   (if (mct--minibuffer-p)
-      (let ((completions-format mct-completions-format))
-        (apply app)
-        (mct--fit-completions-window))
-    (apply app)))
-
-(defun mct--region-completion-help-advice (&rest app)
-  "Prepare advice around `display-completion-list'.
-Apply APP by first let binding the `completions-format' to
-`mct-completions-format'."
-  (if (mct--region-p)
-      (let ((completions-format mct-completions-format))
+      (let ((completions-format 'one-column))
         (apply app)
         (mct--fit-completions-window))
     (apply app)))
@@ -576,17 +557,6 @@ by `mct--completions-window-name'."
     (next-completion -1)
     (point)))
 
-(defun mct--completions-line-boundary (boundary)
-  "Determine if current line has reached BOUNDARY.
-BOUNDARY is a line position at the top or bottom of the
-Completions' buffer.  See `mct--first-completion-point' or
-`mct--last-completion-point'.
-
-This check only applies when `completions-format' is not assigned
-a `one-column' value."
-  (and (= (line-number-at-pos) (line-number-at-pos boundary))
-       (not (mct--one-column-p))))
-
 (defun mct--completions-no-completion-line-p (arg)
   "Check if ARGth line has a completion candidate."
   (save-excursion
@@ -649,33 +619,12 @@ a `one-column' value."
 ARG is a numeric argument for `next-completion', as described in
 `mct-next-completion-or-mini'."
   (or (eobp)
-      (mct--completions-line-boundary (mct--last-completion-point))
       (= (save-excursion (next-completion arg) (point)) (point-max))
+      (= (save-excursion (forward-line arg) (point)) (point-max))
       ;; The empty final line case which should avoid candidates with
       ;; spaces or line breaks...
       (mct--empty-line-p arg)))
 
-(defun mct--next-completion (arg)
-  "Routine to move to the next ARGth completion candidate."
-  (if (not (mct--one-column-p))
-      ;; Retaining the column number ensures that things work
-      ;; intuitively in a grid view.
-      (let ((col (current-column)))
-        ;; The `when' is meant to skip past lines that do not
-        ;; contain completion candidates, such as those with
-        ;; `completions-group-format'.
-        (when (mct--completions-no-completion-line-p (or arg 1))
-          (if arg
-              (setq arg 2)
-            (setq arg (1+ arg))))
-        (vertical-motion (or arg 1))
-        (unless (eq col (save-excursion (goto-char (point-at-bol)) 
(current-column)))
-          (line-move-to-column col))
-        (when (or (> (current-column) col)
-                  (not (mct--completion-at-point-p)))
-          (next-completion -1)))
-    (next-completion (or arg 1))))
-
 (defun mct-next-completion-or-mini (&optional arg)
   "Move to the next completion or switch to the minibuffer.
 This performs a regular motion for optional ARG candidates, but
@@ -698,32 +647,10 @@ the minibuffer."
 ARG is a numeric argument for `previous-completion', as described in
 `mct-previous-completion-or-mini'."
   (or (bobp)
-      (mct--completions-line-boundary (mct--first-completion-point))
       (mct--motion-below-point-min-p arg)
       ;; FIXME 2021-12-27: Why do we need this now?  Regression upstream?
       (eq (line-number-at-pos) 1)))
 
-(defun mct--previous-completion (arg)
-  "Routine to move to the previous ARGth completion candidate."
-  (if (not (mct--one-column-p))
-      ;; Retaining the column number ensures that things work
-      ;; intuitively in a grid view.
-      (let ((col (current-column)))
-        ;; The `when' is meant to skip past lines that do not
-        ;; contain completion candidates, such as those with
-        ;; `completions-group-format'.
-        (when (mct--completions-no-completion-line-p (or (- arg) -1))
-          (if arg
-              (setq arg 2)
-            (setq arg (1+ arg))))
-        (vertical-motion (or (- arg) -1))
-        (unless (eq col (save-excursion (goto-char (point-at-bol)) 
(current-column)))
-          (line-move-to-column col))
-        (when (or (> (current-column) col)
-                  (not (mct--completion-at-point-p)))
-          (next-completion -1)))
-    (previous-completion (or (abs arg) 1))))
-
 (defun mct-previous-completion-or-mini (&optional arg)
   "Move to the previous completion or switch to the minibuffer.
 This performs a regular motion for optional ARG candidates, but



reply via email to

[Prev in Thread] Current Thread [Next in Thread]