[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/helm e4cd70b7c8 2/3: Make headers in edit var buffer read-
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/helm e4cd70b7c8 2/3: Make headers in edit var buffer read-only |
Date: |
Tue, 6 Jun 2023 10:03:11 -0400 (EDT) |
branch: elpa/helm
commit e4cd70b7c86c7bc13f0fbfde96b87f6bbe2bf56f
Author: Thierry Volpiatto <thievol@posteo.net>
Commit: Thierry Volpiatto <thievol@posteo.net>
Make headers in edit var buffer read-only
---
helm-elisp.el | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/helm-elisp.el b/helm-elisp.el
index 206561efb4..bd710572d4 100644
--- a/helm-elisp.el
+++ b/helm-elisp.el
@@ -966,13 +966,17 @@ Special commands:
(defun helm-edit-variable (var)
(let* ((sym (intern-soft var))
(val (symbol-value sym))
- (pp (pp-to-string val)))
+ (pp (pp-to-string val))
+ start)
(with-current-buffer (get-buffer-create helm-pretty-print-buffer-name)
(erase-buffer)
(helm-edit-variable-mode)
+ (setq start (point))
;; Any number of lines starting with ";;;" + one empty line.
(insert (format ";;; Edit variable `%s' and hit C-c C-c when done\n" sym)
";;; Abort with C-c C-k\n\n")
+ (add-text-properties start (1- (point)) '(read-only t))
+ (add-text-properties (1- (point)) (point) '(read-only t rear-nonsticky
t))
(set (make-local-variable 'helm-pretty-print-current-symbol) sym)
(save-excursion (insert pp))
(write-region