-
Notifications
You must be signed in to change notification settings - Fork 290
Description
Related: karthink/gptel#909
Description
While using evil-mode, I noticed that the region info displayed in the footer of the gptel-menu
transient (from karthink/gptel) is correct when the menu opens, but as soon as I press the first key inside that transient (e.g. n, p, TAB, arrow keys), the footer’s region display jumps to a different region. I initially reported this to the transient maintainer, who suggested it might be an evil-mode thing.
Steps to reproduce
- Start Emacs 30.1 with evil-mode enabled.
- In any buffer, select a region using
M-x evil-visual-line
. - Invoke the gptel-menu:
M-x gptel-menu
. - Observe the footer: it correctly shows the active region.
- Press any key inside the transient (e.g. n, p, , arrow keys).
- Notice the footer’s region display immediately updates or resets, showing a different region.
Expected behavior
The footer’s region information should remain exactly as it was when the transient opened, regardless of keypresses inside the transient.
Actual behavior
On the very first keypress inside the transient, evil-mode appears to alter the active region or its reported bounds. The footer then displays this new (incorrect) region.
Environment
- Emacs 30.1
- transient 0.9.2
- evil 1.15.0
- gptel latest master
Note
- I confirmed that transient itself is not deliberately modifying the region.
- Disabling evil-mode (or using emacs-state) prevents the footer from changing its region display.
- Additionally, using
evil-visual-end
andevil-visual-beginning
instead ofregion-beginning
andregion-end
when(evil-visual-state-p)
returns t seems to alleviate this problem, but the maintainer insisted that this could be a bug within either transient or evil-mode, which is why I'm reaching out.
Is this behavior expected from evil? Or could it be a bug in how evil handles regions when a transient keymap is activated? I'd greatly appreciate any guidance on fixing or working around this.