Skip to content

Added support for read-only buffers#32

Open
yuravg wants to merge 8 commits into
jackkamm:masterfrom
yuravg:master
Open

Added support for read-only buffers#32
yuravg wants to merge 8 commits into
jackkamm:masterfrom
yuravg:master

Conversation

@yuravg

@yuravg yuravg commented Feb 10, 2026

Copy link
Copy Markdown

Hello,
Thanks for the convenient mode.
If you find these changes useful and consistent with the goals of this mode, please integrate them.

Extend undo-propose to work with read-only buffers (e.g., magit-diff)
that have undo disabled. This enables a useful secondary workflow:
creating a temporary reference copy of any buffer. For read-only source
buffers, no undo history is available to navigate, but the buffer copy
can still be useful as a reference.

Changes:
- Handle buffer-undo-list = t by using empty undo list
- Use inhibit-read-only when copying buffer content, as some modes
  (like magit-diff-mode) set the buffer read-only during init
For read-only source buffers, undo-propose-diff now compared snapshots,
e.g. two magit-diff commits.
Replace deprecated positional arguments with :lighter and :keymap
keywords to resolve Emacs warning about obsolete define-minor-mode
syntax.
* undo-propose.el:
- Fix ':type 'list' -> '(repeat symbol)' in undo-propose-marker-list
  (bare 'list' is invalid without element type arguments)
- Fix single-quoted symbols in docstrings to use backtick convention
- Add trailing period to defgroup doc-string, edit other descriptions
- Clarify undo-propose-done-hook runs on cancel too
- Guard undo-propose-diff against single-window frame (reference
snapshots)

* Makefile:
- Expand Makefile with lint target, byte-compile deps, and CI summary
Covers commit, squash-commit, cancel, nested calls, hooks, and read-only
source (reference snapshot) mode.
Without this fix `undo-propose-diff' for read-only buffers will be
incorrect.
- Add undo-propose-dispatch transient menu, add ? and h keybindings
- Refactor keybindings
- Refactor of command and function description
- Rename Readme.org -> README.org
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