Skip to content

Commit

Permalink
fix: org-remark-link gets wrongly referenced #83
Browse files Browse the repository at this point in the history
  • Loading branch information
nobiot committed Oct 25, 2024
1 parent 76e5e85 commit 3c407fb
Showing 1 changed file with 20 additions and 19 deletions.
39 changes: 20 additions & 19 deletions org-remark.el
Original file line number Diff line number Diff line change
Expand Up @@ -1206,25 +1206,26 @@ beginning of source-headline, which should be one level up."
;; Add org-remark-link with updated line-num as a property
(let (title beg end props id text filename link orgid org-remark-type other-props)
(with-current-buffer source-buf
(setq title (org-remark-highlight-get-title)
beg (overlay-start highlight)
end (overlay-end highlight)
props (overlay-properties highlight)
id (plist-get props 'org-remark-id)
org-remark-type (overlay-get highlight 'org-remark-type)
text (org-with-wide-buffer
(org-remark-highlight-headline-text highlight org-remark-type))
filename (org-remark-source-get-file-name
(org-remark-source-find-file-name))
link (run-hook-with-args-until-success
'org-remark-highlight-link-to-source-functions filename beg)
orgid (org-remark-highlight-get-org-id beg)
other-props (org-remark-highlight-collect-other-props highlight))
;; TODO ugly to add the beg end after setq above
(plist-put props org-remark-prop-source-beg (number-to-string beg))
(plist-put props org-remark-prop-source-end (number-to-string end))
(when link (plist-put props "org-remark-link" link))
(when other-props (setq props (append props other-props))))
(org-with-wide-buffer
(setq title (org-remark-highlight-get-title)
beg (overlay-start highlight)
end (overlay-end highlight)
props (overlay-properties highlight)
id (plist-get props 'org-remark-id)
org-remark-type (overlay-get highlight 'org-remark-type)
text (org-with-wide-buffer
(org-remark-highlight-headline-text highlight org-remark-type))
filename (org-remark-source-get-file-name
(org-remark-source-find-file-name))
link (run-hook-with-args-until-success
'org-remark-highlight-link-to-source-functions filename beg)
orgid (org-remark-highlight-get-org-id beg)
other-props (org-remark-highlight-collect-other-props highlight))
;; TODO ugly to add the beg end after setq above
(plist-put props org-remark-prop-source-beg (number-to-string beg))
(plist-put props org-remark-prop-source-end (number-to-string end))
(when link (plist-put props "org-remark-link" link))
(when other-props (setq props (append props other-props)))))
;;; Make it explicit that we are now in the notes-buf, though it is
;;; functionally redundant.
(with-current-buffer notes-buf
Expand Down

0 comments on commit 3c407fb

Please sign in to comment.