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

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

[nongnu] elpa/git-commit a162b8a71e 4/5: Complete switch to new magit-co


From: ELPA Syncer
Subject: [nongnu] elpa/git-commit a162b8a71e 4/5: Complete switch to new magit-completing-read-multiple
Date: Tue, 14 Mar 2023 14:02:26 -0400 (EDT)

branch: elpa/git-commit
commit a162b8a71ed7e4a168651c36cedbc598cdf405b3
Author: Jonas Bernoulli <jonas@bernoul.li>
Commit: Jonas Bernoulli <jonas@bernoul.li>

    Complete switch to new magit-completing-read-multiple
    
    In [1: c10e10c9a4] we added `magit-completing-read-multiple*' as a
    replacement for `magit-completing-read-multiple'.  The goal was to
    eventually remove the latter and reuse its name for the former.
    
    Do that now.  Well, one kludge remains: for now the function, whose
    name ends with "*", is preserved as an alias for the function, whose
    name does not.
    
    1: 2021-06-29 c10e10c9a427c192dec841e524a6d3d47d2b21ee
       Update our completing-read-multiple replacement/wrapper
---
 lisp/magit-base.el            | 41 +++--------------------------------------
 lisp/magit-bundle.el          |  6 +++---
 lisp/magit-diff.el            | 10 +++++-----
 lisp/magit-git.el             |  2 +-
 lisp/magit-log.el             |  2 +-
 lisp/magit-push.el            |  2 +-
 lisp/magit-sparse-checkout.el |  4 ++--
 7 files changed, 16 insertions(+), 51 deletions(-)

