[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/org-remark 0e05580760 10/16: feat(info): Advice to supp
From: |
ELPA Syncer |
Subject: |
[elpa] externals/org-remark 0e05580760 10/16: feat(info): Advice to support rendering Info nodes in same buffer |
Date: |
Sat, 29 Jul 2023 18:58:48 -0400 (EDT) |
branch: externals/org-remark
commit 0e05580760a1a7b079735843419b08e73b58c9ee
Author: Noboru Ota <me@nobiot.com>
Commit: Noboru Ota <me@nobiot.com>
feat(info): Advice to support rendering Info nodes in same buffer
No suitable hook is avaialble to trigger a function after the Info node
is rendered. This is necessary as Info renders a new node in the same
buffer (in the same way as Nov.el does).
Advice has been implemented. It is added and removed by
`org-remark-info-mode`.
---
NEWS | 9 +++++++++
org-remark-info.el | 19 +++++++++++++++----
2 files changed, 24 insertions(+), 4 deletions(-)
diff --git a/NEWS b/NEWS
index bf2ca9c79d..16d0e6cb14 100644
--- a/NEWS
+++ b/NEWS
@@ -1,5 +1,14 @@
Current development version
+ - feat(info): Org-remark supports Info
+
+ No suitable hook is avaialble to trigger a function after the Info
node
+ is rendered. This is necessary as Info renders a new node in the same
+ buffer (in the same way as Nov.el does).
+
+ Advice has been implemented. It is added and removed by
+ `org-remark-info-mode`.
+
- feat: icons for additional information for highlights
+ Notes exists for the highlight (*)
diff --git a/org-remark-info.el b/org-remark-info.el
index 1d24a0e8cf..3d85b6713f 100644
--- a/org-remark-info.el
+++ b/org-remark-info.el
@@ -2,7 +2,7 @@
;; URL: https://github.com/nobiot/org-remark
;; Created: 16 January 2023
-;; Last modified: 16 July 2023
+;; Last modified: 21 July 2023
;;; Commentary:
@@ -10,7 +10,9 @@
(require 'ol-info)
(require 'info)
+(require 'org-remark-global-tracking)
(defvar org-remark-prop-source-file)
+(declare-function org-remark-highlights-load "org-remark")
;;;###autoload
(define-minor-mode org-remark-info-mode
@@ -23,12 +25,22 @@
(add-hook 'org-remark-source-find-file-name-functions
#'org-remark-info-get-node)
(add-hook 'org-remark-highlight-link-to-source-functions
- #'org-remark-info-link))
+ #'org-remark-info-link)
+ (advice-add #'Info-find-node :after
#'org-remark-info-highlights-load))
;; Disable
(remove-hook 'org-remark-source-find-file-name-functions
#'org-remark-info-get-node)
(remove-hook 'org-remark-highlight-link-to-source-functions
- #'org-remark-info-link)))
+ #'org-remark-info-link)
+ (advice-remove #'Info-find-node #'org-remark-info-highlights-load)))
+
+(defun org-remark-info-highlights-load (&rest _args)
+ "Wrapper for `org-remark-highlights-load'.
+It is necessary as this function is intended to be used as part
+of advice for `Info-goto-node', which gets arguments passed to
+it. `org-remark-highlights-load' should be called with no
+arguments for the purpose of `org-remark-info-mode'."
+ (org-remark-highlights-load))
(defun org-remark-info-get-node ()
"Return the current Info file/node."
@@ -58,7 +70,6 @@ Return the value in a alist like this:
(SOURCE-FILENAME-FN TITLE-FN PROP-TO-FIND)"
(let* ((headline-1 (list
;; SOURCE-FILENAME-FN
-
;; Don't include the full directory path for Info
;; node. This may change when Emacs version or
;; package version changes.
- [elpa] externals/org-remark efe2c4d504 13/16: refactor: logic to add an icon, (continued)
- [elpa] externals/org-remark efe2c4d504 13/16: refactor: logic to add an icon, ELPA Syncer, 2023/07/29
- [elpa] externals/org-remark 346fe9cf69 15/16: refactor: separate org-remark-icon into its own feature/file, ELPA Syncer, 2023/07/29
- [elpa] externals/org-remark ec693af64a 01/16: feat: org-remark-info-mode to support Info-mode #65, ELPA Syncer, 2023/07/29
- [elpa] externals/org-remark 87404b78d3 14/16: Merge branch 'main' into dev/1.2.0, ELPA Syncer, 2023/07/29
- [elpa] externals/org-remark b44092e6cf 06/16: style: make org-remark-highlight-save obsolete and add alias, ELPA Syncer, 2023/07/29
- [elpa] externals/org-remark a0624e2ebc 04/16: fix: make sure new top-level headline is appended, ELPA Syncer, 2023/07/29
- [elpa] externals/org-remark c6941579e3 09/16: refactor(nov): nov can defer loading org-remark, ELPA Syncer, 2023/07/29
- [elpa] externals/org-remark 6ef0b47bd2 12/16: fix: revert-buffer duplicates highlights, ELPA Syncer, 2023/07/29
- [elpa] externals/org-remark c701d9ceaa 07/16: style: silence compiler warning, ELPA Syncer, 2023/07/29
- [elpa] externals/org-remark 8ae3c426e0 08/16: fix: default highlighter color for dark theme, ELPA Syncer, 2023/07/29
- [elpa] externals/org-remark 0e05580760 10/16: feat(info): Advice to support rendering Info nodes in same buffer,
ELPA Syncer <=
- [elpa] externals/org-remark d73c72cfc3 16/16: docs(info): Add copyright and commentary to source header, ELPA Syncer, 2023/07/29