summaryrefslogtreecommitdiffstatshomepage
path: root/nroam.el
diff options
context:
space:
mode:
authorGravatar Nicolas Petton2021-03-25 21:15:43 +0100
committerGravatar GitHub2021-03-25 21:15:43 +0100
commita5508d9958c2148c04ec32d7b3a9f72423e4b0aa (patch)
treee58a7fc17db496e1d36c9ab0e81254290eb1837a /nroam.el
parent9c75bb316bb8769a9cb7a6f6c11225ba482befbd (diff)
parente1e164f02e203afe764faa6fca4a98c473300100 (diff)
downloadnroam-a5508d9958c2148c04ec32d7b3a9f72423e4b0aa.tar.gz
nroam-a5508d9958c2148c04ec32d7b3a9f72423e4b0aa.zip
Merge pull request #28 from NicolasPetton/nroam--sections-private
* nroam.el (nroam--sections): Redefine as a private var.
Diffstat (limited to 'nroam.el')
-rw-r--r--nroam.el14
1 files changed, 6 insertions, 8 deletions
diff --git a/nroam.el b/nroam.el
index d2982aa..51cea0b 100644
--- a/nroam.el
+++ b/nroam.el
@@ -44,12 +44,10 @@
(require 'nroam-backlinks)
(require 'nroam-unlinked)
-(defcustom nroam-sections nil
- "List of functions to be called to insert sections in nroam buffers."
- :group 'nroam
- :type '(repeat function))
+(defvar nroam--sections nil
+ "List of functions to be called to insert sections in nroam buffers.")
-(defvar nroam-sections-map
+(defvar nroam--sections-map
(let ((map (make-sparse-keymap)))
(define-key map (kbd "C-c C-c") #'nroam-update)
(define-key map (kbd "RET") #'nroam-return)
@@ -58,7 +56,7 @@
(defun nroam-register-section (function)
"Add FUNCTION as a section in nroam."
- (add-to-list 'nroam-sections function t))
+ (add-to-list 'nroam--sections function t))
(defvar-local nroam-start-marker nil)
(defvar-local nroam-end-marker nil)
@@ -73,7 +71,7 @@ Make the region inserted by BODY read-only, and marked with
,@body
(let* ((end (point))
(ov (make-overlay beg end)))
- (overlay-put ov 'keymap nroam-sections-map)
+ (overlay-put ov 'keymap nroam--sections-map)
(put-text-property beg (1+ beg) 'front-sticky '(read-only))
(put-text-property beg end 'read-only t)
;; Add a non-read-only newline so that text can be inserted at the end of
@@ -166,7 +164,7 @@ Make the region inserted by BODY read-only, and marked with
(nroam--ensure-empty-line))
(with-nroam-markers
(nroam--insert-heading 1 "Backlinks" "noexport")
- (nroam--do-separated-by-newlines #'funcall nroam-sections))
+ (nroam--do-separated-by-newlines #'funcall nroam--sections))
(nroam--set-sections-visibility))))
(defun nroam--set-sections-visibility ()