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

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

[elpa] externals/mct 443e2bd76b 06/21: DEPRECATE mct-apply-completion-st


From: ELPA Syncer
Subject: [elpa] externals/mct 443e2bd76b 06/21: DEPRECATE mct-apply-completion-stripes
Date: Sat, 25 Mar 2023 15:59:00 -0400 (EDT)

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

    DEPRECATE mct-apply-completion-stripes
---
 README.org | 50 +-------------------------------------------------
 mct.el     | 58 +++-------------------------------------------------------
 2 files changed, 4 insertions(+), 104 deletions(-)

diff --git a/README.org b/README.org
index 3759f8bd44..98b03ab3b7 100644
--- a/README.org
+++ b/README.org
@@ -459,29 +459,6 @@ For example, if the user types =~/= after a long path 
name, everything
 preceding the =~/= is removed so the interactive selection process starts
 again from the user's =$HOME=.
 
-** Alternating backgrounds in the Completions
-:PROPERTIES:
-:CUSTOM_ID: h:187f325e-fb48-4b7f-9508-97f34d2242e8
-:END:
-#+vindex: mct-apply-completion-stripes
-
-Brief: Use alternating backgrounds in the Completions.
-
-Symbol: ~mct-apply-completion-stripes~ (=boolean= type)
-
-By default, the =*Completions*= buffer uses the main background of the
-active theme (more specifically the =:background= attribute of the ~default~
-face).  When set to non-nil, MCT applies applies alternating background
-colors in the Completions' buffer.  These are in a shade of gray that
-contrasts with the main background.
-
-#+vindex: mct-stripe
-Due to the specific nature of this style, there is no basic face that
-can be inherited to achieve a consistent result across themes.  As such,
-it only looks as intended with the =modus-themes= (built into Emacs 28 or
-higher or available as a package).  Other themes would need to add
-support for the ~mct-stripe~ face.
-
 ** MCT in the minibuffer and in regular buffers
 :PROPERTIES:
 :CUSTOM_ID: h:8109fe09-fcce-4212-88eb-943cc72f2c75
