[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/org-remark 41f90c53a8 59/67: refactor: Add 'org-remark-
From: |
ELPA Syncer |
Subject: |
[elpa] externals/org-remark 41f90c53a8 59/67: refactor: Add 'org-remark-string=' for highlight-adjust-positions |
Date: |
Sat, 22 Jul 2023 06:59:04 -0400 (EDT) |
branch: externals/org-remark
commit 41f90c53a8ad177cad27296ffaf40b55b02a7340
Author: Noboru Ota <me@nobiot.com>
Commit: Noboru Ota <me@nobiot.com>
refactor: Add 'org-remark-string=' for highlight-adjust-positions
---
org-remark.el | 26 +++++++++++++++-----------
1 file changed, 15 insertions(+), 11 deletions(-)
diff --git a/org-remark.el b/org-remark.el
index 7aa0692829..33070306d9 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: 14 July 2023
+;; Last modified: 15 July 2023
;; Package-Requires: ((emacs "27.1") (org "9.4"))
;; Keywords: org-mode, annotation, note-taking, marginal-notes, wp,
@@ -1085,13 +1085,7 @@ It searches for TEXT, which should be the original text
of the highlight."
(end (overlay-end highlight))
(paragraph-beg)(paragraph-end))
(org-with-wide-buffer
- (unless (string=
- ;; Cater to the case when the text is divided by a newline
- ;; character \n. Remove all spaces and newline chars
- ;; before comparing the strings.
- (replace-regexp-in-string "[\n ]" ""
- (buffer-substring beg end))
- (replace-regexp-in-string "[\n ]" "" text))
+ (unless (org-remark-string= (buffer-substring-no-properties beg end) text)
;; Look at one paragraph ahead as it is possible that the
;; position has been displaced across a paragraph
(goto-char beg) (backward-paragraph 2) (setq paragraph-beg (point))
@@ -1534,9 +1528,10 @@ extensions."
;; it is different to the current
;; TODO fix the highlight comparision logic
(when (and highlight-text
- (not (string= highlight-text
- (buffer-substring-no-properties
- (overlay-start ov) (overlay-end ov)))))
+ (not (org-remark-string=
+ highlight-text
+ (buffer-substring-no-properties
+ (overlay-start ov) (overlay-end ov)))))
(org-remark-highlight-adjust-position-after-load
ov highlight-text)))))
@@ -1601,6 +1596,15 @@ function extends the behavior and looks for the word at
point"
(list beg end))
(user-error "No region selected and the cursor is not on a word"))))
+(defun org-remark-string= (s1 s2)
+ "Like `string=' but remove newlines and spaces before compare."
+ (string=
+ ;; Cater to the case when the text is divided by a newline
+ ;; character \n. Remove all spaces and newline chars
+ ;; before comparing the strings.
+ (replace-regexp-in-string "[\n ]" "" s1)
+ (replace-regexp-in-string "[\n ]" "" s2)))
+
;;;; Footer
- [elpa] externals/org-remark 07f5838c40 61/67: fix: Add headlines in the correct order and in the correct headline, (continued)
- [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
- [elpa] externals/org-remark 2a10b3d75a 17/67: refactor: adjust-positions, ELPA Syncer, 2023/07/22
- [elpa] externals/org-remark 09d95e7519 20/67: Merge branch 'main' into dev/nov.el, ELPA Syncer, 2023/07/22
- [elpa] externals/org-remark 52bc575bb9 28/67: docs: comments and docstring, ELPA Syncer, 2023/07/22
- [elpa] externals/org-remark e10a00b426 35/67: feat: add icon for highlights with annotation body text #64, ELPA Syncer, 2023/07/22
- [elpa] externals/org-remark 41f90c53a8 59/67: refactor: Add 'org-remark-string=' for highlight-adjust-positions,
ELPA Syncer <=
- [elpa] externals/org-remark 2bd53de493 60/67: refactor: Set fn to hook org-remark-highlights-after-load-functions, ELPA Syncer, 2023/07/22
- [elpa] externals/org-remark e1b7a3a1ba 19/67: Merge remote-tracking branch 'sati-bodhi/main' into dev/nov.el, ELPA Syncer, 2023/07/22
- [elpa] externals/org-remark 090156bed2 21/67: feat: org-remark-nov-mode minor mode, ELPA Syncer, 2023/07/22
- [elpa] externals/org-remark ef7e02d542 34/67: fix: annotation body to be nil when no body text, ELPA Syncer, 2023/07/22
- [elpa] externals/org-remark aa58058ec4 38/67: refactor: add-headlines (WIP), ELPA Syncer, 2023/07/22
- [elpa] externals/org-remark c38f46e806 42/67: refactor(highlight-add): remove spurflous/obsolete elements, ELPA Syncer, 2023/07/22
- [elpa] externals/org-remark b94c64e381 45/67: feature: Make icons customizable, ELPA Syncer, 2023/07/22
- [elpa] externals/org-remark f1ea78bcf1 47/67: refactor: highlight-add, ELPA Syncer, 2023/07/22
- [elpa] externals/org-remark f21ab48aad 62/67: refactor: simple name replace org-remark-get-epub-source, ELPA Syncer, 2023/07/22
- [elpa] externals/org-remark 160de610f8 64/67: fix: make sure new top-level headline is appended, ELPA Syncer, 2023/07/22