Variable: magit-dwim-selection

magit-dwim-selection is a customizable variable defined in magit-base.el.

Value

((magit-stash-apply nil t) (magit-ediff-resolve-all nil t)
 (magit-ediff-resolve-rest nil t) (magit-stash-branch nil t)
 (magit-stash-branch-here nil t) (magit-stash-format-patch nil t)
 (magit-stash-drop nil ask) (magit-stash-pop nil ask))

Documentation

When not to offer alternatives and ask for confirmation.

Many commands by default ask the user to select from a list of possible candidates. They do so even when there is a thing at point that they can act on, which is then offered as the default.

This option can be used to tell certain commands to use the thing at point instead of asking the user to select a candidate to act on, with or without confirmation.

The value has the form ((COMMAND nil|PROMPT DEFAULT)...).

- COMMAND is the command that should not prompt for a choice.
  To have an effect, the command has to use the function
  magit-completing-read or a utility function which in turn uses
  that function.

- If the command uses magit-completing-read multiple times, then
  PROMPT can be used to only affect one of these uses. PROMPT, if
  non-nil, is a regular expression that is used to match against
  the PROMPT argument passed to magit-completing-read.

- DEFAULT specifies how to use the default. If it is t, then
  the DEFAULT argument passed to magit-completing-read is used
  without confirmation. If it is ask, then the user is given
  a chance to abort. DEFAULT can also be nil, in which case the
  entry has no effect.

This variable was added, or its default value changed, in magit version 2.12.0.

Source Code

;; Defined in ~/.emacs.d/elpa/magit-20260411.1452/magit-base.el
(defcustom magit-dwim-selection
  ;; Do not function-quote to avoid circular dependencies.
  '((magit-stash-apply        nil t)
    (magit-ediff-resolve-all  nil t)
    (magit-ediff-resolve-rest nil t)
    (magit-stash-branch       nil t)
    (magit-stash-branch-here  nil t)
    (magit-stash-format-patch nil t)
    (magit-stash-drop         nil ask)
    (magit-stash-pop          nil ask))
  "When not to offer alternatives and ask for confirmation.

Many commands by default ask the user to select from a list of
possible candidates.  They do so even when there is a thing at
point that they can act on, which is then offered as the default.

This option can be used to tell certain commands to use the thing
at point instead of asking the user to select a candidate to act
on, with or without confirmation.

The value has the form ((COMMAND nil|PROMPT DEFAULT)...).

- COMMAND is the command that should not prompt for a choice.
  To have an effect, the command has to use the function
  `magit-completing-read' or a utility function which in turn uses
  that function.

- If the command uses `magit-completing-read' multiple times, then
  PROMPT can be used to only affect one of these uses.  PROMPT, if
  non-nil, is a regular expression that is used to match against
  the PROMPT argument passed to `magit-completing-read'.

- DEFAULT specifies how to use the default.  If it is t, then
  the DEFAULT argument passed to `magit-completing-read' is used
  without confirmation.  If it is `ask', then the user is given
  a chance to abort.  DEFAULT can also be nil, in which case the
  entry has no effect."
  :package-version '(magit . "2.12.0")
  :group 'magit-commands
  :type '(repeat
          (list (symbol :tag "Command") ; It might not be fboundp yet.
                (choice (const  :tag "For all prompts" nil)
                        (regexp :tag "For prompts matching regexp"))
                (choice (const  :tag "Offer other choices" nil)
                        (const  :tag "Require confirmation" ask)
                        (const  :tag "Use default without confirmation" t)))))