Repository navigation
Let Lisp IMEs compose in read-only ghostel buffers - #510
Merged
Merged
Conversation
dakra
reviewed
Jul 6, 2026
| (eq original #'list)) | ||
| (list key) | ||
| (let ((events (let ((inhibit-read-only t)) | ||
| ;; Bind `buffer-read-only' to nil, not just `inhibit-read-only', around |
Owner
There was a problem hiding this comment.
I would probably make that code comment a one or two-liner.
For more details the future dev can always check the test or 'git blame'.
Contributor
Author
There was a problem hiding this comment.
Good call — trimmed it to two lines (1c70fc9). The full rationale now lives in the test docstring and git blame, as you suggested. Thanks for the quick look!
Since ghostel buffers became read-only, Korean (and other Lisp IMEs that gate on the variable directly) stopped composing. hangul2-input-method and the 3-Bulsik variants open with (if (or buffer-read-only ...) (list key) ...) and return the key untranslated whenever buffer-read-only is non-nil. The commit-forward wrapper bound inhibit-read-only around the input method, which lifts the modification barrier but leaves buffer-read-only set, so the IME never composed and the raw keystroke was forwarded instead of the committed syllable. Bind buffer-read-only to nil as well around the input-method call so the IME sees a writable buffer. The transient insertion is still deleted (buffer-read-only is restored once the call returns) and forwarded to the PTY exactly as before. Add a characterization test with a fake IME mirroring hangul's read-only gate; it fails without this change.
junghan0611
force-pushed
the
fix/lisp-ime-readonly-compose
branch
from
July 6, 2026 09:09
adf2f02 to
1c70fc9
Compare
Owner
|
Thanks. Merged. |
This branch was previously deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Context
Thank you for the continued work on ghostel — it has become the terminal
integration I reach for daily, running Emacs
-nwin a terminal with thebuilt-in Korean input method (
hangul2-input-method). This is a corner that iseasy to never encounter unless you type CJK through Emacs' Lisp IMEs, so I hope a
small report from that corner is useful.
This follows up on #343 (the IME-forward + redraw-guard work you kindly merged).
That infrastructure still works — this is a narrow interaction with a later
change.
The regression
9e8460a("Make ghostel buffers read-only") interacts with the IME-commit pathfrom #343. Several Lisp IMEs gate composition on
buffer-read-onlydirectly,not through
inhibit-read-only.hangul2-input-method(and the 3-Bulsikvariants) open with:
so they return the raw key untranslated whenever the buffer is read-only. The
commit-forward wrapper binds
inhibit-read-onlyaround the input method, whichlifts the modification barrier but leaves
buffer-read-onlyset — so the IMEnever composes in a protected ghostel buffer, and the un-composed keystroke is
forwarded to the PTY instead of the committed syllable. In practice, Korean input
stopped composing entirely in ghostel after buffers became read-only.
The fix
Bind
buffer-read-onlyto nil alongsideinhibit-read-onlyaround theinput-method call in
ghostel-ime--wrap-input-method, so the IME sees a writablebuffer. The transient insertion is still removed once the call returns
(
buffer-read-onlyis restored), and the committed text is forwarded to the PTYexactly as before — behavior is unchanged for every other path.
Scope is deliberately minimal: one functional line in
ghostel-ime.el, plus acharacterization test with a fake IME that mirrors hangul's read-only gate (it
fails without the change).
ghostel.elcore is untouched.Verification
Rebased cleanly onto current
main(v0.41.0 + 3 commits) — the touched fileswere byte-identical from v0.38 through v0.41, so this replays without conflict.
All green locally:
make test(elisp) — passmake test-native— passmake byte-compilewithbyte-compile-error-on-warn— no warningsmake checkdocon the changed file — cleanI keep this rebased against upstream continuously, so I'm happy to trim, reshape,
or fold it however fits your taste — no rush on your end. Thanks again for the
care you put into this project.