Next: , Previous: , Up: Completion, Confirmation and the Selection   [Contents][Index]


4.5.2 Completion and Confirmation

Many Magit commands ask the user to select from a list of possible things to act on, while offering the most likely choice as the default. For many of these commands the default is the thing at point, provided that it actually is a valid thing to act on. For many commands that act on a branch, the current branch serves as the default if there is no branch at point.

These commands combine asking for confirmation and asking for a target to act on into a single action. The user can confirm the default target using RET or abort using C-g. This is similar to a y-or-n-p prompt, but the keys to confirm or abort differ.

At the same time the user is also given the opportunity to select another target, which is useful because for some commands and/or in some situations you might want to select the action before selecting the target by moving to it.

However you might find that for some commands you always want to use the default target, if any, or even that you want the command to act on the default without requiring any confirmation at all. The option magit-dwim-selection can be used to configure certain commands to that effect.

Note that when the region is active then many commands act on the things that are selected using a mechanism based on the region, in many cases after asking for confirmation. This region-based mechanism is called the "selection" and is described in detail in the next section. When a selection exists that is valid for the invoked command, then that command never offers to act on something else, and whether it asks for confirmation is not controlled by this option.

Also note that Magit asks for confirmation of certain actions that are not coupled with completion (or the selection). Such dialogs are also not affected by this option and are described in the previous section.

User Option: magit-dwim-selection

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)...).


Next: The Selection, Previous: Action Confirmation, Up: Completion, Confirmation and the Selection   [Contents][Index]