[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/org-remark b50d0f7688 52/67: refactor: rename highlight
From: |
ELPA Syncer |
Subject: |
[elpa] externals/org-remark b50d0f7688 52/67: refactor: rename highlights-after-load-hook to -functions |
Date: |
Sat, 22 Jul 2023 06:59:04 -0400 (EDT) |
branch: externals/org-remark
commit b50d0f7688e769653571f91e1d6575e327464f04
Author: Noboru Ota <me@nobiot.com>
Commit: Noboru Ota <me@nobiot.com>
refactor: rename highlights-after-load-hook to -functions
It's an abnormal hook. The convention is to use -functions insted of
-hook.
---
NEWS | 5 +++--
org-remark.el | 25 +++++++++++++------------
2 files changed, 16 insertions(+), 14 deletions(-)
diff --git a/NEWS b/NEWS
index 571d8d1af1..cf655a1ea6 100644
--- a/NEWS
+++ b/NEWS
@@ -6,7 +6,7 @@ Current development version
+ The highlight position auto-adjusted (d)
- + Uses the new `org-remark-highlights-after-load-hook'
+ + Uses the new `org-remark-highlights-after-load-functions'
+ Icons are customizable. You can also disable icons by setting
the respective customizing variable to nil
@@ -36,7 +36,8 @@ Current development version
+ The fact that a given highlight has been automatically moved
is indicated by an icon
- - feat: org-remark-highlights-after-load-hook
+ - feat: org-remark-highlights-after-load-functions
+ Abnormal hook
- fix: Make load process robust
diff --git a/org-remark.el b/org-remark.el
index 7e032c4a6e..bf37cfae31 100644
--- a/org-remark.el
+++ b/org-remark.el
@@ -122,7 +122,7 @@ Org-remark does not create this ID, which needs to be added
manually or some other function to either the headline or file."
:type 'boolean)
-(defcustom org-remark-open-hook nil
+(defcustom org-remark-open-hook nil
"Hook run when a note buffer is opened/visited.
The current buffer is the note buffer."
:type 'hook)
@@ -137,6 +137,12 @@ Nil means no icon is to be displayed."
Nil means no icon is to be displayed."
:type 'string)
+(defcustom org-remark-highlights-after-load-functions nil
+ "Abnormal hook run after `org-remark-highlights-load'.
+It is run with OVERLAYS and NOTES-BUF as arguments. OVERLAYS are
+highlights. It is run with the source buffer as current buffer."
+ :type hook)
+
;;;; Variables
@@ -292,12 +298,12 @@ recommended to turn it on as part of Emacs initialization.
;; Activate
(org-remark-highlights-load)
(add-hook 'after-save-hook #'org-remark-save nil t)
- (add-hook 'org-remark-highlights-after-load-hook
+ (add-hook 'org-remark-highlights-after-load-functions
#'org-remark-highlights-adjust-positions)
;; Add-icons should be after all after-load-hook functions because
;; some of them make adjustment that's relevant for an icon --
;; e.g. adjust-positon.
- (add-hook 'org-remark-highlights-after-load-hook
+ (add-hook 'org-remark-highlights-after-load-functions
#'org-remark-highlights-add-icons 80)
(add-hook 'org-remark-highlight-link-to-source-functions
#'org-remark-highlight-link-to-source-default 80))
@@ -308,9 +314,9 @@ recommended to turn it on as part of Emacs initialization.
(delete-overlay highlight)))
(setq org-remark-highlights nil)
(remove-hook 'after-save-hook #'org-remark-save t)
- (remove-hook 'org-remark-highlights-after-load-hook
+ (remove-hook 'org-remark-highlights-after-load-functions
#'org-remark-highlights-adjust-positions)
- (remove-hook 'org-remark-highlights-after-load-hook
+ (remove-hook 'org-remark-highlights-after-load-functions
#'org-remark-highlights-add-icons)
(remove-hook 'org-remark-highlight-link-to-source-functions
#'org-remark-highlight-link-to-source-default))))
@@ -1346,11 +1352,6 @@ highlight is a property list in the following properties:
highlights)))))
highlights))))))
-(defvar org-remark-highlights-after-load-hook nil
- "Hook run after `org-remark-highlights-load'.
-It is run with OVERLAYS and NOTES-BUF as arguments. OVERLAYS are
-highlights. It is run with the source buffer as current buffer.")
-
(defun org-remark-highlights-load (&optional update)
"Visit notes file & load the saved highlights onto current buffer.
If there is no highlights or annotations for current buffer,
@@ -1382,7 +1383,7 @@ process."
(push (org-remark-highlight-load highlight) overlays))
(unless update (org-remark-notes-setup notes-buf source-buf))
(if overlays
- (progn (run-hook-with-args 'org-remark-highlights-after-load-hook
+ (progn (run-functions-with-args
'org-remark-highlights-after-load-functions
overlays notes-buf)
;; Return t
t)
@@ -1516,7 +1517,7 @@ Case 2. The overlay points to no buffer
(defun org-remark-highlights-adjust-positions (overlays _notes-buf)
"
-Meant to be set to `org-remark-highlights-after-load-hook' by
+Meant to be set to `org-remark-highlights-after-load-functions' by
mode-specific extensions."
(dolist (ov overlays)
(let ((highlight-text (overlay-get ov '*org-remark-original-text)))
- [elpa] externals/org-remark d133a32786 58/67: docs: Minor style updates to user manual, (continued)
- [elpa] externals/org-remark d133a32786 58/67: docs: Minor style updates to user manual, ELPA Syncer, 2023/07/22
- [elpa] externals/org-remark 58feed0c04 54/67: style: lint with flymake, ELPA Syncer, 2023/07/22
- [elpa] externals/org-remark e4c42d7fd4 56/67: docs: Fix footnote (remove), ELPA Syncer, 2023/07/22
- [elpa] externals/org-remark 536c2cca1e 63/67: fix: add-headline. Location of new highlight notes was wrong, ELPA Syncer, 2023/07/22
- [elpa] externals/org-remark 883f948bbf 66/67: style: make org-remark-highlight-save obsolete and add alias, ELPA Syncer, 2023/07/22
- [elpa] externals/org-remark 3216d951fc 09/67: feat: nov.el title and nov-file-name in H1 of the notes, ELPA Syncer, 2023/07/22
- [elpa] externals/org-remark 81bc062482 10/67: refactor(nov): highlight-save-book-entry, ELPA Syncer, 2023/07/22
- [elpa] externals/org-remark eed28d7b8d 26/67: Merge branch 'main' into dev/nov.el, ELPA Syncer, 2023/07/22
- [elpa] externals/org-remark e5de684b67 33/67: fix: adjust location of highlight, ELPA Syncer, 2023/07/22
- [elpa] externals/org-remark 5b76fa930a 49/67: refactor(load): make load process robust., ELPA Syncer, 2023/07/22
- [elpa] externals/org-remark b50d0f7688 52/67: refactor: rename highlights-after-load-hook to -functions,
ELPA Syncer <=
- [elpa] externals/org-remark 07f5838c40 61/67: fix: Add headlines in the correct order and in the correct headline, ELPA Syncer, 2023/07/22
- [elpa] externals/org-remark 6ebbce9239 37/67: fix(load): clear obsolete highlight overlays before loading, ELPA Syncer, 2023/07/22
- [elpa] externals/org-remark 0ec9d2f1c2 41/67: refactor(headline-add): WIP, ELPA Syncer, 2023/07/22
- [elpa] externals/org-remark 1c2f9ed822 46/67: feat: toggle icons, ELPA Syncer, 2023/07/22
- [elpa] externals/org-remark 36df818752 55/67: docs: Update user manaul, ELPA Syncer, 2023/07/22
- [elpa] externals/org-remark 642d4b489f 13/67: docs: updated NEWS, ELPA Syncer, 2023/07/22
- [elpa] externals/org-remark 2a10b3d75a 17/67: refactor: adjust-positions, ELPA Syncer, 2023/07/22
- [elpa] externals/org-remark 09d95e7519 20/67: Merge branch 'main' into dev/nov.el, ELPA Syncer, 2023/07/22
- [elpa] externals/org-remark 52bc575bb9 28/67: docs: comments and docstring, ELPA Syncer, 2023/07/22
- [elpa] externals/org-remark e10a00b426 35/67: feat: add icon for highlights with annotation body text #64, ELPA Syncer, 2023/07/22