Skip to content

Commit

Permalink
refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
nobiot committed Nov 3, 2024
1 parent 7400378 commit 3e040ff
Showing 1 changed file with 9 additions and 12 deletions.
21 changes: 9 additions & 12 deletions org-remark.el
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

;; Author: Noboru Ota <me@nobiot.com>
;; Created: 22 December 2020
;; Last modified: 02 November 2024
;; Last modified: 03 November 2024

;; URL: https://github.com/nobiot/org-remark
;; Keywords: org-mode, annotation, note-taking, marginal-notes, wp,
Expand Down Expand Up @@ -830,7 +830,8 @@ Return nil if not and outputs a message in the echo."
(org-remark-find-prev-highlight))))
(if p (progn
(goto-char p)
(org-remark--reveal-context)
(when (and org-remark-reveal-p (org-invisible-p (point))
(org-remark--reveal-context)))
;; Setup the overriding keymap.
(unless overriding-terminal-local-map
(let ((prefix-keys (substring (this-single-command-keys) 0 -1))
Expand All @@ -844,16 +845,12 @@ Return nil if not and outputs a message in the echo."
nil))))

(defun org-remark--reveal-context ()
(cond
((and (derived-mode-p 'org)
(org-invisible-p (point)))
(org-fold-show-context 'link-search))
((pcase-let*
((`(,fn . ,ov) (get-char-property-and-overlay
(point)
'isearch-open-invisible))
(_ (functionp fn)))
(funcall fn ov)))))
(pcase-let
((`(,fn . ,ov)
(get-char-property-and-overlay (point) 'isearch-open-invisible)))
(cond ((and (functionp fn) ov) (funcall fn ov))
((and (derived-mode-p 'org-mode))
(org-fold-show-context 'link-search)))))

(defun org-remark-find-next-highlight ()
"Return the beg point of the next highlight.
Expand Down

0 comments on commit 3e040ff

Please sign in to comment.