[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/org-remark 6038ab7c30 009/173: fix: align highlight and
From: |
ELPA Syncer |
Subject: |
[elpa] externals/org-remark 6038ab7c30 009/173: fix: align highlight and position |
Date: |
Fri, 28 Jan 2022 16:57:54 -0500 (EST) |
branch: externals/org-remark
commit 6038ab7c308aaa537fd4f99f0e7b6e8320e44b8f
Author: Noboru Ota <me@nobiot.com>
Commit: Noboru Ota <me@nobiot.com>
fix: align highlight and position
When text was inserted directly on the position of the mark (begin or end
of a
highlighted text region), the recorded location stored in the marginalia was
not in sync with the highlight.
This was because of the default marker insertion type
(`marker-insertion-type`). It's by default `nil`. It needs to be `t` for all
the begin and end position of each highlight.
---
org-marginalia.el | 21 +++++++++++++++++----
1 file changed, 17 insertions(+), 4 deletions(-)
diff --git a/org-marginalia.el b/org-marginalia.el
index 6edbe8af58..c04ba29818 100644
--- a/org-marginalia.el
+++ b/org-marginalia.el
@@ -184,10 +184,14 @@ beginning point; this should be useful when `om/next' and
(add-text-properties beg end '(font-lock-face om/highlighter))
;; This beg and end are not always in sync when you change the text in it
(add-text-properties beg end `(om/id ,id))
- ;; Keep track in a local variable
- ;; It's alist; don't forget the dot (beg . end)
- ;; The dot "." is imporant to make the car/cdr "getter" interface clean
- (push `(,id ,(set-marker (make-marker) beg) . ,(set-marker (make-marker)
end))
+ ;; Keep track in a local variable It's alist; don't forget the dot
+ ;; (beg . end)
+ ;; The dot "." is imporant to make the car/cdr "getter" interface clean.
+
+ ;; Also, `set-marker-insertion-type' to set the type t is necessary to move
+ ;; the cursor in sync with the font-lock-face property of the text property.
+ (push `(,id
+ ,(om/make-highlight-marker beg) . ,(om/make-highlight-marker end))
om/highlights)
(om/sort-highlights-list))
@@ -395,6 +399,15 @@ creat a new headline at the end of the buffer."
(when om/highlights
(setq om/highlights (seq-sort-by (lambda (s) (car (cdr s))) #'<
om/highlights))))
+(defun om/make-highlight-marker (point)
+ "Return marker of the insertion-type t.
+The insertion-type is important in order for the highlight
+position (beg and end points) in sycn with the highlited text
+properties."
+ (let ((marker (set-marker (make-marker) point)))
+ (set-marker-insertion-type marker t)
+ marker))
+
;;;; Footer
(provide 'org-marginalia)
- [elpa] branch externals/org-remark created (now 7226f4d01e), ELPA Syncer, 2022/01/28
- [elpa] externals/org-remark 2b6773a911 016/173: doc: Update marginalia, ELPA Syncer, 2022/01/28
- [elpa] externals/org-remark 1abcfe0881 005/173: doc: Add license badge and link to LICENSE, ELPA Syncer, 2022/01/28
- [elpa] externals/org-remark 211c2ccb05 013/173: break: Change om/open-at-point to om/open, ELPA Syncer, 2022/01/28
- [elpa] externals/org-remark 4e694b8562 010/173: doc: Fix doc string, ELPA Syncer, 2022/01/28
- [elpa] externals/org-remark ec76d6e82f 006/173: doc: Fix the badge display, ELPA Syncer, 2022/01/28
- [elpa] externals/org-remark bb321f57f5 001/173: Initial commit for GH, ELPA Syncer, 2022/01/28
- [elpa] externals/org-remark 794d9e5169 008/173: doc: Fix the badge display, ELPA Syncer, 2022/01/28
- [elpa] externals/org-remark 6038ab7c30 009/173: fix: align highlight and position,
ELPA Syncer <=
- [elpa] externals/org-remark f5905ac735 004/173: admin: Add LICENSE, ELPA Syncer, 2022/01/28
- [elpa] externals/org-remark 1d496daeb7 014/173: internal: Move minor mode to the top, ELPA Syncer, 2022/01/28
- [elpa] externals/org-remark e96941d8c2 002/173: doc: minor spelling correction, ELPA Syncer, 2022/01/28
- [elpa] externals/org-remark d58e8f256c 012/173: break: Change om/save-all to om/save, ELPA Syncer, 2022/01/28
- [elpa] externals/org-remark 3d6207ae20 011/173: doc: Update doc, ELPA Syncer, 2022/01/28
- [elpa] externals/org-remark 22d7d373bc 003/173: doc: Replace wrong images; minior spelling fix, ELPA Syncer, 2022/01/28
- [elpa] externals/org-remark 8762fdad61 024/173: fix: defface for highlighter, ELPA Syncer, 2022/01/28
- [elpa] externals/org-remark 5511d32062 026/173: doc: Add title image, ELPA Syncer, 2022/01/28
- [elpa] externals/org-remark 13f36d7241 020/173: internal: Fix the macro expansion, ELPA Syncer, 2022/01/28
- [elpa] externals/org-remark 66da9a3fb9 028/173: doc: Update title image; add its source files, ELPA Syncer, 2022/01/28