branch: externals/org-remark commit af03b2103e1be65bb18829b750d5f29e8cded4c6 Author: Noboru Ota <m...@nobiot.com> Commit: Noboru Ota <m...@nobiot.com>
docs: Docstring for org-remark-default-features, etc. --- org-remark-icon.el | 8 +++++++- org-remark.el | 25 +++++++++++++++++++------ 2 files changed, 26 insertions(+), 7 deletions(-) diff --git a/org-remark-icon.el b/org-remark-icon.el index 9ccdd2e7d1..8fca035524 100644 --- a/org-remark-icon.el +++ b/org-remark-icon.el @@ -5,7 +5,7 @@ ;; Author: Noboru Ota <m...@nobiot.com> ;; URL: https://github.com/nobiot/org-remark ;; Created: 29 July 2023 -;; Last modified: 19 August 2023 +;; Last modified: 20 August 2023 ;; Package-Requires: ((emacs "27.1") (org "9.4")) ;; Keywords: org-mode, annotation, note-taking, marginal-notes, wp @@ -28,6 +28,8 @@ ;;; Code: (require 'cl-macs) +;; Silence compiler +(defvar org-remark-default-feature-modes) (defgroup org-remark-icon nil "Enable `org-remark' to display glyph/icon indicators." @@ -87,6 +89,10 @@ single character, such as the default value." (string "(d)") (function))) +;; Register a mode for automatic enablement at the same time as +;; `org-remark-mode'. +(add-to-list 'org-remark-default-feature-modes #'org-remark-icon-mode) + ;;;###autoload (define-minor-mode org-remark-icon-mode "Enable Org-remark to display icons. diff --git a/org-remark.el b/org-remark.el index 75ff21e08a..a272214ba8 100644 --- a/org-remark.el +++ b/org-remark.el @@ -137,9 +137,21 @@ highlights. It is run with the source buffer as current buffer." ;;;; Variables -(defvar org-remark-default-features '(org-remark-icon org-remark-line)) -(defvar org-remark-default-feature-modes '(org-remark-icon-mode)) -(defvar org-remark-find-dwim-functions '(org-remark-find-overlay-at-point)) +(defvar org-remark-default-features '(org-remark-icon org-remark-line) + "Extension features to be enabled by default. +It is suggested to keep them as the default, but you can choose to disable them") + +(defvar org-remark-default-feature-modes '() + "Extension minor modes to be enabled together with `org-remark-mode'. +These minor modes should be registered to this variable by the +respective feature where required. As an example, see +`org-remark-line'.") + +(defvar org-remark-find-dwim-functions '(org-remark-find-overlay-at-point) + "Functions to find the highlight overlays. +These functions should be registered to this variable by the +respective feature where required. As an example, see +`org-remark-line'.") (defvar org-remark-last-notes-buffer nil "The cloned indirect buffer visiting the notes file. @@ -324,9 +336,9 @@ recommended to turn it on as part of Emacs initialization. (org-remark-mode ;; Activate (dolist (feature org-remark-default-features) - (unless (featurep feature) (require feature))) + (unless (featurep feature) (require feature nil 'noerror))) (dolist (feature-mode org-remark-default-feature-modes) - (funcall feature-mode +1)) + (when (functionp feature-mode) (funcall feature-mode +1))) (org-remark-highlights-load) (add-hook 'after-save-hook #'org-remark-save nil t) (add-hook 'org-remark-highlight-link-to-source-functions @@ -806,7 +818,8 @@ Optionally ID can be passed to find the exact ID match." (cl-defgeneric org-remark-highlight-make-overlay (_beg _end _face _org-remark-type) "Make overlay and return it -Put FACE and other necessary properties to the highlight OV") +Put FACE and other necessary properties to the highlight OV" + (ignore)) (cl-defmethod org-remark-highlight-make-overlay (beg end face (_org-remark-type (eql nil)))