update packages
This commit is contained in:
@@ -69,21 +69,17 @@
|
||||
(defcustom magit-completing-read-function #'magit-builtin-completing-read
|
||||
"Function to be called when requesting input from the user.
|
||||
|
||||
If you have enabled `ivy-mode' or `helm-mode', then you don't
|
||||
have to customize this option; `magit-builtin-completing-read'
|
||||
will work just fine. However, if you use Ido completion, then
|
||||
you do have to use `magit-ido-completing-read', because Ido is
|
||||
less well behaved than the former, more modern alternatives.
|
||||
The default, `magit-builtin-completing-read', support third-party
|
||||
completion frameworks, including `vertico-mode', `ivy-mode' and
|
||||
`helm-mode'.
|
||||
|
||||
If you would like to use Ivy or Helm completion with Magit but
|
||||
not enable the respective modes globally, then customize this
|
||||
option to use `ivy-completing-read' or
|
||||
`helm--completing-read-default'. If you choose to use
|
||||
`ivy-completing-read', note that the items may always be shown in
|
||||
alphabetical order, depending on your version of Ivy."
|
||||
However, if you would like to use Ivy or Helm completion with Magit but
|
||||
not enable the respective modes globally, then customize this option to
|
||||
use `ivy-completing-read' or `helm--completing-read-default'.
|
||||
|
||||
If you still use `ido-mode', you'll likely need the `magit-ido' package."
|
||||
:group 'magit-essentials
|
||||
:type `(radio (function-item ,#'magit-builtin-completing-read)
|
||||
(function-item ,#'magit-ido-completing-read)
|
||||
(function-item ivy-completing-read)
|
||||
(function-item helm--completing-read-default)
|
||||
(function :tag "Other function")))
|
||||
@@ -486,7 +482,9 @@ and delay of your graphical environment or operating system."
|
||||
((keymap :initform 'magit-file-section-map)
|
||||
(source :initform nil :initarg :source)
|
||||
(header :initform nil :initarg :header)
|
||||
(binary :initform nil :initarg :binary)))
|
||||
(binary :initform nil :initarg :binary)
|
||||
(heading-highlight-face :initform 'magit-diff-file-heading-highlight)
|
||||
(heading-selection-face :initform 'magit-diff-file-heading-selection)))
|
||||
|
||||
(defclass magit-module-section (magit-file-section)
|
||||
((keymap :initform 'magit-module-section-map)
|
||||
@@ -494,12 +492,15 @@ and delay of your graphical environment or operating system."
|
||||
|
||||
(defclass magit-hunk-section (magit-diff-section)
|
||||
((keymap :initform 'magit-hunk-section-map)
|
||||
(painted :initform nil)
|
||||
(refined :initform nil)
|
||||
(combined :initform nil :initarg :combined)
|
||||
(from-range :initform nil :initarg :from-range)
|
||||
(from-ranges :initform nil)
|
||||
(to-range :initform nil :initarg :to-range)
|
||||
(about :initform nil :initarg :about)))
|
||||
(about :initform nil :initarg :about)
|
||||
(heading-highlight-face :initform 'magit-diff-hunk-heading-highlight)
|
||||
(heading-selection-face :initform 'magit-diff-hunk-heading-selection)))
|
||||
|
||||
(setf (alist-get 'file magit--section-type-alist) 'magit-file-section)
|
||||
(setf (alist-get 'module magit--section-type-alist) 'magit-module-section)
|
||||
@@ -604,21 +605,21 @@ acts similarly to `completing-read', except for the following:
|
||||
def)
|
||||
(unless def
|
||||
(setq def fallback))
|
||||
(when (and def
|
||||
(not (functionp collection))
|
||||
(not (member def collection)))
|
||||
(setq collection (cons def collection)))
|
||||
(let ((command this-command)
|
||||
(reply (funcall
|
||||
magit-completing-read-function
|
||||
(magit--format-prompt prompt def)
|
||||
(if (and (not (functionp collection))
|
||||
def
|
||||
(not (member def collection)))
|
||||
(cons def collection)
|
||||
collection)
|
||||
predicate
|
||||
require-match initial-input hist def)))
|
||||
(reply (funcall magit-completing-read-function
|
||||
(magit--format-prompt prompt def)
|
||||
collection predicate
|
||||
require-match initial-input hist def)))
|
||||
(setq this-command command)
|
||||
;; Note: Avoid `string=' to support `helm-comp-read-use-marked'.
|
||||
(if (equal reply "")
|
||||
(if require-match
|
||||
(if (and require-match
|
||||
(not (and (listp collection)
|
||||
(member "" collection))))
|
||||
(user-error "Nothing selected")
|
||||
nil)
|
||||
reply))))
|
||||
@@ -642,9 +643,13 @@ acts similarly to `completing-read', except for the following:
|
||||
(unless (or (bound-and-true-p helm-mode)
|
||||
(bound-and-true-p ivy-mode))
|
||||
(setq choices (magit--completion-table choices)))
|
||||
(let ((ivy-sort-functions-alist nil)
|
||||
(vertico-sort-function nil))
|
||||
(completing-read prompt choices
|
||||
(let ((ivy-sort-functions-alist nil))
|
||||
(completing-read prompt
|
||||
(lambda (str pred action)
|
||||
(if (eq action 'metadata)
|
||||
'(metadata (display-sort-function . identity)
|
||||
(cycle-sort-function . identity))
|
||||
(complete-with-action action choices str pred)))
|
||||
predicate require-match
|
||||
initial-input hist def)))
|
||||
|
||||
@@ -695,27 +700,6 @@ third-party completion frameworks."
|
||||
hist def inherit-input-method)))
|
||||
(if no-split input values)))
|
||||
|
||||
(defun magit-ido-completing-read
|
||||
(prompt choices &optional predicate require-match initial-input hist def)
|
||||
"Ido-based `completing-read' almost-replacement.
|
||||
|
||||
Unfortunately `ido-completing-read' is not suitable as a
|
||||
drop-in replacement for `completing-read', instead we use
|
||||
`ido-completing-read+' from the third-party package by the
|
||||
same name."
|
||||
(if (and (require 'ido-completing-read+ nil t)
|
||||
(fboundp 'ido-completing-read+))
|
||||
(ido-completing-read+ prompt choices predicate require-match
|
||||
initial-input hist
|
||||
(or def (and require-match (car choices))))
|
||||
(display-warning 'magit "ido-completing-read+ is not installed
|
||||
|
||||
To use Ido completion with Magit you need to install the
|
||||
third-party `ido-completing-read+' packages. Falling
|
||||
back to built-in `completing-read' for now." :error)
|
||||
(magit-builtin-completing-read prompt choices predicate require-match
|
||||
initial-input hist def)))
|
||||
|
||||
(defvar-keymap magit-minibuffer-local-ns-map
|
||||
:parent minibuffer-local-map
|
||||
"SPC" #'magit-whitespace-disallowed
|
||||
@@ -804,12 +788,12 @@ ACTION is a member of option `magit-slow-confirm'."
|
||||
(when (and prompt (listp prompt))
|
||||
(setq prompt
|
||||
(apply #'format (car prompt)
|
||||
(mapcar (lambda (a) (if (stringp a) (string-replace "%" "%%" a) a))
|
||||
(mapcar (##if (stringp %) (string-replace "%" "%%" %) %)
|
||||
(cdr prompt)))))
|
||||
(when (and prompt-n (listp prompt-n))
|
||||
(setq prompt-n
|
||||
(apply #'format (car prompt-n)
|
||||
(mapcar (lambda (a) (if (stringp a) (string-replace "%" "%%" a) a))
|
||||
(mapcar (##if (stringp %) (string-replace "%" "%%" %) %)
|
||||
(cdr prompt-n)))))
|
||||
(setq prompt-n (format (concat (or prompt-n prompt) "? ") (length items)))
|
||||
(setq prompt (format (concat (or prompt (magit-confirm-make-prompt action))
|
||||
@@ -874,7 +858,7 @@ See info node `(magit)Debugging Tools' for more information."
|
||||
`(,(concat invocation-directory invocation-name)
|
||||
"-Q" "--eval" "(setq debug-on-error t)"
|
||||
,@(mapcan
|
||||
(lambda (dir) (list "-L" dir))
|
||||
(##list "-L" %)
|
||||
(delete-dups
|
||||
(mapcan
|
||||
(lambda (lib)
|
||||
@@ -1043,7 +1027,7 @@ This function should be named `version>=' and be part of Emacs."
|
||||
;;; Kludges for Emacs Bugs
|
||||
|
||||
(defun magit-which-function ()
|
||||
"Return current function name based on point.
|
||||
"Return current function name based on point, without caching.
|
||||
|
||||
This is a simple wrapper around `which-function', that resets
|
||||
Imenu's potentially outdated and therefore unreliable cache by
|
||||
|
||||
Reference in New Issue
Block a user