emacs-elpa-diffs
[Top][All Lists]
Advanced

[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.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]