dmitrym0 / org-noter-plus

Emacs document annotator, using Org-mode
GNU General Public License v3.0
31 stars 3 forks source link

+STARTUP: hidestars

* This is a refactor of the c1-g* fork done collaboratively by [[https://github.com/petermao/org-noter][petermao]] and [[https://github.com/dmitrym0/org-noter-plus-djvu][dmitrym0]]

** Stock vs refactored note insertion

*** Stock | | insert-note =i= | precise note =M-i= | no-questions =C-i, TAB= | |-----------------+--------------------------------+---------------------------+-------------------------| | title prompt? | Y | Y | N | | default title 1 | prior note by location | selected-text | N/A | | default title 2 | "Notes for page #" | "Notes for page # x y" | "Notes for page #" | | new note | with new title | always | always | | body | selected-text on existing note | selected-text (> 3 lines) | none | |-----------------+--------------------------------+---------------------------+-------------------------|

* Refactored | | insert-note | precise note | no-questions | |---------------------+---------------------------+---------------------------+---------------------------| | title prompt? | Y | Y | N | | default title 1 | short-selected-text | short-selected-text | short-selected-text | | default title 2 | "Notes for page #" | "Notes for page # x y" | "Notes for page #" | | new note | with new title | always | with new title | | body | selected-text (not title) | selected-text (not title) | selected-text (not title) | |---------------------+---------------------------+---------------------------+---------------------------| | highlight selection | user setting/toggle | user setting/toggle | user setting/toggle | * Customizations Out of respect for the existing user base of =org-noter=, almost all of the user-interface features of this fork remain the same those of as the original =org-noter=. However, users may be interested in our variations on the theme of Gonçalos Santos. Peter's mods In order of frequency, I use precise notes the most, standard notes next and no-questions notes the least, so I have bound keys to reflect those preferences with =i= for precise notes, =TAB= for standard notes; for no-questions (no-prompt) notes, =I= is for precise notes and =M-i= for standard notes.:

+begin_src elisp

  (with-eval-after-load 'org-noter
    (define-key org-noter-doc-mode-map (kbd "i")   'org-noter-insert-precise-note)
    (define-key org-noter-doc-mode-map (kbd "C-i") 'org-noter-insert-note)
    (define-key org-noter-doc-mode-map (kbd "I")   'org-noter-insert-precise-note-toggle-no-questions)
    (define-key org-noter-doc-mode-map (kbd "M-i") 'org-noter-insert-note-toggle-no-questions))
#+end_src

For navigation, I use =..-sync-..-note= more than =..-sync-..-page-..=, so I
bound the =note= commands to the easier-to-type =M-[p.n]= bindings and the
less-used =page-..= commands to the harder-to-type =C-M-[p.n]= bindings.
#+begin_src elisp
  (with-eval-after-load 'org-noter
    (define-key org-noter-doc-mode-map (kbd "M-p") 'org-noter-sync-prev-note)
    (define-key org-noter-doc-mode-map (kbd "M-.") 'org-noter-sync-current-note)
    (define-key org-noter-doc-mode-map (kbd "M-n") 'org-noter-sync-next-note)
    (define-key org-noter-doc-mode-map (kbd "C-M-p") 'org-noter-sync-prev-page-or-chapter)
    (define-key org-noter-doc-mode-map (kbd "C-M-.") 'org-noter-sync-current-page-or-chapter)
    (define-key org-noter-doc-mode-map (kbd "C-M-n") 'org-noter-sync-next-page-or-chapter)

    (define-key org-noter-notes-mode-map (kbd "M-p") 'org-noter-sync-prev-note)
    (define-key org-noter-notes-mode-map (kbd "M-.") 'org-noter-sync-current-note)
    (define-key org-noter-notes-mode-map (kbd "M-n") 'org-noter-sync-next-note)
    (define-key org-noter-notes-mode-map (kbd "C-M-p") 'org-noter-sync-prev-page-or-chapter)
    (define-key org-noter-notes-mode-map (kbd "C-M-.") 'org-noter-sync-current-page-or-chapter)
    (define-key org-noter-notes-mode-map (kbd "C-M-n") 'org-noter-sync-next-page-or-chapter))
#+end_src

In the original code, the tooltip arrow on PDFs is *Orange-Red on White*,
which works fine when the arrow is always on the left side of the page.  I
found that with the 2D precise notes introduced by Ahmed Shariff, I sometime
had trouble locating the arrow as I navigated through my notes.  The *Black
on Cyan* color-scheme that I use is more jarring, hence easier to locate.
#+begin_src elisp
  (with-eval-after-load 'org-noter
    (setq org-noter-arrow-background-color "cyan"
    org-noter-arrow-foreground-color "black"))
#+end_src

* Dmitry's mods * Features New

  1. Use pdf-view-current-pagelabel to use the page label instead of page in default titles

    new function/hook =...-pretty-print-location-for-title=

  2. Customizable tooltip arrow colors

    • =...-arrow-foreground-color=
    • =...-arrow-background-color=
  3. Text-selection higlighting: customizable default behavior, toggle =...-highlight-selected-text= with =C-u= prefix on note-insertion commands.

  4. Rudimentary support for multicolumn PDFs with inheritable =NUM_COLUMNS= property. See =...-pdf-convert-to-location-cons=

*** Wishlist

  1. Bind M- to precise-note, no-questions.

  2. Make background of arrow transparent (see org-noter--show-arrow) maybe https://emacs.stackexchange.com/questions/45588/how-to-make-tooltip-background-transparent

  3. Dedicated insert-selected-text-into-page-note

  4. Internationalize precise notes to handle right-to-left languages. ** Bugs *** to fix

    1. Sometimes (when?) M-p doesn't pick up the containing note-at-point right away (or at all), requiring user to manually type in the (existing) title

    2. With NUM_COLUMNS > 1, point in notes document doesn't land in the correct place

    3. With NUM_COLUMNS > 1, columns don't necessarily start at horizontal positions k/NUM_COLUMNS for k \in {1,..,NUM_COLUMNS}. We need to write a user interface that builds a list of horizontal fractions to delimit the columns.

*** fixed

  1. vertically stacked doc/notes layout fixed

  2. =org-noter-sync-next-page-or-chapter= navigation fixed

  3. Navigating up from a nested precise note lands in the prior note at the next level up (eg level 3 -> level 2). page notes behave properly.

    [file:org-noter-core.el:2179] =(org-element-property :begin (org-noter--get-containing-element))= returns the begin of the element one level up when the current note location is of the form (<page#> . ). It works properly for locations of the form (<page#> . ).

    It will be one of these two:

    • =org-noter--get-containing-heading=
      • =org-noter--check-location-property= found bug: [[file:org-noter-core.el:1023]] change test from integerp to numberp
    • =org-noter--get-containing-property-drawer= ** Custom variables Presently, the custom variables listed under =customize-group org-noter= is a flat list. I would like to group them into logical categories.

*** start-stop

*** layout

*** note-insertion

*** navigation-display

*** other