[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/org-remark 9bb66a742e 074/173: fix: overlay front-advan
From: |
ELPA Syncer |
Subject: |
[elpa] externals/org-remark 9bb66a742e 074/173: fix: overlay front-advance |
Date: |
Fri, 28 Jan 2022 16:58:02 -0500 (EST) |
branch: externals/org-remark
commit 9bb66a742efc7aaa89c9a942a3ad4459db097276
Author: Noboru Ota <me@nobiot.com>
Commit: Noboru Ota <me@nobiot.com>
fix: overlay front-advance
---
README.org | 36 ++++++++++++++++++++++++++++++------
org-marginalia.el | 6 +++---
2 files changed, 33 insertions(+), 9 deletions(-)
diff --git a/README.org b/README.org
index f3fb6a91c7..051683202a 100644
--- a/README.org
+++ b/README.org
@@ -44,6 +44,7 @@ Refer to the screenshots below for a teaser of what it can
do.
- [[#org-marginalia-load][org-marginalia-load]]
- [[#set-buffer-modified-p][set-buffer-modified-p]]
- [[#overlay-put][overlay-put]]
+ - [[#make-overlay-beg-end-nil-front-advance][(make-overlay beg end nil
'FRONT-ADVANCE)]]
- [[#local-variables][Local Variables]]
:END:
@@ -292,8 +293,8 @@ jit-lock-register
** org-marginalia-load
:PROPERTIES:
:marginalia-id: 3ed4316a
-:marginalia-source-beg: 12353
-:marginalia-source-end: 12372
+:marginalia-source-beg: 12372
+:marginalia-source-end: 12391
:END:
[[file:~/local-repos/org-marginalia/org-marginalia.el][org-marginalia]]
@@ -301,8 +302,8 @@ jit-lock-register
** set-buffer-modified-p
:PROPERTIES:
:marginalia-id: 275b8a06
-:marginalia-source-beg: 12232
-:marginalia-source-end: 12253
+:marginalia-source-beg: 12251
+:marginalia-source-end: 12272
:END:
[[file:~/local-repos/org-marginalia/org-marginalia.el][org-marginalia]]
@@ -313,14 +314,37 @@ You cannot use `undo' to undo highlighter.
** overlay-put
:PROPERTIES:
:marginalia-id: 44c310d9
-:marginalia-source-beg: 11551
-:marginalia-source-end: 11562
+:marginalia-source-beg: 11570
+:marginalia-source-end: 11581
:END:
[[file:~/local-repos/org-marginalia/org-marginalia.el][org-marginalia]]
Do not add the =evaporate t= property for the highlight's overlay. By
remaining in the buffer, =undo= puts overlays in their original location when
text regions get killed and subsequently the kill gets undone.
Using overlays instead of text-properties has an advantage of easy composition
of faces; e.g. when marking on a comment line in =emacs-lisp-mode=, the
highlighters face won't be composed onto the underlying syntax face for
comments. Overlay can make it easy to add an additional face to comments and
other syntactically font-locked regions.
+** (make-overlay beg end nil 'FRONT-ADVANCE)
+:PROPERTIES:
+:marginalia-id: 3ec6b5e6
+:marginalia-source-beg: 11520
+:marginalia-source-end: 11561
+:END:
+[[file:~/local-repos/org-marginalia/org-marginalia.el][org-marginalia]]
+
+It's more intuitive if editing the text both on the beg and end points of the
highlight overlay does not extend it. Pass FRONT-ADVANCE; keep REAR-ADVANCE as
default.
+
+#+ref: Manual (elisp)Manging Overlays
+#+begin_quote
+ The arguments FRONT-ADVANCE and REAR-ADVANCE specify the marker
+ insertion type for the start of the overlay and for the end of the
+ overlay, respectively. *Note Marker Insertion Types::. If they
+ are both ‘nil’, the default, then the overlay extends to include
+ any text inserted at the beginning, but not text inserted at the
+ end. If FRONT-ADVANCE is non-‘nil’, text inserted at the beginning
+ of the overlay is excluded from the overlay. If REAR-ADVANCE is
+ non-‘nil’, text inserted at the end of the overlay is included in
+ the overlay.
+#+end_quote
+
* Local Variables
# Local Variables:
diff --git a/org-marginalia.el b/org-marginalia.el
index 8e03cf606c..5351715115 100644
--- a/org-marginalia.el
+++ b/org-marginalia.el
@@ -4,8 +4,8 @@
;; Author: Noboru Ota <me@nobiot.com>
;; URL: https://github.com/nobiot/org-marginalia
-;; Version: 0.0.5
-;; Last Modified: 2021-01-05
+;; Version: 0.0.6
+;; Last Modified: 2021-08-17
;; Package-Requires: ((emacs "27.1") (org "9.4"))
;; Keywords: org-mode, annotation, writing, note-taking, margin-notes
@@ -287,7 +287,7 @@ and `org-marginalia-prev'."
(when (not id) (setq id (substring (org-id-uuid) 0 8)))
;; Add highlight to the text
(org-with-wide-buffer
- (let ((ov (make-overlay beg end)))
+ (let ((ov (make-overlay beg end nil 'FRONT-ADVANCE)))
(overlay-put ov 'face 'org-marginalia-highlighter)
(overlay-put ov 'org-marginalia-id id)
;; Keep track in a local variable It's a list overlays, guranteed to
- [elpa] externals/org-remark e27e0d6dad 023/173: feat: Add om/toggle for show/hide highlighters, (continued)
- [elpa] externals/org-remark e27e0d6dad 023/173: feat: Add om/toggle for show/hide highlighters, ELPA Syncer, 2022/01/28
- [elpa] externals/org-remark bfeffae259 027/173: doc: Minor update, ELPA Syncer, 2022/01/28
- [elpa] externals/org-remark 6be3fc988b 039/173: doc: Minor update, ELPA Syncer, 2022/01/28
- [elpa] externals/org-remark 3c270b4e28 025/173: doc: Update readme with a title screen, ELPA Syncer, 2022/01/28
- [elpa] externals/org-remark 3af3a47e1b 047/173: feat: Add transient navigation to next/prev, ELPA Syncer, 2022/01/28
- [elpa] externals/org-remark d8908d6aba 054/173: doc: fix code example in README, ELPA Syncer, 2022/01/28
- [elpa] externals/org-remark f9c313342c 067/173: chg: separate global-tracking.el, ELPA Syncer, 2022/01/28
- [elpa] externals/org-remark a42ca0f756 066/173: readme for marginalia, ELPA Syncer, 2022/01/28
- [elpa] externals/org-remark e78f549267 069/173: intrnl: housekeep to save; refactor remove, ELPA Syncer, 2022/01/28
- [elpa] externals/org-remark 7176e9d460 073/173: add: ID inherits. fix: housekeep, ELPA Syncer, 2022/01/28
- [elpa] externals/org-remark 9bb66a742e 074/173: fix: overlay front-advance,
ELPA Syncer <=
- [elpa] externals/org-remark 2ed345c66c 071/173: rm: create-id option, ELPA Syncer, 2022/01/28
- [elpa] externals/org-remark b6e6a55f63 075/173: chg: customization notes-file-path type to file, ELPA Syncer, 2022/01/28
- [elpa] externals/org-remark ca0c0ac674 080/173: doc: global-tracking docstring, ELPA Syncer, 2022/01/28
- [elpa] externals/org-remark 12e0b631eb 076/173: lint: shorten longer than 80 char, ELPA Syncer, 2022/01/28
- [elpa] externals/org-remark 9d63088869 086/173: docs: README, ELPA Syncer, 2022/01/28
- [elpa] externals/org-remark ad93331bf7 089/173: doc: update README with comment on autoload, ELPA Syncer, 2022/01/28
- [elpa] externals/org-remark 75698160aa 098/173: fix: for name change, ELPA Syncer, 2022/01/28
- [elpa] externals/org-remark c946340b50 096/173: intrnl: refactor & docstrings, ELPA Syncer, 2022/01/28
- [elpa] externals/org-remark 92d3b17bf3 099/173: change name org-hana to org-remark, ELPA Syncer, 2022/01/28
- [elpa] externals/org-remark 9fd5ef5b74 105/173: doc: NOTICE on name change proposal, ELPA Syncer, 2022/01/28