[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/org-remark 2b0ccad245 1/9: refactor: org-remark-highlig
From: |
ELPA Syncer |
Subject: |
[elpa] externals/org-remark 2b0ccad245 1/9: refactor: org-remark-highlight-get-text -> notes-get-text |
Date: |
Tue, 27 Dec 2022 19:58:31 -0500 (EST) |
branch: externals/org-remark
commit 2b0ccad2452e116b467a13196a508304df91352d
Author: Noboru Ota <me@nobiot.com>
Commit: Noboru Ota <me@nobiot.com>
refactor: org-remark-highlight-get-text -> notes-get-text
Rename the function based on their area of concern
---
org-remark.el | 43 ++++++++++++++++++++++---------------------
1 file changed, 22 insertions(+), 21 deletions(-)
diff --git a/org-remark.el b/org-remark.el
index 1b624257ef..d43f78b2d7 100644
--- a/org-remark.el
+++ b/org-remark.el
@@ -6,7 +6,7 @@
;; URL: https://github.com/nobiot/org-remark
;; Version: 1.0.5
;; Created: 22 December 2020
-;; Last modified: 25 December 2022
+;; Last modified: 26 December 2022
;; Package-Requires: ((emacs "27.1") (org "9.4"))
;; Keywords: org-mode, annotation, note-taking, marginal-notes, wp,
@@ -743,24 +743,6 @@ non-nil. Returns nil otherwise, or when no Org-ID is
found."
(and org-remark-use-org-id
(org-entry-get point "ID" :inherit)))
-(defun org-remark-highlight-get-text ()
- "Return the text body of a highlight in the notes buffer."
- (let ((full-text
- (save-excursion
- (org-end-of-meta-data :full)
- (if
- ;; handle empty annotation
- ;; (org-end-of-meta-data :full) took us to next org heading):
- (or (looking-at org-heading-regexp)
- (eobp)) ;; end of buffer
- "[empty entry]"
- (buffer-substring-no-properties
- (point)
- (org-end-of-subtree))))))
- (if (< 200 (length full-text))
- (substring-no-properties full-text 0 200)
- full-text)))
-
(defun org-remark-highlight-save (filename beg end props &optional title)
"Save a single HIGHLIGHT in the marginal notes file.
@@ -850,7 +832,7 @@ source with using ORGID."
(org-remark-notes-set-properties beg end props)
(when (and orgid org-remark-use-org-id)
(insert (concat "[[id:" orgid "]" "[" title "]]"))))
- (setq notes-props (list :body (org-remark-highlight-get-text)))))
+ (setq notes-props (list :body (org-remark-notes-get-text)))))
(cond
;; fix GH issue #19
;; Temporarily remove `org-remark-save' from the `after-save-hook'
@@ -959,6 +941,25 @@ drawer."
(org-set-property p v))))
t)
+(defun org-remark-notes-get-text ()
+ "Return the text body of a highlight in the notes buffer."
+ (let ((full-text
+ (save-excursion
+ (org-end-of-meta-data :full)
+ (if
+ ;; handle empty annotation
+ ;; (org-end-of-meta-data :full) took us to next org heading):
+ (or (looking-at org-heading-regexp)
+ (eobp)) ;; end of buffer
+ "[empty entry]"
+ (buffer-substring-no-properties
+ (point)
+ (org-end-of-subtree))))))
+ (if (< 200 (length full-text))
+ (substring-no-properties full-text 0 200)
+ full-text)))
+
+
;;;;; org-remark-highlights
;; Work on all the highlights in the current buffer
@@ -1036,7 +1037,7 @@ Each highlight is a property list in the following
properties:
(end (string-to-number
(org-entry-get (point)
org-remark-prop-source-end)))
- (text (org-remark-highlight-get-text)))
+ (text (org-remark-notes-get-text)))
(push (list :id id
:location (cons beg end)
:label (org-entry-get (point)
"org-remark-label")
- [elpa] externals/org-remark updated (a6b79194d8 -> 5fb747a419), ELPA Syncer, 2022/12/27
- [elpa] externals/org-remark 854856059f 8/9: fix: issue #44 change CATEGORY, ELPA Syncer, 2022/12/27
- [elpa] externals/org-remark 47918fa751 2/9: feat: sync notes with source, ELPA Syncer, 2022/12/27
- [elpa] externals/org-remark cc69b0359b 6/9: fix: inifinate loop when notes = source for notes-sync, ELPA Syncer, 2022/12/27
- [elpa] externals/org-remark b6fa1bea1a 4/9: fix: notes-update-source to allow for beg end adjustment, ELPA Syncer, 2022/12/27
- [elpa] externals/org-remark f0a4f23911 3/9: feat: notes-source sync setup, ELPA Syncer, 2022/12/27
- [elpa] externals/org-remark 2b0ccad245 1/9: refactor: org-remark-highlight-get-text -> notes-get-text,
ELPA Syncer <=
- [elpa] externals/org-remark 5fb747a419 9/9: Merge branch 'notes-sync', ELPA Syncer, 2022/12/27
- [elpa] externals/org-remark eb6456d7f9 5/9: docs(notes-sync): add FIXME comment for the previous commit, ELPA Syncer, 2022/12/27
- [elpa] externals/org-remark 00e56e12a6 7/9: fix: text-property org-remark-label to be symbol, ELPA Syncer, 2022/12/27