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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/org-remark 07f5838c40 61/67: fix: Add headlines in the


From: ELPA Syncer
Subject: [elpa] externals/org-remark 07f5838c40 61/67: fix: Add headlines in the correct order and in the correct headline
Date: Sat, 22 Jul 2023 06:59:04 -0400 (EDT)

branch: externals/org-remark
commit 07f5838c40f10b0eb7d073b5fe79a0ebb1f477f8
Author: Noboru Ota <me@nobiot.com>
Commit: Noboru Ota <me@nobiot.com>

    fix: Add headlines in the correct order and in the correct headline
    
    This was missed in the refctoring for nov.el. It was not easy to detect
    when one single notes file is created for a single source (e.g. a signle
    EPUB book).
    
    The problem was in the new logic to find and add new headlines. For each
    headline, the point needs to move to inside the current headline;
    otherwise, the narrowing and `point-max` would not work for the intended
    headline, thus creating a new highlight headline in the wrong parent
    node.
    
    This fix adds the `goto-char` to move to the correct point in the
    current headline intended to be narrowed to.
---
 org-remark.el | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/org-remark.el b/org-remark.el
index 437144a7c1..e9f596094d 100644
--- a/org-remark.el
+++ b/org-remark.el
@@ -6,7 +6,7 @@
 ;; URL: https://github.com/nobiot/org-remark
 ;; Version: 1.1.0
 ;; Created: 22 December 2020
-;; Last modified: 15 July 2023
+;; Last modified: 16 July 2023
 ;; Package-Requires: ((emacs "27.1") (org "9.4"))
 ;; Keywords: org-mode, annotation, note-taking, marginal-notes, wp,
 
@@ -918,12 +918,13 @@ buffer for automatic sync."
                 for (filename-fn title-fn prop-to-find) in 
headline-constructors
                 ;; This variable "point" is set in order to be returned at
                 ;; the end of the loop.
-                with point = nil
+                with point = 1
                 do (let (filename title)
                      (with-current-buffer source-buf
                        (setq filename (funcall filename-fn))
                        (setq title (funcall title-fn)))
                      (with-current-buffer notes-buf
+                       (goto-char point)
                        (setq point
                              (or (org-find-property
                                   prop-to-find filename)
@@ -955,6 +956,7 @@ title. PROPS is the alist of properties to be added to the 
headline.
 
 Return the point of begining of current heading."
   ;; If file-headline does not exist, create one at the bottom
+  (goto-char (point-max))
   (org-narrow-to-subtree)
   (goto-char (point-max))
   ;; Ensure to be in the beginning of line to add a new headline



reply via email to

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