Skip to content
This repository has been archived by the owner on Apr 20, 2022. It is now read-only.

Commit

Permalink
Fixed interleave--sync-pdf-page to avoid slipping.
Browse files Browse the repository at this point in the history
  • Loading branch information
hitswint committed Jun 28, 2016
1 parent 425d8e5 commit 26ac5d9
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions interleave.el
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,8 @@ the current narrowed down notes view."
(interleave--switch-to-org-buffer)
(let ((pdf-page))
(save-excursion
(when *interleave--multi-pdf-notes-file*
(interleave--goto-search-position))
(org-narrow-to-subtree)
(goto-char (point-min))
(re-search-forward "^ *:interleave_page_note: *\\(.*\\)")
Expand All @@ -295,9 +297,14 @@ previous set of notes."
(interleave--switch-to-org-buffer)
(let ((pdf-page))
(save-excursion
(when *interleave--multi-pdf-notes-file*
(interleave--goto-search-position))
(org-narrow-to-subtree)
(goto-char (point-min))
(widen)
(when *interleave--multi-pdf-notes-file*
(save-excursion (interleave--goto-search-position)
(org-narrow-to-subtree)))
(when (re-search-backward "^ *:interleave_page_note: *\\(.*\\)" nil :noerror)
(setq pdf-page (string-to-number (match-string 1)))))
(if pdf-page
Expand All @@ -314,10 +321,15 @@ next set of notes."
(interleave--switch-to-org-buffer)
(let ((pdf-page))
(save-excursion
(when *interleave--multi-pdf-notes-file*
(interleave--goto-search-position))
(org-narrow-to-subtree)
(goto-char (point-min))
(re-search-forward "^ *:interleave_page_note:") ; current page
(widen)
(when *interleave--multi-pdf-notes-file*
(save-excursion (interleave--goto-search-position)
(org-narrow-to-subtree)))
(when (re-search-forward "^ *:interleave_page_note: *\\(.*\\)" nil :noerror) ; next page
(setq pdf-page (string-to-number (match-string 1)))))
(if pdf-page
Expand Down

0 comments on commit 26ac5d9

Please sign in to comment.