Giter Club home page Giter Club logo

interleave's Introduction

http://melpa.org/packages/interleave-badge.svg https://travis-ci.org/rudolfochrist/interleave.svg?branch=master

IMPORTANT

This package is not maintained anymore. User should go and checkout weirdNox/org-noter as an alternative.

Interleaved Textbooks?

Some history, what this is all about…

In the past, textbooks were sometimes published as interleaved editions. That meant, each page was followed by a blank page and ambitious students/scholars had the ability to take their notes directly in their copy of the textbook. Newton and Kant were prominent representatives of this technique [fn:blumbach].

Nowadays textbooks (or lecture material) come in PDF format. Although almost every PDF Reader has the ability to add some notes to the PDF itself, it is not as powerful as it could be. This is what this Emacs minor mode tries to accomplish. It presents your PDF side by side to an Org Mode buffer with you notes. Narrowing down to just those passages that are relevant to this particular page in the document viewer.

In a later step it should be possible to create truly interleaved PDFs of your notes.

Installation

Add MELPA to your package archives in your init file

(package-initialize)
(add-to-list 'package-archives
             '("melpa" . "http://melpa.org/packages/") t)

Then install interleave-mode with

M-x package-install RET interleave RET

Usage

Create a Org file that will keep your notes. In the Org header section (#+TITLE, #+AUTHOR, etc.) add

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

Then you can start interleave by typing

M-x interleave-mode

This will display the PDF side by side to the org buffer for your notes. You can navigate the PDF as usual with n and p. Changing the page of the PDF will also narrow to the notes that are meant for this particular PDF page.

The split direction is determined by the customizable variable interleave-split-direction. When interleave-mode is invoked with a prefix argument the inverse split direction is used e.g. if interleave-split-direction is set to vertical the buffer is split horizontally.

If you want to add some notes to the current page you can type i. This will create a new headline for your notes. If some notes are already present, i will switch over to the other buffer.

Typing q in the DocView will quit interleave-mode.

To customize Interleave you can use the customization interface with

M-x customize-group RET interleave 

Multi-PDF Notes

Normally the notes/PDF relation is bidirectional. This means for every PDF there is one notes file. But it is also possible to keep a single notes file for multiple PDFs.

To keep a multi-PDF notes file create a headline for each PDF and set the INTERLEAVE_PDF property on it.

* Notes for CS103
  :PROPERTIES:
  :INTERLEAVE_PDF: cs103.pdf
  :END:

To use interleave-mode on this headline, simply place your point onto the headline an type

M-x interleave-mode RET

to start interleave-mode for this subtree.

Notice that you have to decide. It is not possible to keep multi-PDF and normal notes in the same file.

Idiosyncrasies

Interleave does some automated buffer switching for you, especially at start up. This may affect some hooks (see Issue #40). This means that even when you start interleave-mode in an Org buffer the hooks may be run in the newly established DocView=/=PdfView buffer.

Interleave provides the variables interleave-org-buffer and interleave-pdf-buffer to access either the Org buffer (the buffer with your notes) or the PDF buffer respectively. Please specify the buffer you’d like to use explicitly, like this:

(defun my-interleave-hook ()
  (with-current-buffer interleave-org-buffer
    ;; Do something meaningful here
    (message "Hi there. I'm in the org buffer!")))

(add-hook 'interleave-mode-hook #'my-interleave-hook)

Key-bindings

KeyDescriptionAvailability
nGo to next pagePDF Buffer
pGo to previous pagePDF Buffer
SPCScroll upPDF Buffer
S-SPCScroll downPDF Buffer
DELScroll downPDF Buffer
iInsert new notes/go to notesPDF Buffer
qQuit interleave-modePDF Buffer
M-.Go to page of currently visible notesPDF and Org Buffer
M-pGo to the page of the previous set of notesPDF and Org Buffer
M-nGo to the page of the next set of notesPDF and Org Buffer

Footnotes

[fn:blumbach] For some more information see: http://takingnotenow.blogspot.de/2008/07/note-keeping-in-1786-blumenbachs-system.html

interleave's People

Contributors

furkanusta avatar hitswint avatar iqbalansari avatar jorenvo avatar kaushalmodi avatar nicolaspetton avatar rudolfochrist avatar weirdnox avatar yevgnen avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

interleave's Issues

Allow for selecting vertical window size

Hello,
Thanks again for interleave. It is a very useful tool as part of an environment centred in org-mode to read articles and take notes. I use it quite a bit.

I have a request. Now, when using interleave with a vertical split, the screen is divided into two frames of equal size. I find that in my monitor this gives a pdf too small for comfortable reading. Each time I have to manually re-size the windows (say 3/4 of the screen size for the pdf, and 1/4 for the notes).

The "split-window-righ" function can take an argument to define the size of the windows. Would it be possible to have a variable to pass a value to this argument? Something analogous to the "interleave-split-lines" variable, but for vertical windows?

Many thanks,

Julian

Allow page notes to contain sub-headings

Currently, we cannot have

* Notes for page N
** sub notes N.1
*** sub sub notes N.1.1

because of the use of (org-narrow-to-subtree) in commands like interleave--sync-pdf-page-next and interleave--sync-pdf-page-previous.

Solving #23 should probably fix this issue too.

The obsolete functions are missing autoload cookies.

With the recent deprecation of interleave for interleave-mode etc. there are now many uses of define-obsolete-function-alias but none have an ;;;##autoload preceding them, meaning any users who are not aware of the change and rely on autoloading the package will suddenly find things do not work as expected and have no idea how to fix it. Autoload cookies should be placed as appropriate and then users will be given a message similar to

‘interleave’ is an obsolete command (as of 1.3); use ‘interleave-mode’ instead.

when invoking interleave automatically.

Add unmaintained note to interleave.el "Commentary" section

As I was looking into using either this or org-noter, it would have been helpful to know this package is currently unmaintained. May I suggest to perhaps a note to this effect to the "Commentary" section so this is visible from within Emacs itself (i.e. M-x list-packages)?

Thanks for the package.

Interleave in second level headlines in multi-PDF notes

Hello,
It seems that in multi-PDF notes files interleave only works if the :INTERLEAVE_PDF: property is set in a first-level headline. Would it be possible to make it work also in second-level headlines? The reason is that I use first-level headlines in my notes file to organize my notes, and the notes in each paper go in the second level. Something like this:

  • Papers in Some topic
    ** Smith2009
    :PROPERTIES:
    :Custom_ID: Smith2009
    :INTERLEAVE_PDF: /path/to/my/pdfs/Smith2009.pdf
    :END:
    ** Jones2010
    :PROPERTIES:
    :Custom_ID: Jones2010
    :INTERLEAVE_PDF: /path/to/my/pdfs/Jones2010.pdf
    :END:

... etc.

Many thanks!

Disable narrowing is not working

I am not sure since when, but the disable narrowing option is not working. The notes buffer gets narrowed, despite having the following .emacs setting:

(use-package interleave
:defer t
:bind ("C-x i" . interleave-mode)
:config
(setq interleave-split-direction (quote horizontal)
interleave-split-lines 20
interleave-disable-narrowing t)
)

I have the latest version from MELPA (20170110.234)

allow per-headline interleave pdf file association?

Hi! Interleave looks really cool. I keep all my notes in a single org-mode file. How hard would it be to allow INTERLEAVE_PDF to be set as a headline property, with page notes kept in subheadings? Does this seem possible?
Many Thanks!

Multi-pdf notes but in at any headline level

Hello,

Thanks for this nice tool. I was wondering if it is possible to use interleave in a lower level headlines as well?
Instead of launching M-x interleave at the Top level headline

  • Notes for CS103
    :PROPERTIES:
    :INTERLEAVE_PDF: cs103.pdf
    :END:

I would like to do

**** Notes for CS103
:PROPERTIES:
:INTERLEAVE_PDF: cs103.pdf
:END:

I'm not very good at lisp programing but your code is very clear. I suspect that the issue is in the following function

(defun interleave--headline-pdf-path (buffer) "Return the INTERLEAVE_PDF property of the current headline in BUFFER." (with-current-buffer buffer (save-excursion (let ((headline (org-element-at-point))) (when (and (equal (org-element-type headline) 'headline) (org-entry-get nil interleave--pdf-prop)) (setq interleave-multi-pdf-notes-file t) (org-entry-get nil interleave--pdf-prop))))))

But I cannot figure out why it does not work in the sub headlines.

Best regards

Suggestion: Make interleave compatible with subheadings

Hey there!
I would love to see a better compatibility with the outline capabilities of org-mode, i.e. be able to take notes as sub-, subsub-, etc. headings. Lets assume we have a pdf structured as following:

1. Heading
some text
--pagebreak--
1.1 Subheading
more text
--pagebreak--
2. Another heading
and even more text

Then I would like to format the org-file with the notes as following:

* Heading (interleaved w/ p. 1)
  notes
** Subheading (interleaved w/ p. 2)
    notes
* Another heading (interleaved w/ p. 3)
  notes

If I format the headings file like that, there are two issues:

  1. M-p and M-n don't switch properly between Headings and Subheadings, one "gets stuck on the lower level".
  2. New notes are not stored in the proper place in between existing ones but appended at the end of the org-file.

Greetings and thanks for the otherwise great package :)
Tobias

Subtree is not correctly displayed when interleave-disable-narrowing is set to t

When interleave-disable-narrowing is set to t, the heading goes a bit strange when using p and n for paging in the pdf buffer.

Reproducing: Open the org file here with the minimal emacs config

(package-initialize)
(require 'org)
(require 'interleave)
(setq interleave-disable-narrowing t)

Save the pdf file to the path specified by the first heading. M-x interleave-mode in the org buffer at the first level heading 2014 - Word2vec Explained: Deriving Mikolov Et Al.’s Negative-Sampling Word-Embedding Method, then the window is switched to the pdf buffer. Use p and n to navigate, and the org subtree is expanded with strange display.

screen shot 2016-12-13 at 6 15 47 pm

screen shot 2016-12-13 at 6 15 53 pm

As we can see, the level 2 heading ** Notes for page 2 went to the first line.

screen shot 2016-12-13 at 6 16 20 pm

If quit interleave-mode, and use org-narrow-to-subtree to narrow to subtree, everything goes fine.

Emacs version: GNU Emacs 25.1.1 (x86_64-apple-darwin16.1.0, Carbon Version 157 AppKit 1504.6) of 2016-12-12

Org version: Org mode version 9.0.1 (9.0.1-elpa @ /Users/user/.emacs.d/elpa/org-20161118/)

Allow other kind of headings

Since I use org-ref to handle my references, sometimes it may necessary to insert bibliography into notes. I use a individual heading to keep these thing but it seems that interleave does not allow any other headings which doesn't have property :interleave_page_note. Thus this alerts an error when quitting in docview as

Debugger entered--Lisp error: (wrong-type-argument stringp nil)
  string-to-number(nil)
  #[nil "\300\301\302\303\"!\206\n�\304\207" [string-to-number org-entry-get nil "interleave_page_note" -1] 4]()
  #[0 "\305\307U\203��\310�-!\205D�\311\312\313\314!!!\207\305\315U\203*�\310�-!\205D�\303\312\313\314!!!\207\305\316U\2039�\317`\320\"\206D�\321\207\305\322U\203c�\212\323 \210`)\324�.�\325#\204W�\324�/�\325#\203_�\326\313\321!!\202b�\327\306!\207\305\330U\203\207�\212\323 \210`)\324\331�0\332Q�\325#\203\203�\326\313\321!!\202\206�\327\306!\207\305\333U\203\250�\212\323 \210`)\324�1�\325#\203\244�\326\313\334!!\202\247�\327\306!\207\305\335U\203\311�\212\323 \210`)\324�2�\325#\203\305�\326\313\334!!\202\310�\327\306!\207\305\336U\203\342�\324�3\337 \325#\203\337�\340\313\341!!\207�4\207\305\342U\203\362�\343\344\302\242\"\206D�\345\207\305\346U\203��\310�-!\205D�\313\341!\211�5\235\203
�\347\202��\350\330���6\235G!Z\207\305\351U\203?�\301\242\2039�\304\301\242 \240\210\304\242;\2036�\304\303\304\242!\240\210\304\242\207\352\353\301\242\"\207\352\354\300\242\"\207" [(102) (#[nil "\300\301\302\303\"!\206\n�\304\207" [string-to-number org-entry-get nil "interleave_page_note" -1] 4]) (nil) downcase (1) 102 (22604 64124 425733 0) 110 looking-at string-to-number org-sort-remove-invisible match-string 4 97 107 get-text-property :org-clock-minutes 0 116 outline-next-heading re-search-forward t org-time-string-to-seconds float-time 99 "^[ 	]*\\[" "\\]" 115 1 100 112 point-at-eol string-to-char 2 114 org-entry-get nil "" 111 - + 102 error "Invalid key function `%s'" "Invalid sorting type `%c'" org-complex-heading-regexp org-ts-regexp org-ts-regexp-both org-ts-regexp1 org-scheduled-time-regexp ...] 6]()
  sort-build-lists(#[0 "\301\300\242\302\303#\203
�\304\224b\207db\207" [("^\\* +") re-search-forward nil t 0] 4] #[0 "\300 \301\302\303\304\305�!\306\"\307$\216\3101��\311\312!0\202��\210db)\207" [match-data make-byte-code 0 "\301\300\302\"\207" vconcat vector [set-match-data evaporate] 3 (error) outline-forward-same-level 1] 7] #[0 "\305\307U\203��\310�-!\205D�\311\312\313\314!!!\207\305\315U\203*�\310�-!\205D�\303\312\313\314!!!\207\305\316U\2039�\317`\320\"\206D�\321\207\305\322U\203c�\212\323 \210`)\324�.�\325#\204W�\324�/�\325#\203_�\326\313\321!!\202b�\327\306!\207\305\330U\203\207�\212\323 \210`)\324\331�0\332Q�\325#\203\203�\326\313\321!!\202\206�\327\306!\207\305\333U\203\250�\212\323 \210`)\324�1�\325#\203\244�\326\313\334!!\202\247�\327\306!\207\305\335U\203\311�\212\323 \210`)\324�2�\325#\203\305�\326\313\334!!\202\310�\327\306!\207\305\336U\203\342�\324�3\337 \325#\203\337�\340\313\341!!\207�4\207\305\342U\203\362�\343\344\302\242\"\206D�\345\207\305\346U\203��\310�-!\205D�\313\341!\211�5\235\203
�\347\202��\350\330���6\235G!Z\207\305\351U\203?�\301\242\2039�\304\301\242 \240\210\304\242;\2036�\304\303\304\242!\240\210\304\242\207\352\353\301\242\"\207\352\354\300\242\"\207" [(102) (#[nil "\300\301\302\303\"!\206\n�\304\207" [string-to-number org-entry-get nil "interleave_page_note" -1] 4]) (nil) downcase (1) 102 (22604 64124 425733 0) 110 looking-at string-to-number org-sort-remove-invisible match-string 4 97 107 get-text-property :org-clock-minutes 0 116 outline-next-heading re-search-forward t org-time-string-to-seconds float-time 99 "^[ 	]*\\[" "\\]" 115 1 100 112 point-at-eol string-to-char 2 114 org-entry-get nil "" 111 - + 102 error "Invalid key function `%s'" "Invalid sorting type `%c'" org-complex-heading-regexp org-ts-regexp org-ts-regexp-both org-ts-regexp1 org-scheduled-time-regexp ...] 6] nil)
  sort-subr(nil #[0 "\301\300\242\302\303#\203
�\304\224b\207db\207" [("^\\* +") re-search-forward nil t 0] 4] #[0 "\300 \301\302\303\304\305�!\306\"\307$\216\3101��\311\312!0\202��\210db)\207" [match-data make-byte-code 0 "\301\300\302\"\207" vconcat vector [set-match-data evaporate] 3 (error) outline-forward-same-level 1] 7] #[0 "\305\307U\203��\310�-!\205D�\311\312\313\314!!!\207\305\315U\203*�\310�-!\205D�\303\312\313\314!!!\207\305\316U\2039�\317`\320\"\206D�\321\207\305\322U\203c�\212\323 \210`)\324�.�\325#\204W�\324�/�\325#\203_�\326\313\321!!\202b�\327\306!\207\305\330U\203\207�\212\323 \210`)\324\331�0\332Q�\325#\203\203�\326\313\321!!\202\206�\327\306!\207\305\333U\203\250�\212\323 \210`)\324�1�\325#\203\244�\326\313\334!!\202\247�\327\306!\207\305\335U\203\311�\212\323 \210`)\324�2�\325#\203\305�\326\313\334!!\202\310�\327\306!\207\305\336U\203\342�\324�3\337 \325#\203\337�\340\313\341!!\207�4\207\305\342U\203\362�\343\344\302\242\"\206D�\345\207\305\346U\203��\310�-!\205D�\313\341!\211�5\235\203
�\347\202��\350\330���6\235G!Z\207\305\351U\203?�\301\242\2039�\304\301\242 \240\210\304\242;\2036�\304\303\304\242!\240\210\304\242\207\352\353\301\242\"\207\352\354\300\242\"\207" [(102) (#[nil "\300\301\302\303\"!\206\n�\304\207" [string-to-number org-entry-get nil "interleave_page_note" -1] 4]) (nil) downcase (1) 102 (22604 64124 425733 0) 110 looking-at string-to-number org-sort-remove-invisible match-string 4 97 107 get-text-property :org-clock-minutes 0 116 outline-next-heading re-search-forward t org-time-string-to-seconds float-time 99 "^[ 	]*\\[" "\\]" 115 1 100 112 point-at-eol string-to-char 2 114 org-entry-get nil "" 111 - + 102 error "Invalid key function `%s'" "Invalid sorting type `%c'" org-complex-heading-regexp org-ts-regexp org-ts-regexp-both org-ts-regexp1 org-scheduled-time-regexp ...] 6] nil <)
  org-sort-entries(nil 102 #[nil "\300\301\302\303\"!\206\n�\304\207" [string-to-number org-entry-get nil "interleave_page_note" -1] 4] <)
  interleave--sort-notes(asc)
  interleave-quit()
  funcall-interactively(interleave-quit)
  call-interactively(interleave-quit nil nil)
  command-execute(interleave-quit)

One workaround is to manually add a :interleave_page_note for any other headings for a suitable value(in the reference case, a large one). What would the best workflow to do this ? Thanks !

pdf-view-new-window-function: Wrong type argument: number-or-marker-p, (("91")

Hi I'm trying to install pdf-tools again from the ground.
And here's my configuration.


  (use-package pdf-tools
      :pin manual ;; manually update
      ;;:ensure t
      :config
      ;; initialise
      (pdf-tools-install)
      (setq pdf-info-epdfinfo-program "~/.emacs.d/elpa/pdf-tools-20180109.1234/epdfinfo")
      ;; open pdfs scaled to fit page
      (setq-default pdf-view-display-size 'fit-page)
      ;; automatically annotate highlights
      (setq pdf-annot-activate-created-annotation t)
      ;; use normal isearch ??? necessary to test or  improve by using evil search!!!
      (define-key pdf-view-mode-map (kbd "C-s") 'isearch-forward)
  )
  
  (add-hook 'pdf-view-mode-hook
	    (lambda ()
	      (linum-mode -1)
	      (beacon-mode nil) ;; to prevent blinking on entering this mode??? stil not sure this is corrent or incorrect
	      ))

But unfortunately it shows this chaotic result

%PDF-1.3
%����
14792 0 obj
<< 
/Linearized 1 
/O 14800 
/H [ 2456 3591 ] 
/L 2316604 
/E 73280 
/N 91 
/T 2020643 
>> 
endobj
                                              xref
14792 71 
0000000016 00000 n
0000001799 00000 n
0000002011 00000 n
0000002155 00000 n
0000002215 00000 n
0000002250 00000 n
0000002308 00000 n
0000002411 00000 n
...
0000035300 00000 n
0000048624 00000 n
0000071848 00000 n
0000071874 00000 n
0000072302 00000 n
0000072988 00000 n
0000002456 00000 n
0000006022 00000 n
trailer
<<
/Size 14863
/Info 14775 0 R 
/Encrypt 14794 0 R 
/Root 14793 0 R 
/Prev 2020630 
/ID[<2fe5dcbe7261fb84275f0327dad6dd27><2fe5dcbe7261fb84275f0327dad6dd27>]
>>
startxref
0
%%EOF
   
14793 0 obj
<< 
/Type /Catalog 
/Pages 14777 0 R 
/Outlines 14801 0 R 
/Threads 14796 0 R 
/Names 14799 0 R 
/PageMode /UseOutlines 
/PageLayout /OneColumn 
/OpenAction 14795 0 R 
/AcroForm 14798 0 R 
>> 
endobj
14794 0 obj
<< 
/Filter /Standard 
/R 2 
/O (��	I3�J�4��\(�e���T �>`���"�$R���)
/U ([_gJ��^:^\(��H���⛷o��7�$h�Fƛ�)
/P -44 
/V 1 
>> 
endobj
14795 0 obj
<< 
/S /GoTo 
/D [ 14800 0 R /Fit ] 
>> 
endobj
14796 0 obj
[ 
14797 0 R 
]
endobj
14797 0 obj
<< 
/I << /Title (�)>> 
/F 23 0 R 
>> 
endobj
14798 0 obj
<< 
/Fields [ 549 0 R 14838 0 R 14843 0 R ] 
/DR 569 0 R 
/DA (ViO��/ɺ��+���)
>> 
endobj
14799 0 obj
<< 
/Dests 14774 0 R 
>> 
endobj
14861 0 obj
<< /S 3723 /T 4312 /O 4490 /V 4506 /E 4540 /Filter /FlateDecode /Length 14862 0 R >> 
stream
�JW&��W-4a���-�i��@��<����Bb��?���N���p�]����i�)��7�����y�?䢐�<��q�c5��<��5�\0��ڭ�n�.�0�̽�!V���o�8C�/��Ţ�����j�z���lo7������+��T��)F�$����w������r��M
��m��B蝤
�5l��#'@[�p���t�Ha�q�%��!	!L�h�SH<͍��
����0��_j*���m�N��z)�2a.{�2}f�L��cc]��^J���I�$��KK.������2��~��4��ġR������.���ȥ���������]B8�DY�,L��C��]������k7���y"�����g���`�1��[B`������"��:��R�g�L��ׄ��j�k֕��@�J����n��kS:1��@�R����543�^�S�v�N�����I]�Vo�y�h�������֛�]a�|L�2na�"�
��A��:�	q�|�Ux��<V��������m�n"~[��V�F����ێ+����n�}�2�[1�������1�PjaՅ���5"��d*���ph�Cs���E�8@��jd���1������ŭ��S-	X�+��<v+��T�{ǂ���~�(�������&���;�Bȸ�FTH�ͫ��e�& ���8���ڢ����d�P��B9��!��9���z�F6�3���9M���9
�S��t'�DNw�����K����&�b�M��R�^܉:2.�t��knԏ:5` �ҌFP�{es�*���N�"�q�ކ~�L	h؏��r�iN���Igxe��(b�G!�Zz����U�.�x��h;����E����S� �\�
״�T��-��X����E�C�=�j�c��)L6��w�����@�g�Z���	m�����)(���-!���;�$���h���1�q9̶���j������i�����\��h428�����b��ƻ���8����]�Q���K�!*���K)�f9:x����k��k}df��Wd�ŗ�w`�)ʝ�>_:�F���������8?6�Q}���|5�'j�K��DL�\0'�Ò��/���\�Sm��W�w��Z�V����t�J��$]j�i�A#�iR\0S܈��Tnxy�����͙���b�n��6���s�E?l��@F�TA:�,��~kߓ;�F���kRMԈ���������6�����$Dsg�!.���)�����=�(��`������[��e���t�t`=
�ލ��i��\0uQ�����[�)����9҂3\\�|���꥽���& �)����w���nLhg�$��H����8�OY��(��}	���.�^W�\04
��І�lti������5y�R�'�Y�[Y��������7mg�	#w�yc KΉJ<��L�p��0<��c��߸'�t3Y�U'��b����F删��%����Y� �Ӕsa��$@5k�ab����d�>�5����M��3ǜy�ǥ�SA??��a��(N���h��pC�
R����T�_����:��\��6wS��7�?�r�E�����b1;�q��£�j�]%����&^C��Cb�����׏끞Hɨ�>����������
2��e��_�:���Ub���~�*N�V�������XV�V͝�fG���[v_5�&�������+e*-z����x�D�)�B9�8<�%�G���

�13��Dr��N?�4��7^߳�RpE��X��NL�c���p�;�����ҵ���/|ul�|
[��b{ny�f�#�����΢�(Nn���R�@*��g���|K�Z봫���w4�7O���¥�A}�l< ��frg���C
����EkR��:��������ةܰ���?V���o��Q�_�f1��!��7k�qdz��I�.�»H�z�q`��x�%��O&��i���s���e�� ��n_��<R�L?�A���M�.Ϭ������#�� )D�쬀����"��*3v���@6?��$W*@��h�\0v�'!��B�2B���1��IE����[_e���iOV�tʪ�<"W�Z�0�j�XU��B��6=r�&`/FE�S��+��#����aB��1�����H����� �.���e�*�l$S�$�'�/�9�B�uur�]n����p �
t3���Jn��qGOn2Ȼ�.�v'G�wc����4�6�"�&jC��E�����������P��A�I�y������\������_�܏��_�DPТ��/$(�%^#�ߗ��L�	 K�"@b���$�ē���=j���vR�R�ꉥī1��a�V
�"�k�:>󊁃������ T��2�OP�+�c׮P������q�;��أ���h{^���K�_��(�_��j��������L��ء��<��r)����IsG��i�22��;դ�5��Q���¬4�T�n��ۓ����
Al��=;a�	�������d�>Zg��,�Y�u�	�-���]�
C!�f�B"����h�V��D�e��
�;���AU"'h�K�/��&<�$,L��I(�;�4���e��

��hoӒ#8�[�&�N����
��N�K,X��M���Ҥ�+0��Nz�F'_�|�ux�Q���͙\0���b�D���*�V���iu��'\�9P��:|�ۉ�e�o2�	,��(��u��ǠK�Ξ��>|�c�y�f��H�|b��a��Jr�3��R�4d��SR^�W[9��5i�8����OM��0M$�oY�MfH���"l��Ɗ?�[�.J��vK�i��ߴ��b��L����v_�1���?��Q��>�q��|P��ǒ�SJ��s��
Q��2���!���Ce�Q�������,5��W�-!-�,�1����nr b��B�,����C�
�
...

And it also has these messages

File mode specification error: (wrong-type-argument number-or-marker-p ((91)))
pdf-view-new-window-function: Wrong type argument: number-or-marker-p, (("91"))
Wrote /home/cysh/rpt2.txt
evil-line-move: Beginning of buffer [12 times]
Reverting buffer ‘cysh’.
Quit
Reverting buffer ‘cysh’. [2 times]
Quit [4 times]
**File mode specification error: (wrong-type-argument number-or-marker-p ((91)))
pdf-view-new-window-function: Wrong type argument: number-or-marker-p, (("91"))**
Auto-saving...done
Reverting buffer ‘cysh’.
Quit
. is undefined
apply: Buffer is read-only: #<buffer rpt2.txt>
Quit
apply: Buffer is read-only: #<buffer rpt2.txt> [3 times]
Quit
d is undefined [2 times]
. is undefined [3 times]
evil-line-move: Beginning of buffer [4 times]
Quit
evil-line-move: Beginning of buffer
Quit [5 times]
Auto-saving...done
Quit [2 times]
Mark set
Quit [3 times]
**pdf-info-query: epdfinfo: No such page 0**
Loading /home/cysh/.evil/recentf...done
Cleaning up the recentf list...done (0 removed)
Auto-saving...done
Mark saved where search started [2 times]
Quit [4 times]
evil-line-move: Beginning of buffer [3 times]
Auto-saving...done

So I had set a trap right on (pdf-view-new-window-function) and it shows this callstack

Debugger entered--entering a function:
* pdf-view-new-window-function((t))
  run-hook-with-args(pdf-view-new-window-function (t))
  image-mode-winprops(nil)
  image-mode-window-get(page nil)
  pdf-view-mode()
  set-auto-mode-0(pdf-view-mode nil)
  set-auto-mode()
  normal-mode(t)
  after-find-file(nil t)
  find-file-noselect-1(#<buffer 802.11a-1999.pdf> "~/Documents/802.11a-1999.pdf" nil nil "~/Documents/802.11a-1999.pdf" (2101268 2065))
  #f(compiled-function (filename &optional nowarn rawfile wildcards) "Read file FILENAME into a buffer and return the buffer.\nIf a buffer exists visiting FILENAME, return that one, but\nverify that the file has not changed since visited or saved.\nThe buffer is not selected, just returned to the caller.\nOptional second arg NOWARN non-nil means suppress any warning messages.\nOptional third arg RAWFILE non-nil means the file is read literally.\nOptional fourth arg WILDCARDS non-nil means do wildcard processing\nand visit all the matching files.  When wildcards are actually\nused and expanded, return a list of buffers that are visiting\nthe various files." #<bytecode 0x233d53>)("/home/cysh/Documents/802.11a-1999.pdf" nil nil nil)
  ad-Advice-find-file-noselect(#f(compiled-function (filename &optional nowarn rawfile wildcards) "Read file FILENAME into a buffer and return the buffer.\nIf a buffer exists visiting FILENAME, return that one, but\nverify that the file has not changed since visited or saved.\nThe buffer is not selected, just returned to the caller.\nOptional second arg NOWARN non-nil means suppress any warning messages.\nOptional third arg RAWFILE non-nil means the file is read literally.\nOptional fourth arg WILDCARDS non-nil means do wildcard processing\nand visit all the matching files.  When wildcards are actually\nused and expanded, return a list of buffers that are visiting\nthe various files." #<bytecode 0x233d53>) "/home/cysh/Documents/802.11a-1999.pdf" nil nil nil)
  apply(ad-Advice-find-file-noselect #f(compiled-function (filename &optional nowarn rawfile wildcards) "Read file FILENAME into a buffer and return the buffer.\nIf a buffer exists visiting FILENAME, return that one, but\nverify that the file has not changed since visited or saved.\nThe buffer is not selected, just returned to the caller.\nOptional second arg NOWARN non-nil means suppress any warning messages.\nOptional third arg RAWFILE non-nil means the file is read literally.\nOptional fourth arg WILDCARDS non-nil means do wildcard processing\nand visit all the matching files.  When wildcards are actually\nused and expanded, return a list of buffers that are visiting\nthe various files." #<bytecode 0x233d53>) ("/home/cysh/Documents/802.11a-1999.pdf" nil nil nil))
  find-file-noselect("/home/cysh/Documents/802.11a-1999.pdf" nil nil nil)
  find-file("/home/cysh/Documents/802.11a-1999.pdf")
  dired-find-file()
  dired-open-file(nil)
  funcall-interactively(dired-open-file nil)
  call-interactively(dired-open-file nil nil)
  command-execute(dired-open-file)

Could I get some advice from you to overcome this situation, please?

invalid function when used with pdf-tools

I got hit by a issue already reported here politza/pdf-tools#210 when using interleave with pdf-tools. Here is the trace:

Debugger entered--Lisp error: (invalid-function pdf-view-current-page)
  pdf-view-current-page()
  #[nil "\300 \207" [pdf-view-current-page] 1]()
  interleave-add-note()
  funcall-interactively(interleave-add-note)
  call-interactively(interleave-add-note nil nil)
  command-execute(interleave-add-note)

Horizontal split

Would it be possible to add options a) to make the M-x interleave function do an horizontal window split, having the pdf document on top and the notes on the bottom, and b) to select the number of lines in the notes window? In this way we can maximize the width and height of the pdf window, allowing for easier reading.
Many thanks!

Notes on a new page are not at top-level indentation.

When inserting notes on a new page, the heading for that page of notes is inserted at the same level as the last heading on the previous notes. I think it should be set to whatever the first page of notes has as its indent level, or have a default indent level. Currently a user needs to manually adjust the indent level to match the previous page. This can become troublesome if, for example, I have aggregated notes at the top and can't remember what my page-level indent is.

Mode hook problem of interleave

Hi,

Looking in the definition of interleave-mode, it should be a buffer local minor mode. But if one wants to add hooks for interleave-mode, for example,

    (add-hook 'interleave-mode-hook (lambda () (print (buffer-file-name)))))

can see that when enabling interleave-mode, it prints the pdf buffer file name, while prints the org buffer file name when disabling. That's a bit strange as we enable the mode in an org buffer while disable it by interleave-quit in a pdf buffer. Anyway, shouldn't these two be the same(as the mode is buffer local)? If not, there may be issues when people trying to add hooks for interleave-mode. But personally, I think defining an interleave-mode minor mode maybe is not really necessary. Thanks !

Suggestion: Add a screenshot

I just discovered this from a comment on Reddit so I'm not familiar with the tools.
It's a bit hard to visualize what exactly this might look like so maybe adding a screenshot would be helpful to some.

Support for pdf-tools

Hi,

This is an awesome idea for note taking.

Can you please add support for pdf-tools.

I get the below error as I use pdf-tools instead of docview for viewing pdf files:

n runs the command interleave-go-to-next-page
Error running timer `pdf-cache--prefetch-start': (error "epdfinfo: No such page 0")

Note: With pdf-tools installed, the n key is bound to pdf-view-next-page-command.

Open/create .org notes file when launching interleave from a pdf [Feature/TODO?]

Hi,

I have this idea:

  • Set a defvar called interleave--notes-dir. The user should make a point to save the pdf associated notes org file either in the same folder or in the interleave--notes-dir.
  • When calling M-x interleave from a pdf file (let's say file-name.pdf), we will search for file-name.org first in the same folder and then in interleave--notes-dir. If the search is successful, that file is opened and the Interleave session will continue as now.
  • But if file-name.org is not found, then it is created in interleave--notes-dir with the header #+INTERLEAVE_PDF: /path/to/file-name.pdf. The user can choose to move it to the same folder as the pdf is they wish (or we can add a defvar for an option to create the notes org in either the same folder or in interleave--notes-dir by default). I personally like the idea of keeping all notes in one folder. And then the Interleave session will continue as now.

What do you think? I will get started on adding this feature when I get a chance.

Navigation in multi pdf notes file.

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))))

additional property for page offset?

Hi,
since interleave seems to allow a really smooth workflow, when annotating PDFs in emacs, I'm thinking about using it to annotate theses, something I regularly need to do. Since page 1 of a thesis usually is at page 8 to 20 of the PDF it would be great if one could set a property defining this offset. In interleave--create-new-note when the headline for the note is created, this property's value could then just be added to the page variable in (insert (format "Notes for page %d" page)). The behavior of interleave would not be changed, only headings would reflect the actual page numbers.

What do you think about that?

Cheers,
Alex

Naming convention cleanup?

Hi,

I was revisiting interleave.el, and wanted to clean up the naming of various funcitons and the interleave minor mode.

(1) Rename interleave minor mode to interleave-mode

Right now we get this warning:

Compiling file /home/kmodi/.emacs.d/forks-unused/interleave/interleave.el at Sun Aug 21 23:44:38 2016
interleave.el:439:1:Warning: global/dynamic var ‘interleave’ lacks a prefix

It is a convention to name a minor mode ending with -mode. Also I have verified that renaming as above gets rid of that warning when byte-compiling interleave.el. That would mean a backward incompatible change. But the interleave name can be marked as obsolete and then later removed after few months if you like.

(2) Remove -- from the names of commands meant to be used by the end-user.

The convention is to use -- only for the functions that are used internally, and definitely not for the interactive functions aka commands. Would you want to refactor the code so that interleave-- is used solely for internal functions.

If you'd like I can send a PR for these changes.

Can interleave work with Hyperbole outline files (.kotl)?

Recently started looking at this file format and find the outlining feature very interesting. Document is mad of nodes/cells, which have an absolute and relative ID, can be reordered and automatically renumbered, moved about etc. Would love to see the two combined, but must admit I can't see how meta data is embedded in these type of files (I understand they're hidden, unlike org's drawers).

Controlling window in focus

I know I can always type "i" to go to the editing buffer, but the instinct is to start typing right away, but is it possible to keep the editing window in focus, rather than jump to the PDF every time I move forward/backwards (Alt-n/p)?

Pressing "i" will create a new sub-heading per page, which is not what I need most of time. I prefer to create an annotation documents that mirrors the structure of PDF I'm working on.

pdf cannot show next page

I get the error message:

pdf-info-epdfinfo-program is not executable.

When pressing n to page-down the pdf.

圖片

Create new notes in the correct order [Feature]

When creating new notes, they are always appending at the bottom of the file.

So if you first made notes for page 10 and then for page 1, the page 1 notes will end up at the bottom of the file.

The notes will be easier to access if the page order is maintained in the notes (page 1 notes, followed by page 2 notes if present, followed by page 3 notes if present, and so on).

One way would be to scan for which page notes already exist in the org file and then insert notes for the new page at the correct location.

This can be made a defcustom var.

Improve pdf-page parsing

Make use of org-entry-get instead of manually doing re-search-forward/re-search-backward to get the pdf page numbers from the properties.

Example:

(org-entry-get (point) "interleave_page_note")

instead of

(org-narrow-to-subtree)
(goto-char (point-min))
(re-search-forward "^ *:interleave_page_note: *\\(.*\\)")
(setq pdf-page (string-to-number (match-string 1)))

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.