Switch input mode when point leaves the live input point#428
Merged
Conversation
emil-e
requested changes
Jun 20, 2026
| (dolist (entry anchored) | ||
| (let ((win (car entry)) | ||
| (buffer (cdr entry))) | ||
| ;; Guard lives here, not in `ghostel--anchor-window', |
Collaborator
There was a problem hiding this comment.
I wonder if it maybe is still better to have this guard in ghostel--anchor-window? Then it won't get triggered in the redraw path also, and we can remove that specific guard there. We could then maybe have a force parameter for the places where we explicitly want to anchor, such as input.
dakra
force-pushed
the
feat/auto-leave-on-point-move
branch
from
June 20, 2026 19:17
c1bb2cf to
77f97cd
Compare
The keyboard analog of the mouse/mark mode-switch: in semi-char mode, when point moves off the live terminal cursor, switch to a read-only mode so the navigated position is stable instead of the next redraw yanking point back to the prompt. - Add `ghostel-point-leave-input-mode' (copy default, emacs, or nil) and the public command `ghostel-maybe-leave-input'. - Wire it into `isearch-mode-end-hook' and (deferred) `minibuffer-exit-hook' (consult-line and other minibuffer jumps). Other jump packages with no hook (avy, flash) add it as a hook or `:after' advice. - Guard the minibuffer-exit re-anchor so it skips copy/Emacs buffers, keeping a jump target from being snapped back to the live cursor; semi-char/char/line still re-anchor as before. Tests in ghostel-modes-test.el; README and CHANGELOG updated.
dakra
force-pushed
the
feat/auto-leave-on-point-move
branch
from
June 20, 2026 19:33
77f97cd to
98ae769
Compare
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.
What
The keyboard analog of the existing mouse/mark mode-switch: in semi-char mode, when point moves off the live terminal cursor, ghostel switches to a read-only mode (
ghostel-point-leave-input-mode, defaultcopy) so the navigated position is stable instead of the next redraw yanking point back to the prompt.Details
ghostel-point-leave-input-mode(copy/emacs/nil), a sibling ofghostel-mouse-drag-input-modeandghostel-mark-activation-input-mode.ghostel-maybe-leave-input— a no-op unless point has left the live cursor in semi-char; ignores its args so it works as a hook function or:afteradvice.isearch-mode-end-hookand (deferred)minibuffer-exit-hook(coversconsult-lineand other minibuffer jumps). Packages with no hook of their own (avy, flash) addghostel-maybe-leave-inputthemselves — documented in the README.minibuffer-exitre-anchor now skips copy/Emacs buffers, so a minibuffer jump that switched modes isn't snapped back to the live cursor; semi-char/char/line still re-anchor as before. The guard lives on the auto-follow path rather than inghostel--anchor-window, which intentionally anchors Emacs mode for deliberate input like paste (covered byghostel-test-emacs-mode-yank-scrolls-to-live-cursor).Testing
ghostel-modes-test.el;make -j8 allgreen.copyandemacstargets for isearch, consult-line (deep + near-bottom), avy, and flash, plus the no-false-positive typing path.README and CHANGELOG updated.