[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/org-remark 81bc062482 10/67: refactor(nov): highlight-s
From: |
ELPA Syncer |
Subject: |
[elpa] externals/org-remark 81bc062482 10/67: refactor(nov): highlight-save-book-entry |
Date: |
Sat, 22 Jul 2023 06:59:00 -0400 (EDT) |
branch: externals/org-remark
commit 81bc062482aa3be6aa674c9ab095a3712400a653
Author: Noboru Ota <me@nobiot.com>
Commit: Noboru Ota <me@nobiot.com>
refactor(nov): highlight-save-book-entry
Added doc string and adjusted the code to reflect it correctly: the
point returned from the function when a new headline is created should
be the beginning of it.
---
org-remark-nov.el | 19 ++++++++++---------
1 file changed, 10 insertions(+), 9 deletions(-)
diff --git a/org-remark-nov.el b/org-remark-nov.el
index 1d4a6ec4e3..d32531c854 100644
--- a/org-remark-nov.el
+++ b/org-remark-nov.el
@@ -23,23 +23,24 @@
(2 . org-remark-highlight-save-file-entry))))
(defun org-remark-nov-highlight-save-book-entry (level source-buf _notes-buf)
- ".
+ "Create the book entry if it does not exist for the epub file
Assume the current buffer is in the notes buffer."
(let (filename title)
(with-current-buffer source-buf
(setq filename nov-file-name
title (cdr (assoc 'title nov-metadata))))
- (or (org-find-property
- "org-remark-nov-file" filename)
+ ;; Back in the notes buffer, return the point of the beginning of
+ ;; the headline
+ (or (org-find-property "org-remark-nov-file" filename)
(progn
- ;; If file-headline does not exist, create one at the bottom
+ ;; If the book entry does not exist, create one at the bottom of
notes buffer
(goto-char (point-max))
;; Ensure to be in the beginning of line to add a new headline
(when (eolp) (open-line 1) (forward-line 1) (beginning-of-line))
(insert-char (string-to-char "*") level)
(insert (concat " " title "\n"))
(org-set-property "org-remark-nov-file" filename)
- (point)))))
+ (org-back-to-heading) (point)))))
;;; TODO move this test function to the user manual as a sample
(defun test/simple-headline (level source-buf _notes-buf)
@@ -47,17 +48,17 @@ Assume the current buffer is in the notes buffer."
(with-current-buffer source-buf
(setq filename (org-remark-source-get-file-name
(org-remark-source-find-file-name))))
- (or (org-find-property
- "org-remark-file-name" filename)
+ ;; Return the point of the beginning of the headline
+ (or (org-find-property "org-remark-file-name" filename)
(progn
- ;; If file-headline does not exist, create one at the bottom
+ ;; If this level of headline does not exist, create one at the bottom
(goto-char (point-max))
;; Ensure to be in the beginning of line to add a new headline
(when (eolp) (open-line 1) (forward-line 1) (beginning-of-line))
(insert-char (string-to-char "*") level)
(insert (concat " " "title" "\n"))
(org-set-property "org-remark-file-name" filename)
- (point)))))
+ (org-back-to-heading) (point)))))
(provide 'org-remark-nov)
;;; org-remark-nov.el ends here
- [elpa] externals/org-remark 5a0299bdf7 39/67: refactor: (WIP) highlight-new-headline-maybe, (continued)
- [elpa] externals/org-remark 5a0299bdf7 39/67: refactor: (WIP) highlight-new-headline-maybe, ELPA Syncer, 2023/07/22
- [elpa] externals/org-remark eb9741e51f 44/67: refactor: highlights-add-icons, ELPA Syncer, 2023/07/22
- [elpa] externals/org-remark ae220ad29b 50/67: refactor(icon): change default to ascii characters only, ELPA Syncer, 2023/07/22
- [elpa] externals/org-remark 112bbfa9ba 53/67: docs: Update user manual with new features, etc., ELPA Syncer, 2023/07/22
- [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 <=
- [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, 2023/07/22
- [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