nobiot / org-remark

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

(setq org-remark-notes-file-name 'org-remark-notes-file-name) not working #26

Closed AtomicNess123 closed 2 years ago

AtomicNess123 commented 2 years ago

I am using (setq org-remark-notes-file-name 'org-remark-notes-file-name) to change the file name "marginalia" to the individual name of my buffer + _notes.org. But it is not working. I think this could be a bit better explained in the readme. Thanks!

nobiot commented 2 years ago

Hi @AtomicNess123

Thanks for the comment.

Have you had a chance to look at the user manual? This section "3.3.3 How to Change Where Marginal Notes File is Saved" is intended to describe a couple of typical use cases.

The location of the marginal notes file is specified by user option org-remark-notes-file-name and its default is “marginalia.org”. This means the marginal notes file will reside in the same directory as the source files as a separate file.

If you use the customize command to customize org-remark-notes-file-name, you will have an option to choose a ‘File’ or ‘Function’ (customization group org-remark). ... If you would like to dynamically change the location based on the file and various different conditions, select the function as an option. The default function is org-remark-notes-file-name-function. It adds ‘-notes.org’ as a suffix to the source file’s name without the extension. For example, for a file named ‘my-main-file.txt’, Org-remark will store highlights in ‘my-main-file-notes.org’. You can create your own function and use it.

I believe it's easier to use customize and see the options to select from than setq. If you prefer to use setq, you can put something like this:

(setq org-remark-notes-file-name
      #'org-remark-notes-file-name-function)

I welcome suggestions for better ways to describe this.

AtomicNess123 commented 2 years ago

Thanks! One question though: what is the difference between setting:

(setq org-remark-notes-file-path #'org-remark-notes-file-path-function)

and

(setq org-remark-notes-file-name #'org-remark-notes-file-name-function)

They seem to have the same behaviour.

nobiot commented 2 years ago

They are the same.

“-file-path” is an old name which I changed to “-file-name” to align with the GNU convention; I got advice from Emacs mailing list.

Technically, the former is made an alias of the latter to keep backward compatibility.

This should be visible with the doc string of the former; use describe-variable to view it