-
Notifications
You must be signed in to change notification settings - Fork 272
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
help menu in magit is not displayed properly #637
Comments
I see 'x' for discard and 'O' for Reset. Can you provide an emacs-q recipe? |
I'm an emacs noob, did you mean run emacs with |
Yeah, I added a section here: https://github.com/emacs-evil/evil-collection#submitting-issues emacs -Q in terminal, then you can probably eval that snippet and test from there. |
I've reproduced the issue with the following steps:
emacs version: I installed emacs from emacsformacosx |
Can you paste the exact emacs -Q recipe you used? e.g. what you eval'ed |
|
This one is very strange for me. The initial emacs-q doesn't work but sometimes, subsequent ones seem to 'resolve' itself.. Not sure what's going on. Also, I messed up the snippet I gave you (but fixed it in my own while repro-ing). It should look like this instead. It should include setting the package dir too.
Will update the snippet soon. As for me, I'm suspecting maybe a new commit on magit and/or transient may be the issue, definitely not sure though. I'm a few commits behind on both. The other possibility is something with magit-section. Magit: 6d66ab34 master magit-refresh-get-relative-position: Fix regression I may update soon and try to see if I'm seeing the same issue. |
@cs50Mu When you emacs -Q a second time with the same recipe, what happens?
For me, after the first run, the next emacs -Q (but pointed at the same elpa directory) works as expected. |
@jojojames sorry, a bit awkward, can you tell me how to do this..?
I don't know how to load the previous elpa with |
Delete the emacs -Q directory (.emacs.1.d) |
After
|
I still have another emacs instance running when I'm doing the |
It shouldn't because your main emacs instance should be pointed at .emacs.d and your emacs -Q recipe should be pointed at .emacs.1.d. So you wiped .emacs.1.d, emacs -Q -> restarted and then -> emacs -Q again? |
I did the follows: first time first, make sure that
second time
|
@condy0919 Can you give it a shot? |
Same issue. Let me dig it deeper. |
Just an FYI. I wrote yodel with these kinds of tests in mind. Here's a demo with your current test case: Yodel Report (2022-06-08 15:05:14): (yodel
:save "yodel-magit"
:interactive nil
:packages* use-package
:post*
(setq straight-use-package-by-default t)
(use-package evil
:init
(setq evil-want-keybinding nil)
:config (evil-mode 1))
(use-package evil-collection
:after evil
:config
(evil-collection-init))
(use-package magit)
(let ((default-directory (straight--repos-dir "magit")))
(magit-status)
(magit-dispatch)
(with-current-buffer transient--buffer-name
(print (buffer-substring-no-properties (point-min) (point-max)))))) STDOUT:Loading /tmp/yodel-magit/straight-bootstrap-snippet.el (source)...
"Transient and dwim commands
A Apply i Ignore r Rebase
b Branch I Init t Tag
B Bisect j Jump to section T Note
c Commit J Display buffer V Revert
C Clone l Log w Apply patches
d Diff L Log (change) W Format patches
D Diff (change) m Merge X Reset
e Ediff (dwim) M Remote y Show Refs
E Ediff o Submodule Y Cherries
f Fetch O Subtree z Stash
F Pull P Push Z Worktree
h Help Q Command ! Run
H Section info
Applying changes
a Apply s Stage S Stage all
v Reverse u Unstage U Unstage all
k Discard
Essential commands
g refresh current buffer C-x m show all key bindings
q bury current buffer C-x i show Info manual
<tab> toggle section at point
<return> visit thing at point
" Environment
Packages
I left the |
What about the second run? |
That was the second run. |
Not really sure :D, maybe @tarsius can help. We're not (hopefully not) doing anything special with the popups other than swapping them here:
|
Try if doing this manually works: (transient-suffix-put 'magit-dispatch "O" :key "\"")
(transient-suffix-put 'magit-dispatch "X" :key "O")
(transient-suffix-put 'magit-dispatch "k" :key "x") The only potential problem that I see is I would add debug statements to see whether the relevant code is being called, and when. Start by adding |
It's here. https://github.com/emacs-evil/evil-collection/blob/master/evil-collection.el#L884 |
Hey, Just wanted to list a few more keybindings in the menu that are not evil compliant: Discard should be |
I'm having this same issue with a relatively vanilla installation of Doom Emacs, for what it's worth. |
I am seeing the same issue running Emacs 28.2 on Fedora. Specifically, I am seeing the help menu tell me that FWIW, I am running my own configs and have not changed a ton. here is a link: https://github.com/ZacheryPD/Emacs-From-Scratch/ |
I got the same issue with evil-collection, and my screenshot is the same as @cs50Mu has posted. What I observed is that these key-mappings are correct in some sense. For instance, when I pressed All the incorrectly mapped keys are the same: their mappings are different with or without the help window. |
I'm having this same issue. After I put magit to load after evil-collection, issue seems to go away.
|
Check whether If that doesn't work, I recommend inserting debug statements in strategic places. Does |
I tried to (defun evil-collection-magit-setup@override ()
"Set up `evil' bindings for `magit'."
(require 'magit)
(evil-collection-define-key 'normal 'magit-blame-mode-map
"q" 'magit-blame-quit)
(evil-collection-define-key 'normal 'magit-blame-read-only-mode-map
"q" 'magit-blame-quit)
(evil-collection-magit-init))
(advice-add 'evil-collection-magit-setup@override :override 'evil-collection-magit-setup) |
I can't believe I never thought of this. I did this in my config and it works flawlessly now. Thank you! |
The above snippet solves it. But it has the side effect that dired doesn't behave as expected. Eg: hitting enter on a file name doesn't open the file in normal mode (you need to go into insert mode to be able to do so). Removing magit from the :after restores the behavior of dired but the magit help menu is wrong. |
Can't reproduce here. |
I tracked down the issue to this minimal config:
The issue is seen with the above init.el but goes away when I remove the :bind for Magit. I can't figure out why! But my issue is resolved. It seems that bind is redundant anyway. |
@sooriravindra I would hazard a guess: The https://github.com/jwiegley/use-package#key-binding If you configure evil-collection to wait until magit and dired are loaded, it means that it won't be loaded until you open magit at least once (dired is loaded with emacs AFAIK). Until then, evil-collection will not have set up the dired keybinds. The workaround, if you want to still use the convenient use-package
https://github.com/jwiegley/use-package#notes-about-lazy-loading This will fix it. In any case, there is no need to bind |
@1player Thanks a bunch for demystifying it for me. |
Otherwise the evil-collection doesn't get enabled until I've opened magit once. This is required because of a bug with evil-collection. If it doesn't get started after magit, the help menu is broken. emacs-evil/evil-collection#637
See emacs-evil/evil-collection#637 for the explanation
It took some time to find out what causes this issue, but I think I found it:
|
I think you can workaround the issue by removing evil-collection/evil-collection.el Line 253 in 12fd87b
Disclaimer: I use evil-collection via Doom Emacs and Doom does things somewhat different with regard to evil-collection. For example, it initializes |
I confirm removing |
Installed. Thanks for the excellent work @swinkels 🚀 |
Press ? in
magit-status
gives the following in which some keybindings are wrong:for example, Discard should be
x
instead ofk
; Reset should beO
instead ofX
magit-version
gives:The text was updated successfully, but these errors were encountered: