embark icon indicating copy to clipboard operation
embark copied to clipboard

Keystrokes 'hanging around' in echo area after embark-act

Open codesuki opened this issue 3 years ago • 14 comments

Hi! First off, awesome package!

When I run C-x C-f (find-file), select a file, run embark-act, and press RET (find-file), the echo-area shows RET- waiting for a key-chord. If I then for example press s it shows RET-s, disappears, and inserts s into the buffer.

It doesn't really have a negative impact, but I was thinking maybe it hints at some problem (Why is it waiting for a command?). I was looking at the code of embark--act and it does manipulate this-command-keys which could be connected (I don't know enough about how it works).

codesuki avatar Mar 11 '22 09:03 codesuki

I haven't been able to reproduce this yet. What completion UI do you use?

oantolin avatar Mar 11 '22 15:03 oantolin

Ah, got it, if you using a quitting action and have a very small value of echo-keystrokes (below 0.2 in my tests, but this probably depends on your computer, completion UI and Emacs version) then this happens. Curious.

oantolin avatar Mar 11 '22 16:03 oantolin

Thanks for investigating! And sorry for giving too little context. I am using Vertico. Emacs is version 29.0.50, would have to check the actual commit :)

It's fine because it actually doesn't do anything. It doesn't even say RET-s is undefined which it normally should say. I could probably increase echo-keystrokes, it's 0.25 right now.

But, I agree it's curious. I don't know about the implementation that drives keystroke echoing, but I imagine it should react properly on the quit signal / command finishing. Somehow Emacs seems to lose track.

codesuki avatar Mar 12 '22 01:03 codesuki

I just want to confirm that as you suspected this is caused by using set--this-command-keys in embark--act. That was done to fix #182. It would be nice to figure out a different fix for #182 that didn't have this lingering keys issue.

oantolin avatar Mar 14 '22 23:03 oantolin

Oh, that's kinda good news :) I tried to reproduce the issue in #182, but my browse-url doesn't work even without embark. 😅 I walked through it with the debugger and it "worked" (picked up the URL I was on when I called embark), but no browser window opened, which seems to be a problem with my setup.

codesuki avatar Mar 15 '22 05:03 codesuki

Hi @oantolin,

Do you have a plan to fix this issue ?

montag451 avatar Jan 14 '23 12:01 montag451

I don't know how to fix it and am open to suggestions.

oantolin avatar Jan 14 '23 13:01 oantolin

I can have a look but to be honest if you didn't find a solution to fix this issue I don't think I will be able to find one :). Anyway it's not a big issue so it's not a big deal if it's not fixed

montag451 avatar Jan 14 '23 13:01 montag451