nobiot / org-remark

Highlight & annotate text, EWW, Info, and EPUB
https://nobiot.github.io/org-remark/
GNU General Public License v3.0
436 stars 22 forks source link

Adding a level 1 heading removes overlays #81

Closed mankoff closed 6 months ago

mankoff commented 6 months ago

I've been using org-remark for a few weeks on one file. It's great. Thank you.

Remarks are stored as 2nd-level org headings in a file, for example:

**       foo
:PROPERTIES:
:org-remark-id: 5a8198c9
:org-remark-label: nil
...
:END:

some text

**   bar
:PROPERTIES:
...

I'm about to start marking a new file, so I added a top-level heading * File One above foo. As soon as I do this and save my remark.org file, all the highlights in the remarked-upon file disappear. As soon as I remove the top level heading, they come back.

What is the process for organizing multiple files in one remark.org file? I've seen the section of the manual on Create a marginal notes file for each source file and store all of them in a specific location, but prefer to stick with one remark.org file for now.

nobiot commented 6 months ago

Level 1 headline represents a file (see below). So, I think, you should create a new level 1 outside the one you already have for “foo” and “bar” headlines.

* File 1
** Highlight 1 in File 1
** Highlight 2 in File 1
[...]
* File 2
** Highlight 1 in File 2
[...]

This part of the manual

nobiot commented 6 months ago

Having said this above, I am not entirely clear why you are manually adding a new level 1 “File One”… so, hmm, I guess I don’t understand what you are exactly trying to do.

The default is to organize highlights in a file named “marginalia.org” in the same directory. So if you have a “File One.txt”, “File Two.txt”, and so on in the same directory, the highlights should be organized in the same one “marginalia.org”. Is this not the case for you?

mankoff commented 6 months ago

Interesting. It never created the level 1 * File 1 heading for me, only level 2.

My setup does not use marginalia.org in the local folder. I have this as my setup:

(use-package org-remark
  :load-path "~/.emacs.d/manual-packages/org-remark"
  :after org
  :bind (;; :bind keyword also implicitly defers org-remark itself.
         ;; Keybindings before :map is set for global-map.
         ("C-c n m" . org-remark-mark)
     ("C-c n b" . org-remark-mark-blue)
     ("C-c n L" . org-remark-mark-line)
          :map org-remark-mode-map
         ("C-c n o" . org-remark-open)
         ("C-c n d" . org-remark-delete))
  :init
  (org-remark-global-tracking-mode +1)
  :config
  (setq org-remark-notes-file-name "/home/kdm/Documents/Org/remarks.org")
  (org-remark-create "blue" '(:forground "black" :background "lightblue"))
  (set-face-attribute 'org-remark-highlighter nil :background "gold")
  )

And I'm using version b49ef0a which is up-to-date at the moment. I think I'm using the git version because I wanted a v1.3 feature (#80).

mankoff commented 6 months ago

Aha! When I tried to manually create the level 1 heading in preparation to edit File 2, it messed up File 1.

I just added a mark in File 2, and then the code added two level-1 headings (one for each file). It works. If anyone wants to manually create a level-1 heading even if they're only marking up one file, the format is:

* Your Heading
:PROPERTIES:
:org-remark-file: ../../relative/path/to/file1.ext
:END: