[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/edit-indirect de645d8144 21/28: Add edit-indirect-save fun
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/edit-indirect de645d8144 21/28: Add edit-indirect-save function and keybinding |
Date: |
Thu, 7 Jul 2022 11:59:14 -0400 (EDT) |
branch: elpa/edit-indirect
commit de645d8144e8a08f039a9c88185121ec81d957ef
Author: Daniel Kraus <daniel@kraus.my>
Commit: Fanael Linithien <fanael4@gmail.com>
Add edit-indirect-save function and keybinding
Act the same way as `org-edit-src-save` which is also
bound to `C-x C-s`.
When editing an indirect buffer you most likely don't want
to save that buffer to a new file on disk but rather update
the region only.
---
edit-indirect.el | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/edit-indirect.el b/edit-indirect.el
index e749b6c7b4..fa2d6efa0e 100644
--- a/edit-indirect.el
+++ b/edit-indirect.el
@@ -161,6 +161,7 @@ In any case, return the edit-indirect buffer."
(defvar edit-indirect-mode-map
(let ((map (make-sparse-keymap)))
+ (define-key map (kbd "C-x C-s") #'edit-indirect-save)
(define-key map (kbd "C-c '") #'edit-indirect-commit)
(define-key map (kbd "C-c C-c") #'edit-indirect-commit)
(define-key map (kbd "C-c C-k") #'edit-indirect-abort)
@@ -182,6 +183,17 @@ buffer."
(edit-indirect--commit)
(edit-indirect--clean-up))
+(defun edit-indirect-save ()
+ "Save the modifications done in an edit-indirect buffer.
+That is, replace the original region in the parent buffer with the
+contents of the edit-indirect buffer.
+
+Can be called only when the current buffer is an edit-indirect
+buffer."
+ (interactive)
+ (edit-indirect--barf-if-not-indirect)
+ (edit-indirect--commit))
+
(defun edit-indirect-abort ()
"Abort indirect editing in the current buffer and kill the buffer.
- [nongnu] branch elpa/edit-indirect created (now f80f63822f), ELPA Syncer, 2022/07/07
- [nongnu] elpa/edit-indirect 1d0cabfbe7 02/28: Clarify how this package differs from clone-indirect-buffer., ELPA Syncer, 2022/07/07
- [nongnu] elpa/edit-indirect 56e3231915 01/28: Initial import., ELPA Syncer, 2022/07/07
- [nongnu] elpa/edit-indirect ac56a2ff8d 03/28: Add C-c C-c binding for edit-indirect-commit., ELPA Syncer, 2022/07/07
- [nongnu] elpa/edit-indirect e01e7eeb79 04/28: Extract a nested let into a function., ELPA Syncer, 2022/07/07
- [nongnu] elpa/edit-indirect 273910a944 11/28: Ensure commit hooks are always called with the correct region., ELPA Syncer, 2022/07/07
- [nongnu] elpa/edit-indirect 215d3a714a 16/28: Release version 0.1.3, ELPA Syncer, 2022/07/07
- [nongnu] elpa/edit-indirect de645d8144 21/28: Add edit-indirect-save function and keybinding,
ELPA Syncer <=
- [nongnu] elpa/edit-indirect 2fc8f382ee 19/28: Add before-commit-hook, ELPA Syncer, 2022/07/07
- [nongnu] elpa/edit-indirect bdc8f542fe 23/28: Don't run buffer-local after-creation-hook twice, ELPA Syncer, 2022/07/07
- [nongnu] elpa/edit-indirect f80f63822f 28/28: Make edit-indirect--should-quit-window persistent, ELPA Syncer, 2022/07/07
- [nongnu] elpa/edit-indirect 03b6ac9ed1 25/28: Use a remap binding for save-buffer instead of hardcoded C-x C-s, ELPA Syncer, 2022/07/07
- [nongnu] elpa/edit-indirect 7fffd87ac3 24/28: Don't modify buffer if nothing changed, ELPA Syncer, 2022/07/07
- [nongnu] elpa/edit-indirect 16bcdbdae6 27/28: Add an overlay keymap for easy switching to active edit-indirect buffers, ELPA Syncer, 2022/07/07
- [nongnu] elpa/edit-indirect b461e559e1 05/28: Don't retrieve the buffer-local hook values before actual uses., ELPA Syncer, 2022/07/07
- [nongnu] elpa/edit-indirect 7d9bcfced3 06/28: Extract buffer-local value handling into a macro., ELPA Syncer, 2022/07/07
- [nongnu] elpa/edit-indirect 6fa78ff6f1 07/28: Prohibit modification at the beginning of the overlay., ELPA Syncer, 2022/07/07
- [nongnu] elpa/edit-indirect f43936b3a4 12/28: Use `quit-window' instead of `kill-buffer-and-window`., ELPA Syncer, 2022/07/07