[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/lentic 8cc0df3b4c 022/333: Some batch manipulation func
From: |
ELPA Syncer |
Subject: |
[elpa] externals/lentic 8cc0df3b4c 022/333: Some batch manipulation functions added. |
Date: |
Tue, 27 Feb 2024 12:59:56 -0500 (EST) |
branch: externals/lentic
commit 8cc0df3b4cd24bc6a34b1130cae31343911cc1d0
Author: Phillip Lord <phillord@haughton.ncl.ac.uk>
Commit: Phillip Lord <phillord@haughton.ncl.ac.uk>
Some batch manipulation functions added.
---
linked-buffer.el | 38 ++++++++++++++++++++++++++++++++++++--
1 file changed, 36 insertions(+), 2 deletions(-)
diff --git a/linked-buffer.el b/linked-buffer.el
index 2b49e11a4d..c3310e9fc2 100644
--- a/linked-buffer.el
+++ b/linked-buffer.el
@@ -326,6 +326,11 @@ A and B are the buffers."
linked-buffer-config)))
(funcall linked-buffer-init)))
+(defun linked-buffer-init-create ()
+ "Create the linked-buffer for current-buffer."
+ (linked-buffer-ensure-init)
+ (linked-buffer-create linked-buffer-config))
+
(defun linked-buffer-split-window-below ()
"Create a linked buffer in a new window below."
(interactive)
@@ -416,9 +421,38 @@ same top-left location. Update details depend on CONF."
;;
;; Test functions!
;;
-(defun linked-buffer-batch-clone (file)
+(defun linked-buffer-batch-clone (filename)
"Open FILE, clone and save."
- )
+ (with-current-buffer
+ (find-file-noselect filename)
+ (with-current-buffer
+ (linked-buffer-init-create)
+ (save-buffer)
+ (kill-buffer))
+ (kill-buffer)))
+
+(defun linked-buffer-batch-clone-with-config
+ (filename init)
+ "Open FILENAME, set INIT function, then clone and save.
+This function does potentially evil things if the file or the
+linked-buffer is open already.
+
+Return the linked-buffer contents without properties."
+ (let ((retn nil))
+ (with-current-buffer
+ (find-file-noselect filename)
+ (setq linked-buffer-init init)
+ (with-current-buffer
+ (linked-buffer-init-create)
+ (setq retn
+ (buffer-substring-no-properties
+ (point-min)
+ (point-max)))
+ (set-buffer-modified-p nil)
+ (kill-buffer))
+ (set-buffer-modified-p nil)
+ (kill-buffer))
+ retn))
(defun linked-buffer-test-after-change-function ()
"Run the change functions out of the command loop.
- [elpa] externals/lentic 4c277411c6 107/333: Edebug Spec for Macro., (continued)
- [elpa] externals/lentic 4c277411c6 107/333: Edebug Spec for Macro., ELPA Syncer, 2024/02/27
- [elpa] externals/lentic 9529b25c69 109/333: Moved with-markers functionality to m-buffer., ELPA Syncer, 2024/02/27
- [elpa] externals/lentic 3535011e66 112/333: Refactored to use with-current-location., ELPA Syncer, 2024/02/27
- [elpa] externals/lentic 2a4cdabdee 114/333: test-after-change-hooks now works on incremental., ELPA Syncer, 2024/02/27
- [elpa] externals/lentic 06510f56a5 013/333: 0.2 release, ELPA Syncer, 2024/02/27
- [elpa] externals/lentic 2cb03e9056 002/333: First release version., ELPA Syncer, 2024/02/27
- [elpa] externals/lentic c3822600d5 008/333: Beginning -> begin to reflect changes in m-buffer., ELPA Syncer, 2024/02/27
- [elpa] externals/lentic 27b21b2e8f 004/333: Block commenting now operates cleanly with unmatched delimiters., ELPA Syncer, 2024/02/27
- [elpa] externals/lentic 021995daf2 010/333: Condition-case form was malformed., ELPA Syncer, 2024/02/27
- [elpa] externals/lentic 0db978a409 017/333: Version number bump., ELPA Syncer, 2024/02/27
- [elpa] externals/lentic 8cc0df3b4c 022/333: Some batch manipulation functions added.,
ELPA Syncer <=
- [elpa] externals/lentic a69e98a8c5 025/333: No longer needed., ELPA Syncer, 2024/02/27
- [elpa] externals/lentic 2a1f8bb5f5 026/333: Merge branch 'master' of github.com:phillord/linked-buffer, ELPA Syncer, 2024/02/27
- [elpa] externals/lentic fe3efb4ef6 040/333: evm/cask install, ELPA Syncer, 2024/02/27
- [elpa] externals/lentic 3528da0a11 032/333: linked-buffer-asciidoc support., ELPA Syncer, 2024/02/27
- [elpa] externals/lentic 45d07d6416 034/333: Documentation cleanup., ELPA Syncer, 2024/02/27
- [elpa] externals/lentic 3405c13254 033/333: Change fundamental-mode to normal-mode, ELPA Syncer, 2024/02/27
- [elpa] externals/lentic de2450d3e4 043/333: Removed condition-case-no-debug, ELPA Syncer, 2024/02/27
- [elpa] externals/lentic 049330626e 044/333: Version number changes., ELPA Syncer, 2024/02/27
- [elpa] externals/lentic 661cb19252 028/333: Changes to test setup., ELPA Syncer, 2024/02/27
- [elpa] externals/lentic e7f4d91f88 047/333: Support file-locals in linked-buffer., ELPA Syncer, 2024/02/27