rudolfochrist / interleave

Emacs minor mode to interleave notes and text books

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Navigation in multi pdf notes file.

hitswint opened this issue · comments

commented

Great package, i like it so much.
One thing that bothers me is the navigation in multi pdf notes file. When i invoke interleave-go-to-next-page on the first pdf note, if there is also some note on that next page on the second pdf note, then interleave will take me to the second pdf note directly and cannot go back. This happens on all commands related to navigation. I have modified interleave--go-to-page-note to fix the problem, but more work needs to be done on other commands.

(defun interleave--go-to-page-note (page)
    "Searches the notes buffer for an headline with the `interleave_page_note'
property set to PAGE. It narrows the subtree when found."
    (with-current-buffer *interleave--org-buffer*
      (save-excursion
        (widen)
        (interleave--goto-search-position)
        (if *interleave--multi-pdf-notes-file*
            (org-narrow-to-subtree))
        (when (re-search-forward (format "^\[ \t\r\]*\:interleave_page_note\: %s$"
                                         page)
                                 nil t)
          (org-narrow-to-subtree)
          (org-show-entry)
          t))))

Oh yes. You're absolutely right. Thank you for spotting this. I will add this if I find the time.

@hitswint

Can you please post an example of how you structure the org file for notes from multiple PDF files?

Here's an example of single PDF notes:

#+INTERLEAVE_PDF: /path/to/file.pdf

* Notes for page 1
:PROPERTIES:
:interleave_page_note: 1
:END:
foo
* Notes for page 2
:PROPERTIES:
:interleave_page_note: 2
:END:
bar

@kaushalmodi
You can move the interleave_pdf to the heading properties like so:

* Notes about Awesome Stuff
:PROPERTIES:
:INTERLEAVE_PDF: /path/to/awesome_stuff.pdf
:END:

** Notes for page 1
:PROPERTIES:
:interleave_page_note: 1
:END:
foo

** Notes for page 2
:PROPERTIES:
:interleave_page_note: 2
:END:
bar

* Lecture Notes
:PROPERTIES:
:INTERLEAVE_PDF: /path/to/lecture.pdf
:END:

** Notes for page 1
:PROPERTIES:
:interleave_page_note: 1
:END:
baz

** Notes for page 2
:PROPERTIES:
:interleave_page_note: 2
:END:
quux

Note that the multiple pdf feature cannot be used with normal notes (one org file per PDF) simultaneously.