@@ -836,7 +813,6 @@ And with more options:
 (setq mct-completion-window-size (cons #'mct--frame-height-fraction 1))
 (setq mct-remove-shadowed-file-names t) ; works when `file-name-shadow-mode' 
is enabled
 (setq mct-hide-completion-mode-line t)
-(setq mct-apply-completion-stripes t)
 (setq mct-minimum-input 3)
 (setq mct-live-completion t)
 (setq mct-live-update-delay 0.6)
@@ -1031,30 +1007,6 @@ and/or ideas from that libary: 
<https://github.com/oantolin/embark/>.
 
 [[#h:03227254-d467-4147-b8cf-2fe05a2e279b][Third-party extensions]].
 
-* Known issues and workarounds
-:PROPERTIES:
-:CUSTOM_ID: h:acfb63f4-c2ae-46ff-a840-9c9a6350e567
-:END:
-
-This section documents known issues and how to address them.
-
-** Avoid global-hl-line-mode in the Completions
-:PROPERTIES:
-:CUSTOM_ID: h:ee6aa793-3129-4cf0-8138-1224b6052546
-:END:
-
-MCT uses its own overlay to highlight the candidate at point.  To ensure
-that it does not interfere with the optional stripes (provided by the
-user option ~mct-apply-completion-stripes~) the highlight's priority is
-set to a custom value.  This, in turn, means that when the user enables
-~global-hl-line-mode~, its highlighted line takes precedence over the MCT
-highlight.  The solution to this conflict is to disable the hl-line
-locally for the =*Completions*= buffer like this:
-
-#+begin_src emacs-lisp
-(add-hook 'completion-list-mode-hook (lambda () (setq-local 
global-hl-line-mode nil)))
-#+end_src
-
 * Keymaps
 :PROPERTIES:
 :CUSTOM_ID: h:b3178edd-f340-444c-8426-fe84f23ac9ea
@@ -1460,7 +1412,7 @@ MCT is meant to be a collective effort.  Every bit of 
help matters.
 
 + Inspiration for certain features :: =icomplete.el= (built-in---multiple
   authors), Daniel Mendler (=vertico=), Omar Antolín Camarena (=embark=,
-  =live-completions=), Štěpán Němec (=stripes.el=).
+  =live-completions=).
 
 * Official sources
 :PROPERTIES:
diff --git a/mct.el b/mct.el
index 8d8ed4e43d..bf2d0f1a6a 100644
--- a/mct.el
+++ b/mct.el
@@ -84,10 +84,7 @@ Only works when `file-name-shadow-mode' is enabled"
   :type 'boolean
   :group 'mct)
 
-(defcustom mct-apply-completion-stripes nil
-  "When non-nil, use alternating backgrounds in the Completions."
-  :type 'boolean
-  :group 'mct)
+(make-obsolete 'mct-apply-completion-stripes nil "1.0.0")
 
 (defcustom mct-live-completion t
   "Control auto-display and live-update of Completions buffer.
@@ -485,50 +482,6 @@ Apply APP by first setting up the minibuffer to work with 
Mct."
         (mct--setup-shadow-files))
     (apply app)))
 
-;;;;; Alternating backgrounds (else "stripes")
-
-;; Based on `stripes.el' (maintained by Štěpán Němec) and the
-;; `embark-collect-zebra-minor-mode' from Omar Antolín Camarena's
-;; Embark:
-;;
-;; 1. <https://gitlab.com/stepnem/stripes-el>
-;; 2. <https://github.com/oantolin/embark>
-(defface mct-stripe
-  '((default :extend t)
-    (((class color) (min-colors 88) (background light))
-     :background "#f0f0f0")
-    (((class color) (min-colors 88) (background dark))
-     :background "#191a1b"))
-  "Face for alternating backgrounds in the Completions' buffer."
-  :group 'mct)
-
-(defun mct--remove-stripes ()
-  "Remove `mct-stripe' overlays."
-  (remove-overlays nil nil 'face 'mct-stripe))
-
-(defun mct--add-stripes ()
-  "Overlay alternate rows with the `mct-stripe' face."
-  (when (derived-mode-p 'completion-list-mode)
-    (mct--remove-stripes)
-    (save-excursion
-      (goto-char (point-min))
-      (when (overlays-at (point)) (forward-line))
-      (while (not (eobp))
-        (condition-case nil
-            (forward-line 1)
-          (user-error (goto-char (point-max))))
-        (unless (eobp)
-          (let ((pt (point)))
-            (condition-case nil
-                (forward-line 1)
-              (user-error (goto-char (point-max))))
-            ;; We set the overlay this way and give it a low priority so
-            ;; that `mct--highlight-overlay' and/or the active region
-            ;; can override it.
-            (let ((stripe (make-overlay pt (point))))
-              (overlay-put stripe 'priority -100)
-              (overlay-put stripe 'face 'mct-stripe))))))))
-
 ;;;; Commands and helper functions
 
 ;; TODO 2021-11-17: We must `autoload' instead of `declare-function' for
@@ -974,10 +927,7 @@ Apply APP while inhibiting modification hooks."
 (defun mct--setup-appearance ()
   "Set up variables for the appearance of the Completions buffer."
   (when mct-hide-completion-mode-line
-    (setq-local mode-line-format nil))
-  (if mct-apply-completion-stripes
-      (mct--add-stripes)
-    (mct--remove-stripes)))
+    (setq-local mode-line-format nil)))
 
 ;;;;; Shadowed path
 
@@ -1007,9 +957,7 @@ Apply APP while inhibiting modification hooks."
 
 (defvar mct--overlay-priority -50
   "Priority used on the `mct--highlight-overlay'.
-This value means that it takes precedence over lines that have
-the `mct-stripe' face, while it is overriden by the active
-region.")
+This value means that it is overriden by the active region.")
 
 ;; This is for Emacs 27 which does not have a completion--string text
 ;; property.



reply via email to

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