reddit / emacs

error: one of my transients misplaces cursor activity

WorldsEndless · 2022-07-20 23:52
One of my transients has recently changed behavior, and is very bothersome. Normally I would use it to choose a file from the project and then, with the transient menu staying open after visiting the file, I can press the another transient key and do that thing. But no more. Now, after visiting a file, it looks the same as before -- meaning, the transient stays open at the bottom of the screen -- but my cursor has now moved to the file itself and attempting to press one of the transient keys just inserts that character into the buffer, as if transient wasn't there. I then usually have to get rid of the inaccessible transient menu by calling another transient and cancelling it immediately, after which my screen has returned to full no-transient normal. Why would this one command be now causing my transient to lose focus without visibly exiting? The find-file or switch-to-buffer ones work just fine without any unexpected context changes: that is, the transient stays focused with them until I directly cancel it. Code: (defun tsa/projectile (&optional choose-project) "Navigate the project files, possibly choosing project first" (interactive "P") (if choose-project (projectile-switch-project) (projectile-find-file))) ;; this is bound to <f2> (transient-define-prefix tsa/transient-window () "Window navigation transient" :transient-non-suffix 'transient--do-quit-one :transient-suffix 'transient--do-stay [["Switch" ("b" "buffer" switch-to-buffer) ("f" "find-file" find-file) ("g" "git-grep" consult-git-grep) ("p" "projectile" tsa/projectile) ;; THIS one is the issue ("F" "follow" follow-mode) ("a" "ace 1" transient-ace-cmd)] ])
7890yuiop · 2022-07-21 01:20
Obvious question: What changed between it working and it not working? Have you tried rolling your config back to a working state?
WorldsEndless · 2022-07-21 01:30
The only thing that changed is that I changed my system to GUIX, which updated all my packages. Roll-back wouldn't effect that because the code hasn't been changed since I wrote it about a year ago
7890yuiop · 2022-07-21 05:12
That's a pretty big "only". Was Emacs one of the updated OS packages?
WorldsEndless · 2022-07-21 14:16
Indeed. I'm not sure about emacs; probably. I am hoping that others have worked through similar issues and might have insights into what is causing stealing of focus.
tarsius_ · 2022-07-21 16:33
There have been several important bug fixes in Transient since 0.3.7. Guix is still on that version. You can just install the latest snapshot from Melpa to work around that; it will shadow the version installed by Guix. I am currently on a prolonged break, but when I get back I will create new releases. (Also I just switched to Guix.)
WorldsEndless · 2022-07-27 18:20
I have found that changing functions, or even using a completely different function in this transient, has the same problem. For instance, it's the same thing with a transient key for `find-file`: upon finding one, the transient menu is still visible but is not actually active or usable. This indicates that it might me my suffix settings at the top: :transient-non-suffix 'transient--do-quit-one :transient-suffix 'transient--do-stay I am trying (with difficulty) to comb the documentation to see what might have changed there.
WorldsEndless · 2022-07-27 19:48
I have verified that any command which changes to a new buffer -- `find-file`, `switch-to-buffer`, `projectile-find-file` ends up causing the new buffer to take the cursor, but leaves the appearance of the transient still being present. This means that I cannot, for instance, change to one buffer than hit a key mentioned in the transient to change to another immediately. Curiously, the transient bindings to wind-move-[left down up right] all work as I wish: I can execute any number of the transient commands in a row without closing the transient.