[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/treeview 270cfbd5bd 06/25: Using 'let' to set buffer-read-
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/treeview 270cfbd5bd 06/25: Using 'let' to set buffer-read-only temporarily to t |
Date: |
Sat, 10 Sep 2022 17:59:37 -0400 (EDT) |
branch: elpa/treeview
commit 270cfbd5bde334d4ae5d300e42094b79a6017d4c
Author: Tilman Rassy <tilman.rassy@googlemail.com>
Commit: Tilman Rassy <tilman.rassy@googlemail.com>
Using 'let' to set buffer-read-only temporarily to t
---
treeview.el | 48 ++++++++++++++++++++----------------------------
1 file changed, 20 insertions(+), 28 deletions(-)
diff --git a/treeview.el b/treeview.el
index 4b9b83cbb2..63026d871b 100644
--- a/treeview.el
+++ b/treeview.el
@@ -714,49 +714,43 @@ The main implementation is outsourced and split into two
other functions:
`treeview-display-node-internal' and `treeview-set-node-end-after-display'.
The first one does the rendering, the latter one fixes the
`marker-insertion-type's of the end markers of the rendered nodes."
- (let ( (read-only-p buffer-read-only) )
- (setq buffer-read-only nil)
+ (let ( (buffer-read-only nil) )
(treeview-display-node-internal node append-newline-p)
- (treeview-set-node-end-after-display node)
- (setq buffer-read-only read-only-p) ))
+ (treeview-set-node-end-after-display node)))
(defun treeview-insert-node-after (node anchor)
"Insert NODE after ANCHOR.
ANCHOR must be a cons cell of the list of children of a node. NODE is inserted
after this cons cell. NODE is also displayed if the parent is expanded."
- (let* ( (read-only-p buffer-read-only)
- (anchor-node (car anchor))
+ (let* ( (anchor-node (car anchor))
(parent (treeview-get-node-parent anchor-node))
(new-cons (cons node nil)) )
(setcdr new-cons (cdr anchor))
(setcdr anchor new-cons)
(treeview-set-node-parent node parent)
(when (treeview-node-expanded-p parent)
- (setq buffer-read-only nil)
- (goto-char (treeview-get-node-prop anchor-node 'end))
- (end-of-line)
- (newline)
- (treeview-display-node-internal node nil)
- (treeview-set-node-end-after-display node)
- (setq buffer-read-only read-only-p))))
+ (let ( (buffer-read-only nil) )
+ (goto-char (treeview-get-node-prop anchor-node 'end))
+ (end-of-line)
+ (newline)
+ (treeview-display-node-internal node nil)
+ (treeview-set-node-end-after-display node) )) ))
(defun treeview-add-child-at-front (parent node)
"Insert NODE at the beginning of the children of PARENT.
Thus, NODE becomes the new first child of PARENT. NODE is also displayed if
PARENT is expanded."
- (let ( (read-only-p buffer-read-only)
- (children (treeview-get-node-children parent)) )
+ (let ( (children (treeview-get-node-children parent)) )
(setq children (cons node children))
(treeview-set-node-parent node parent)
(treeview-set-node-children parent children)
(when (treeview-node-expanded-p parent)
- (setq buffer-read-only nil)
- (goto-char (treeview-get-node-prop parent 'start))
- (end-of-line)
- (newline)
- (treeview-display-node-internal node nil)
- (treeview-set-node-end-after-display node)
- (setq buffer-read-only read-only-p))))
+ (let ( (buffer-read-only nil) )
+ (goto-char (treeview-get-node-prop parent 'start))
+ (end-of-line)
+ (newline)
+ (treeview-display-node-internal node nil)
+ (treeview-set-node-end-after-display node) )) ))
(defun treeview-add-child (parent node compare-function)
(let ( (cursor (treeview-get-node-children parent)) anchor )
@@ -791,11 +785,10 @@ descendents are removed from the children of their
respective parents.
The main purpose of this function is to implement the functions
`treeview-redisplay-node' and `treeview-remove-node'."
- (let* ( (read-only-p buffer-read-only)
- (start (treeview-get-node-prop node 'start))
- (end (treeview-get-node-prop node 'end)) )
+ (let* ( (start (treeview-get-node-prop node 'start))
+ (end (treeview-get-node-prop node 'end))
+ (buffer-read-only nil) )
(treeview--recursivlely-remove-overlays node)
- (setq buffer-read-only nil)
(when leave-no-gap
;; Move end position to end of previous line (if any) to remove node
completely
(save-excursion
@@ -805,8 +798,7 @@ The main purpose of this function is to implement the
functions
(setq start (point)))))
(delete-region start end)
(treeview-set-node-prop node 'start nil)
- (treeview-set-node-prop node 'end nil)
- (setq buffer-read-only read-only-p)))
+ (treeview-set-node-prop node 'end nil)))
(defun treeview-remove-node (node)
"Remove NODE from the tree.
- [nongnu] elpa/treeview e601230367 20/25: Removed needless intern statements, (continued)
- [nongnu] elpa/treeview e601230367 20/25: Removed needless intern statements, ELPA Syncer, 2022/09/10
- [nongnu] elpa/treeview 07ea52cd7f 16/25: Added package dependency on emacs 24.4, ELPA Syncer, 2022/09/10
- [nongnu] elpa/treeview 8382de4bdd 18/25: Sharp-quoted function name, ELPA Syncer, 2022/09/10
- [nongnu] elpa/treeview f0c0711070 04/25: Insering/removing nodes; treeview-after-node-expanded-function and treeview-after-node-folded-function, ELPA Syncer, 2022/09/10
- [nongnu] elpa/treeview 5dff23aac0 09/25: New functions for navigation; misc. improvements, ELPA Syncer, 2022/09/10
- [nongnu] elpa/treeview 3038ebf96e 08/25: Fixed bug when removing first child, ELPA Syncer, 2022/09/10
- [nongnu] elpa/treeview 34ecd7a320 24/25: Fixed issues detected by flycheck; updated documentation, ELPA Syncer, 2022/09/10
- [nongnu] elpa/treeview a82bc8c5d1 17/25: Removed needless progn around body of while, ELPA Syncer, 2022/09/10
- [nongnu] elpa/treeview 4a341b05bc 14/25: Bugfix for updating hidden nodes, ELPA Syncer, 2022/09/10
- [nongnu] elpa/treeview 7fc5f30552 03/25: Initial commit of treeview.el, ELPA Syncer, 2022/09/10
- [nongnu] elpa/treeview 270cfbd5bd 06/25: Using 'let' to set buffer-read-only temporarily to t,
ELPA Syncer <=
- [nongnu] elpa/treeview 0bdd3187c7 07/25: Reworked treeview-put so it can insert images, ELPA Syncer, 2022/09/10