Skip to content

Let a prefix argument keep copy and Emacs mode from fast-exiting - #771

Merged
dakra merged 1 commit into
mainfrom
feat/readonly-sticky-prefix
Oct 28, 2026
Merged

dakra merged 1 commit into
mainfrom
feat/readonly-sticky-prefix

Conversation

@dakra

@dakra dakra commented Oct 28, 2026

Copy link
Copy Markdown
Owner

ghostel-copy-mode, ghostel-emacs-mode and ghostel-readonly-enter take a prefix argument. Entering with one turns ghostel-readonly-fast-exit off for that visit, so stray letters hit the read-only barrier instead of landing at the prompt. A prefix while already in the mode toggles fast exit instead of exiting.

The effective value is a buffer-local, ghostel--readonly-fast-exit, set in ghostel--enter-readonly. Every former runtime reader of the option (ghostel--on-user-input, keymap choice, ghostel-readonly-copy, mode-line help-echo, entry message) reads the local, so C-y, M-w and middle-click respect the override too. The Emacs-mode entry message now names the exit key the same way copy mode does.

All defcustom setters iterate ghostel-buffer-list.

Verified live under elate with zsh: C-u C-c C-t enters copy mode with the plain map, a gives "Buffer is read-only", C-u C-c C-t flips to fast exit while staying in copy mode, C-c C-e keeps it, q exits; C-u C-c C-e plus C-y stays in Emacs mode.

ghostel-copy-mode, ghostel-emacs-mode and ghostel-readonly-enter take a
prefix argument.  Entering with one turns ghostel-readonly-fast-exit off
for that visit; a prefix inside the mode toggles it instead of exiting.

The effective value lives in the buffer-local ghostel--readonly-fast-exit,
set on entry, which every runtime reader consults instead of the user
option.  The Emacs-mode entry message reflects it like the copy-mode one.

All defcustom setters iterate ghostel-buffer-list.
@dakra
dakra merged commit 4f95847 into main Oct 28, 2026
33 checks passed
@dakra
dakra deleted the feat/readonly-sticky-prefix branch October 28, 2026 21:04

This branch was previously deployed

1 inactive deployment
github-pages — 4f95847e Deployed Oct 28, 2026 by dakra via deploy #236
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.

1 participant