Added support for read-only buffers#32
Open
yuravg wants to merge 8 commits into
Open
Conversation
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
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.
Hello,
Thanks for the convenient mode.
If you find these changes useful and consistent with the goals of this mode, please integrate them.