Skip to content
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

Remove exwm-input--during-command logic #94

Merged
merged 1 commit into from
Dec 16, 2024

Conversation

Stebalien
Copy link
Contributor

`exwm-input--duration-command' isn't reliably unset when exiting commands initiated by emacsclient causing Emacs to swallow one key press. See ch11ng/exwm#253 and #93.

However, exwm-input--duration-command' appears to be no longer necessary now that bind exwm-input-line-mode-passthrough' around all input commands (via advice).

fixes #93

  • exwm-core.el (exwm--kmacro-map): remove obsolete comment.
  • exwm-input.el (exwm-input--during-command): Remove variable. (exwm-input--event-passthrough-p): Remove reference to variable. (exwm-input-pre-post-command-blacklist): Remove newly unused option. (exwm-input--on-pre-command, exwm-input--on-post-command): Remove hooks. (exwm-input--init, exwm-input--exit): Remove references to the above hooks.
  • exwm-workspace.el (exwm-input--during-command): Remove reference to removed variable.
    (exwm-workspace--on-echo-area-dirty): Use real-this-command to detect in-progress commands.

`exwm-input--duration-command' isn't reliably unset when exiting
commands initiated by emacsclient causing Emacs to swallow one key
press. See ch11ng/exwm#253 and #93.

However, `exwm-input--duration-command' appears to be no longer
necessary now that bind `exwm-input-line-mode-passthrough' around all
input commands (via advice).

fixes #93

* exwm-core.el (exwm--kmacro-map): remove obsolete comment.
* exwm-input.el (exwm-input--during-command): Remove variable.
(exwm-input--event-passthrough-p): Remove reference to variable.
(exwm-input-pre-post-command-blacklist): Remove newly unused option.
(exwm-input--on-pre-command, exwm-input--on-post-command): Remove hooks.
(exwm-input--init, exwm-input--exit): Remove references to the above
hooks.
* exwm-workspace.el (exwm-input--during-command): Remove reference to
removed variable.
(exwm-workspace--on-echo-area-dirty): Use real-this-command to detect
in-progress commands.
@Stebalien Stebalien requested a review from minad December 9, 2024 04:55
@@ -1284,7 +1283,7 @@ ALIST is an action alist, as accepted by function `display-buffer'."
(exwm-workspace--update-minibuffer-height t)
(exwm-workspace--show-minibuffer)
(unless (or (not exwm-workspace-display-echo-area-timeout)
exwm-input--during-command ;e.g. read-event
real-this-command ;e.g. read-event
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not 100% sure this is the best way to do this, but I think this is correct. Basically, this should be nil unless a command is running.

Of course, this will also run into the bug we're fixing here where it'll remain non-nil till the first command is run after a command invoked by emacsclient exits. But that's probably fine? We're trading one bug for another, but this should be less of an issue.

@Stebalien
Copy link
Contributor Author

This should be tested thoroughly as I may be missing cases where the prior logic was necessary. I've tested:

  1. line-mode and char-mode. Char-mode is funky around read-event, but that appears to be the case before this change as well.
  2. read-key, read-event, completing-read, read-string, etc.

@minad
Copy link
Member

minad commented Dec 9, 2024

This looks like a welcome change! My suggestion is to test this for a few days to see if issues occur during regular usage and then merge it. We could still rollback or adjust if users stumble over other more problematic issues.

I've installed the patch on my machine. I'll see if it fixes #93-related issues for me, which I've also seen occasionally.

@lrustand
Copy link

I've been running this daily on my computers for a few days now, and have not experienced any issues.

@Stebalien
Copy link
Contributor Author

It's been a week and I haven't noticed any new issues, so I'm going to merge this.

@Stebalien Stebalien merged commit 9f310dd into master Dec 16, 2024
@Stebalien Stebalien deleted the steb/remove-during-command branch December 16, 2024 01:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Focusing minibuffer from X11 window causes "Buffer is read only" error
3 participants