emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/lentic f0253ea3e7 290/333: New menu option "force clone


From: ELPA Syncer
Subject: [elpa] externals/lentic f0253ea3e7 290/333: New menu option "force clone".
Date: Tue, 27 Feb 2024 13:00:45 -0500 (EST)

branch: externals/lentic
commit f0253ea3e77990fcdbf57ed9d6336ffb214a35cc
Author: Phillip Lord <phillip.lord@russet.org.uk>
Commit: Phillip Lord <phillip.lord@russet.org.uk>

    New menu option "force clone".
    
    Previously in some circumstances, usually in chunked buffers with broken
    start/end delineators, it is possible for comment markers to be removed
    from the programmatic buffer. This adds a user command to force the
    cloning of the correct buffer which should restore the situation.
---
 lentic-mode.el | 13 +++++++++++++
 lentic.el      |  4 ----
 2 files changed, 13 insertions(+), 4 deletions(-)

diff --git a/lentic-mode.el b/lentic-mode.el
index 970d438b68..4b5192f9a9 100644
--- a/lentic-mode.el
+++ b/lentic-mode.el
@@ -231,6 +231,17 @@ See also `lentic-mode-move-lentic-window'."
    (selected-window)
    (lentic-mode-create-new-view)))
 
+(defun lentic-mode-force-clone-1 ()
+  (lentic-when-lentic
+   (let ((inhibit-modification-hooks t))
+     (lentic-after-change-function
+      (point-min) (point-max)
+      (- (point-max) (point-min))))))
+
+(defun lentic-mode-force-clone ()
+  (interactive)
+  (when (yes-or-no-p "Force Clone of the current buffer? ")
+    (lentic-mode-force-clone-1)))
 ;; #+end_src
 
 ;; ** Minor Mode
@@ -342,6 +353,8 @@ See also `lentic-mode-move-lentic-window'."
     :active lentic-config]
    ["Swap" lentic-mode-swap-lentic-window
     :active lentic-config]
+   ["Force Clone" lentic-mode-force-clone
+    :active lentic-config]
    ["Insert File Local" lentic-mode-insert-file-local]
    ["Read Doc (eww)" lentic-mode-doc-eww-view]
    ["Read Doc (external)" lentic-mode-doc-external-view]
diff --git a/lentic.el b/lentic.el
index 8f48f07f6b..f3a1f2e4b3 100644
--- a/lentic.el
+++ b/lentic.el
@@ -788,7 +788,6 @@ SEEN-BUFFER is a list of buffers to ignore."
             (get-buffer-create "*lentic-log*")
           (goto-char (point-max))
           (insert msg))))))
-
 ;; #+end_src
 
 ;; An emergency detection system. Several of the hooks in use 
(post-command-hook,
@@ -1083,9 +1082,6 @@ the change."
             (nth 2 updates)
             seen-buffer))))
      lentic-config)))
-
-
-
 ;; #+end_src
 
 ;; We also need to store the location of the area to be changed before the 
change



reply via email to

[Prev in Thread] Current Thread [Next in Thread]