diff --git a/lisp/magit-base.el b/lisp/magit-base.el
index de88b44a6c..5747b2c80d 100644
--- a/lisp/magit-base.el
+++ b/lisp/magit-base.el
@@ -586,45 +586,10 @@ acts similarly to `completing-read', except for the 
following:
                        predicate require-match
                        initial-input hist def))))
 
+(define-obsolete-function-alias 'magit-completing-read-multiple*
+  'magit-completing-read-multiple "Magit-Section 4.0.0")
+
 (defun magit-completing-read-multiple
-    (prompt choices &optional sep default hist keymap)
-  "Read multiple items from CHOICES, separated by SEP.
-
-Set up the `crm' variables needed to read multiple values with
-`read-from-minibuffer'.
-
-SEP is a regexp matching characters that can separate choices.
-When SEP is nil, it defaults to `crm-separator'.  DEFAULT, HIST,
-and KEYMAP are passed to `read-from-minibuffer'.  When KEYMAP is
-nil, it defaults to `crm-local-completion-map'.
-
-Unlike `completing-read-multiple', the return value is not split
-into a list."
-  (declare (obsolete magit-completing-read-multiple* "Magit 3.1.0"))
-  (let* ((crm-separator (or sep crm-separator))
-         (crm-completion-table (magit--completion-table choices))
-         (choose-completion-string-functions
-          '(crm--choose-completion-string))
-         (minibuffer-completion-table #'crm--collection-fn)
-         (minibuffer-completion-confirm t)
-         (helm-completion-in-region-default-sort-fn nil)
-         (helm-crm-default-separator nil)
-         (ivy-sort-matches-functions-alist nil)
-         (input
-          (cl-letf (((symbol-function #'completion-pcm--all-completions)))
-            (when (< emacs-major-version 26)
-              (fset 'completion-pcm--all-completions
-                    'magit-completion-pcm--all-completions))
-            (read-from-minibuffer
-             (concat prompt (and default (format " (%s)" default)) ": ")
-             nil (or keymap crm-local-completion-map)
-             nil hist default))))
-    (when (string-equal input "")
-      (or (setq input default)
-          (user-error "Nothing selected")))
-    input))
-
-(defun magit-completing-read-multiple*
     (prompt table &optional predicate require-match initial-input
             hist def inherit-input-method
             no-split)
diff --git a/lisp/magit-bundle.el b/lisp/magit-bundle.el
index 75033da50a..a192d2363d 100644
--- a/lisp/magit-bundle.el
+++ b/lisp/magit-bundle.el
@@ -59,8 +59,8 @@
                               (concat (file-name-nondirectory
                                        (directory-file-name (magit-toplevel)))
                                       ".bundle"))
-              (magit-completing-read-multiple* "Refnames (zero or more): "
-                                               (magit-list-refnames))
+              (magit-completing-read-multiple "Refnames (zero or more): "
+                                              (magit-list-refnames))
               (transient-args 'magit-bundle-create))))
   (if file
       (magit-git-bundle "create" file refs args)
@@ -72,7 +72,7 @@
   (interactive
    (let ((tag    (magit-read-tag "Track bundle using tag"))
          (branch (magit-read-branch "Bundle branch"))
-         (refs   (magit-completing-read-multiple*
+         (refs   (magit-completing-read-multiple
                   "Additional refnames (zero or more): "
                   (magit-list-refnames))))
      (list (read-file-name "File: " nil nil nil (concat tag ".bundle"))
diff --git a/lisp/magit-diff.el b/lisp/magit-diff.el
index 03a7bf3313..dc4c17ec73 100644
--- a/lisp/magit-diff.el
+++ b/lisp/magit-diff.el
@@ -980,11 +980,11 @@ and `:slant'."
   :multi-value t)
 
 (defun magit-read-files (prompt initial-input history &optional list-fn)
-  (magit-completing-read-multiple* prompt
-                                   (funcall (or list-fn #'magit-list-files))
-                                   nil nil
-                                   (or initial-input (magit-file-at-point))
-                                   history))
+  (magit-completing-read-multiple prompt
+                                  (funcall (or list-fn #'magit-list-files))
+                                  nil nil
+                                  (or initial-input (magit-file-at-point))
+                                  history))
 
 (transient-define-argument magit-diff:-U ()
   :description "Context lines"
diff --git a/lisp/magit-git.el b/lisp/magit-git.el
index 866f3e8860..cc02242a80 100644
--- a/lisp/magit-git.el
+++ b/lisp/magit-git.el
@@ -2541,7 +2541,7 @@ and this option only controls what face is used.")
 (defun magit-read-range (prompt &optional default)
   (let ((minibuffer-default-add-function (magit--minibuf-default-add-commit))
         (crm-separator "\\.\\.\\.?"))
-    (magit-completing-read-multiple*
+    (magit-completing-read-multiple
      (concat prompt ": ")
      (magit-list-refnames)
      nil nil nil 'magit-revision-history default nil t)))
diff --git a/lisp/magit-log.el b/lisp/magit-log.el
index fe4fa19c92..eea3947d4d 100644
--- a/lisp/magit-log.el
+++ b/lisp/magit-log.el
@@ -618,7 +618,7 @@ commits before and half after."
   (or (and use-current (and-let* ((buf (magit-get-current-branch))) (list 
buf)))
       (let ((crm-separator "\\(\\.\\.\\.?\\|[, ]\\)")
             (crm-local-completion-map magit-log-read-revs-map))
-        (split-string (magit-completing-read-multiple*
+        (split-string (magit-completing-read-multiple
                        "Log rev,s: "
                        (magit-list-refnames nil t)
                        nil nil nil 'magit-revision-history
diff --git a/lisp/magit-push.el b/lisp/magit-push.el
index a3804acfb7..dd3dd8ecb1 100644
--- a/lisp/magit-push.el
+++ b/lisp/magit-push.el
@@ -218,7 +218,7 @@ only available for the part before the colon, or when no 
colon
 is used."
   (interactive
    (list (magit-read-remote "Push to remote")
-         (magit-completing-read-multiple*
+         (magit-completing-read-multiple
           "Push refspec,s: "
           (cons "HEAD" (magit-list-local-branch-names))
           nil nil nil 'magit-push-refspecs-history)
diff --git a/lisp/magit-sparse-checkout.el b/lisp/magit-sparse-checkout.el
index c0fb19724a..5e2f88080e 100644
--- a/lisp/magit-sparse-checkout.el
+++ b/lisp/magit-sparse-checkout.el
@@ -98,7 +98,7 @@ See the `git sparse-checkout' manpage for details about
 To extend rather than override the currently configured
 directories, call `magit-sparse-checkout-add' instead."
   (interactive
-   (list (magit-completing-read-multiple*
+   (list (magit-completing-read-multiple
           "Include these directories: "
           ;; Note: Given that the appeal of sparse checkouts is
           ;; dealing with very large trees, listing all subdirectories
@@ -114,7 +114,7 @@ directories, call `magit-sparse-checkout-add' instead."
 To override rather than extend the currently configured
 directories, call `magit-sparse-checkout-set' instead."
   (interactive
-   (list (magit-completing-read-multiple*
+   (list (magit-completing-read-multiple
           "Add these directories: "
           ;; Same performance note as in `magit-sparse-checkout-set',
           ;; but even more so given the additional processing.



reply via email to

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