[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/lentic e567b169c9 185/333: Kill lentic buffer when crea
From: |
ELPA Syncer |
Subject: |
[elpa] externals/lentic e567b169c9 185/333: Kill lentic buffer when creator buffer is killed. |
Date: |
Tue, 27 Feb 2024 13:00:33 -0500 (EST) |
branch: externals/lentic
commit e567b169c9b8d0c76866e5aaafb088df5bd9b1b5
Author: Phillip Lord <phillip.lord@newcastle.ac.uk>
Commit: Phillip Lord <phillip.lord@newcastle.ac.uk>
Kill lentic buffer when creator buffer is killed.
Removing the lentic makes sense because any change that is saved is
likely to later get deleted. This mimics the behaviour of indirect
buffers.
---
lentic.el | 16 +++++++++++++++-
1 file changed, 15 insertions(+), 1 deletion(-)
diff --git a/lentic.el b/lentic.el
index eee5b204ab..a2eb428d99 100644
--- a/lentic.el
+++ b/lentic.el
@@ -212,6 +212,11 @@ of mode in the current buffer.")
:initarg :this-buffer)
(that-buffer
:initarg :that-buffer)
+ (creator
+ :initarg :creator
+ :initform nil
+ :documentation
+ "Non-nil if this lentic-configuration was used to create a lentic view.")
(sync-point
:initarg :sync-point
:initform t)
@@ -289,6 +294,7 @@ created."
this-buffer))))
(sec-mode (oref conf :lentic-mode))
(sec-file (oref conf :lentic-file)))
+ (oset conf :creator t)
;; make sure this-buffer knows about that-buffer
(oset conf :that-buffer that-buffer)
;; insert the contents
@@ -399,7 +405,9 @@ see `lentic-init' for details."
(add-hook 'before-change-functions
'lentic-before-change-function)
(add-hook 'after-save-hook
- 'lentic-after-save-hook))
+ 'lentic-after-save-hook)
+ (add-hook 'kill-buffer-hook
+ 'lentic-kill-buffer-hook))
(defvar lentic-log t)
(defmacro lentic-log (&rest rest)
@@ -467,6 +475,12 @@ repeated errors.")
(when (buffer-file-name)
(save-buffer)))))))
+(defun lentic-kill-buffer-hook ()
+ (lentic-when-lentic
+ (when (oref lentic-config :creator)
+ (kill-buffer
+ (lentic-that lentic-config)))))
+
(defun lentic-post-command-hook ()
"Update point according to config, with error handling."
;;(message "Entering post-command-hook")
- [elpa] externals/lentic 00239795af 164/333: Update README for 0.6 release., (continued)
- [elpa] externals/lentic 00239795af 164/333: Update README for 0.6 release., ELPA Syncer, 2024/02/27
- [elpa] externals/lentic 3fce06e21c 171/333: Update for all examples., ELPA Syncer, 2024/02/27
- [elpa] externals/lentic 81dbcf298e 177/333: Update documentation to refer to lentic-autoloads., ELPA Syncer, 2024/02/27
- [elpa] externals/lentic d022ddc9a5 174/333: kill line, erase buffer test., ELPA Syncer, 2024/02/27
- [elpa] externals/lentic 3611abe92d 182/333: Haskell Support Added., ELPA Syncer, 2024/02/27
- [elpa] externals/lentic b870123e0e 186/333: Additional tools to generate info files., ELPA Syncer, 2024/02/27
- [elpa] externals/lentic 710626852d 189/333: Documentation formats ignored., ELPA Syncer, 2024/02/27
- [elpa] externals/lentic 9039dd3bdd 193/333: Contributions copyright fix., ELPA Syncer, 2024/02/27
- [elpa] externals/lentic ae9e4d7e63 184/333: Fix window breakage and wrong var name., ELPA Syncer, 2024/02/27
- [elpa] externals/lentic 50ad3e35bf 192/333: Documentation system added., ELPA Syncer, 2024/02/27
- [elpa] externals/lentic e567b169c9 185/333: Kill lentic buffer when creator buffer is killed.,
ELPA Syncer <=
- [elpa] externals/lentic f90c5d07a8 179/333: lentic-mode now requires lentic., ELPA Syncer, 2024/02/27
- [elpa] externals/lentic 23a39ef037 190/333: Debug statements removed from hooks., ELPA Syncer, 2024/02/27
- [elpa] externals/lentic 31187db217 199/333: lentic-mode now works, and has a lighter., ELPA Syncer, 2024/02/27
- [elpa] externals/lentic 9de0fae6f8 178/333: Autoloads automatically required by package., ELPA Syncer, 2024/02/27
- [elpa] externals/lentic 819ac479c4 188/333: Removed erroneous () in header., ELPA Syncer, 2024/02/27
- [elpa] externals/lentic b4c95e69df 196/333: Cosmetic Change., ELPA Syncer, 2024/02/27
- [elpa] externals/lentic a1799b72f7 197/333: Rot-13 added., ELPA Syncer, 2024/02/27
- [elpa] externals/lentic f90bda3f74 204/333: Prepare for next iteration., ELPA Syncer, 2024/02/27
- [elpa] externals/lentic 5f8b9dbe0a 205/333: literate-haskell example., ELPA Syncer, 2024/02/27
- [elpa] externals/lentic cafbf52329 206/333: Auto save files excluded!, ELPA Syncer, 2024/02/27