[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/org-remark c03ce7b590 123/173: fix: save and line-num f
From: |
ELPA Syncer |
Subject: |
[elpa] externals/org-remark c03ce7b590 123/173: fix: save and line-num for ID. |
Date: |
Fri, 28 Jan 2022 16:58:07 -0500 (EST) |
branch: externals/org-remark
commit c03ce7b5901ce8f36279c374eefe548eaa9a9944
Author: Noboru Ota <me@nobiot.com>
Commit: Noboru Ota <me@nobiot.com>
fix: save and line-num for ID.
---
org-remark.el | 44 +++++++++++++++++++++++---------------------
1 file changed, 23 insertions(+), 21 deletions(-)
diff --git a/org-remark.el b/org-remark.el
index 029cb62fe7..797e6a90e6 100644
--- a/org-remark.el
+++ b/org-remark.el
@@ -322,15 +322,15 @@ in the current buffer. Each highlight is represented by
an overlay."
(interactive)
(org-remark-housekeep)
(org-remark-highlights-sort)
- (dolist (h org-remark-highlights)
- (let ((beg (overlay-start h))
- (end (overlay-end h))
- (props (overlay-properties h)))
- (org-remark-single-highlight-save beg end props)))
- ;; Tracking
- (when org-remark-global-tracking-mode
- (add-to-list 'org-remark-files-tracked
- (abbreviate-file-name (buffer-file-name)))))
+ (let ((path (abbreviate-file-name (buffer-file-name))))
+ (dolist (h org-remark-highlights)
+ (let ((beg (overlay-start h))
+ (end (overlay-end h))
+ (props (overlay-properties h)))
+ (org-remark-single-highlight-save path beg end props)))
+ ;; Tracking
+ (when org-remark-global-tracking-mode
+ (add-to-list 'org-remark-files-tracked path))))
(defun org-remark-next ()
"Move to the next highlight, if any.
@@ -643,9 +643,10 @@ passed. If so, no new ID gets generated."
;; Adding overlay to the buffer does not set the buffer modified. You
;; cannot use `undo' to undo highlights, either.
(unless load-only
- (org-remark-single-highlight-save beg end (overlay-properties ov)
-
(org-remark-single-highlight-get-title)
- (abbreviate-file-name
(buffer-file-name))))
+ (org-remark-single-highlight-save (abbreviate-file-name
(buffer-file-name))
+ beg end
+ (overlay-properties ov)
+
(org-remark-single-highlight-get-title)))
(deactivate-mark)))
(org-remark-housekeep)
(org-remark-highlights-sort))
@@ -664,7 +665,7 @@ 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-single-highlight-save (beg end props &optional title path)
+(defun org-remark-single-highlight-save (path beg end props &optional title)
"Save a single HIGHLIGHT in the marginal notes file.
The marginal notes file is specified by PATH.
@@ -704,8 +705,7 @@ packages such as Org-roam's backlink feature."
(text (org-with-wide-buffer (buffer-substring-no-properties beg end)))
(orgid (org-remark-single-highlight-get-org-id beg))
;; FIXME current-line - it's not always at point
- (line-num (unless (and orgid org-remark-use-org-id)
- (org-current-line beg))))
+ (line-num (org-current-line beg)))
;; TODO Want to add a check if save is applicable here.
(with-current-buffer (find-file-noselect org-remark-notes-file-path)
;; If it is a new empty marginalia file
@@ -724,6 +724,12 @@ packages such as Org-roam's backlink feature."
(org-set-property
org-remark-prop-source-file path)
(org-up-heading-safe) (point))))
(id-headline (org-find-property org-remark-prop-id id)))
+ ;; Add org-remark-link with updated line-num as a property
+ (plist-put props "org-remark-link" (concat
+ "[[file:"
+ path
+ (when line-num (format "::%d"
line-num))
+ "]]"))
(if id-headline
(progn
(goto-char id-headline)
@@ -744,12 +750,8 @@ packages such as Org-roam's backlink feature."
;; Add a properties
(insert (concat "** " text "\n"))
(org-remark-notes-set-properties beg end props)
- ;; FIXME lin-num only gets creatd and never updated
- (if (and orgid org-remark-use-org-id)
- (insert (concat "[[id:" orgid "]" "[" title "]]"))
- (insert (concat "[[file:" path
- (when line-num (format "::%d" line-num))
- "][" title "]]"))))))
+ (when (and orgid org-remark-use-org-id)
+ (insert (concat "[[id:" orgid "]" "[" title "]]"))))))
(when (buffer-modified-p) (save-buffer))
t)))
- [elpa] externals/org-remark b6e6a55f63 075/173: chg: customization notes-file-path type to file, (continued)
- [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
- [elpa] externals/org-remark 3bb5f40e59 121/173: intrnl: refactor. mark saves; load only loads with no save, ELPA Syncer, 2022/01/28
- [elpa] externals/org-remark c03ce7b590 123/173: fix: save and line-num for ID.,
ELPA Syncer <=
- [elpa] externals/org-remark d07f158dfe 125/173: add:refactor: org-remark-source-path, org-remark-notes-track-file, ELPA Syncer, 2022/01/28
- [elpa] externals/org-remark 1b2482cf7c 133/173: fix:org-remark-mark API; refactor org-remark-load, ELPA Syncer, 2022/01/28
- [elpa] externals/org-remark 76e5a4f915 136/173: docs: WIP, ELPA Syncer, 2022/01/28
- [elpa] externals/org-remark 6aaba8acdb 142/173: docs: resolving custom_id link, ELPA Syncer, 2022/01/28
- [elpa] externals/org-remark 2e14b95d65 147/173: feat: minor-mode menu & mouse context-menu (>= Emacs 28), ELPA Syncer, 2022/01/28
- [elpa] externals/org-remark d9e305837b 149/173: docs: README update for ascii output used by ELPA, ELPA Syncer, 2022/01/28
- [elpa] externals/org-remark 2b4692abbf 150/173: docs: NEWS for v0.1.0, ELPA Syncer, 2022/01/28
- [elpa] externals/org-remark 41b0997c3f 151/173: fix: remove/delete remove only one highlihgt at a time, ELPA Syncer, 2022/01/28
- [elpa] externals/org-remark 84d50976df 156/173: chg: Menu label from "Remark" to "Org-remark", ELPA Syncer, 2022/01/28
- [elpa] externals/org-remark 697a990a34 158/173: revert f6c3f36 The screen jerking was not OS or version; setup issue, ELPA Syncer, 2022/01/28