Can't override magit-clone settings in vertico-multiform #664
Replies: 3 comments 3 replies
-
|
Potential PR fix for reference: #663 |
Beta Was this translation helpful? Give feedback.
-
|
Thanks for the explanation. I see your point - it would make sense to prefer current-minibuffer-command over this-command, such that the command is stable even for multiple prompts. However for some reason the variable is unreliable - occasionally the variable is nil in the minibuffer-setup-hook, in contrast to this-command and I don't understand why. I could use (or current-minibuffer-command this-command) as a workaround, but I'd like first to understand why this happens. |
Beta Was this translation helpful? Give feedback.
-
|
It is not clear to me what is wrong, but it looks like an Emacs bug related to the interactive specification: (defun test-command-bad1 (arg)
(interactive "P")
(message "current-minibuffer-command=%S this-command=%S " current-minibuffer-command this-command))
(defun test-command-bad2 (&optional arg)
(interactive "P")
(message "current-minibuffer-command=%S this-command=%S " current-minibuffer-command this-command))
(defun test-command-okay1 (&optional arg)
(interactive)
(message "current-minibuffer-command=%S this-command=%S " current-minibuffer-command this-command))
(defun test-command-okay2 (arg)
(interactive
(list
(message "current-minibuffer-command=%S this-command=%S " current-minibuffer-command this-command))))
(keymap-global-set "C-c t 1" #'test-command-bad1)
(keymap-global-set "C-c t 2" #'test-command-bad2)
(keymap-global-set "C-c t 3" #'test-command-okay1)
(keymap-global-set "C-c t 4" #'test-command-okay2)The bad commands report |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I'd like to be able to set:
so that I can normally use vertico-preselect=directory, but also have vertico-preselect=prompt for magit-clone (no preselection of a newly cloned repo, despite it being a directory).
Unfortunately, magit-clone does not seem to propagate this-comand in the way vertico-multiform would like.
this-commandis changed to exit-minibuffer on the firstmagit-clone-read-repositorycall, and not set back for read-directory-name. Reproduction:gives
note second this-command = exit-minibuffer
This is important because it's the second minibuffer call (read-directory-name) that I want to change the behavior for. For reference:
Beta Was this translation helpful? Give feedback.
All reactions