Code Monkey home page Code Monkey logo

org-remark's Introduction

README – Org-remark

GNU Emacs GPLv3 GNU ELPA GNU-devel ELPA

Breaking Changes

  • [18 January 2022] Package name change from Org-marginalia to Org-remark. See detail on data conversion. In most cases, no action is required for you.

Introduction

Org-remark lets you highlight and annotate text files, websites, EPUB books and Info documentation with using Org mode.

A user manual is available online or Emacs in-system as an Info node `(org-remark)’: (C-h i and find the Org-remark node).

For installation and minimum configuration, refer to Installation below or the user manual: online or Info node `(org-remark) Installation’

Getting Started in the user manual will get you started in 5 minutes: online or or Info node `(org-remark) Getting Started’.

For customization, refer to the customization group `org-remark’ or user manual: online or Info node `(org-remark) Customizing’. A separate online article has been written to guide you on how to customize an icon (also part of the user manual. Evaluate (info “(or-gremark) How to Set Org-remark to Use SVG Icons”).

An introductory video (8 minutes) and V1.1.0 release introduction (12 minutes) are available on YouTube.

Features

  • Highlight and annotate any text file. The highlights and notes are kept in an Org file as the plain text database. This lets you easily manage your marginal notes and use the built-in Org facilities on them – e.g. create a sparse tree based on the category of the notes
  • Create your your own highlighter pens with different colors, type (e.g. underline, squiggle, etc. optionally with Org’s category for search and filter on your highlights and notes)
  • Have the same highlighting and annotating functionality for
    • Websites when you use EWW to browse them
    • EPUB books with nov.el
    • Info documentation

Screenshots and Videos

./resources/images/2022-01-22-Title.png Figure 1. Left: Org-mode with text enlarged; Right: marginal notes with an inline image. Introductory video (8 minutes) and V1.1.0 release introduction (12 minutes) are available on YouTube

./resources/images/2022-01-22-Context-menu.png Figure 2. Mouse context menu with built-in context-menu-mode available with Emacs version 28 onward

./resources/images/2023-08-20-epub-prince-icon.png Figure 3. EPUB book (“Prince” by Niccolò Machiavelli via https://www.gutenberg.org/) with icon indicating there are annotations to the highlight: new features with v1.2.0 (2023-08-20). Left: marginal notes file with annotations; Right: an EPUB book file with a highlight and simple ASCII icon.

Installation

This package is available on:

  • GNU-ELPA (releases only; equivalent to MELPA-Stable)
  • GNU-devel ELPA (unreleased main branch; equivalent to MELPA)

GNU ELPA should be already set up in your Emacs by default. If you wish to add GNU-devel ELPA, simply add its URL to package-archives like this:

(add-to-list 'package-archives
             '("gnu-devel" . "https://elpa.gnu.org/devel/") :append)

After installation, we suggest you put the setup below in your configuration.

(org-remark-global-tracking-mode +1)

;; Optional if you would like to highlight websites via eww-mode
(with-eval-after-load 'eww
  (org-remark-eww-mode +1))

;; Optional if you would like to highlight EPUB books via nov.el
(with-eval-after-load 'nov
  (org-remark-nov-mode +1))

;; Optional if you would like to highlight Info documentation via Info-mode
(with-eval-after-load 'info
  (org-remark-info-mode +1))

Unless you explicitly load org during Emacs initialization, I suggest to defer loading org-remark (thus there is no (require 'org-remark) in the example above). This is because it will also pull in org, which can slow down initialization. You can control the timing of loading org-remark by autoloading some commands in a similar way with the example keybindings below.

Below are example keybindings you might like to consider:

;; Key-bind `org-remark-mark' to global-map so that you can call it
;; globally before the library is loaded.

(define-key global-map (kbd "C-c n m") #'org-remark-mark)

;; The rest of keybidings are done only on loading `org-remark'
(with-eval-after-load 'org-remark
  (define-key org-remark-mode-map (kbd "C-c n o") #'org-remark-open)
  (define-key org-remark-mode-map (kbd "C-c n ]") #'org-remark-view-next)
  (define-key org-remark-mode-map (kbd "C-c n [") #'org-remark-view-prev)
  (define-key org-remark-mode-map (kbd "C-c n r") #'org-remark-remove)
  (define-key org-remark-mode-map (kbd "C-c n d") #'org-remark-delete))

Alternatively, you can use use-package to set up Org-remark. The example provided below should be equivalent to the setup described above.

(use-package org-remark
  :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 l" . org-remark-mark-line)
         :map org-remark-mode-map
         ("C-c n o" . org-remark-open)
         ("C-c n ]" . org-remark-view-next)
         ("C-c n [" . org-remark-view-prev)
         ("C-c n r" . org-remark-remove)
         ("C-c n d" . org-remark-delete))
  ;; Alternative way to enable `org-remark-global-tracking-mode' in
  ;; `after-init-hook'.
  ;; :hook (after-init . org-remark-global-tracking-mode)
  :init
  ;; It is recommended that `org-remark-global-tracking-mode' be
  ;; enabled when Emacs initializes. Alternatively, you can put it to
  ;; `after-init-hook' as in the comment above
  (org-remark-global-tracking-mode +1)
  :config
  (use-package org-remark-info :after info :config (org-remark-info-mode +1))
  (use-package org-remark-eww  :after eww  :config (org-remark-eww-mode +1))
  (use-package org-remark-nov  :after nov  :config (org-remark-nov-mode +1)))

Contributing and Feedback

Create issues, discussion, and/or pull requests in the GitHub repository. All welcome.

Org-remark is available on GNU ELPA and thus copyrighted by the Free Software Foundation (FSF). This means that anyone who is making a substantive code contribution will need to “assign the copyright for your contributions to the FSF so that they can be included in GNU Emacs” (Org Mode website).

Thank you.

Contributors

New features

  • EPUB books (nov.el) support would not have been possible without collaboration with @sati-bodhi
  • echo-text update from the marginal notes to the source buffer by marty hiatt (@mooseyboots)
  • Support for websites with eww-mode by Vedang Manerikar (@vedang)

Bug fixes

@alan-w-255, Nan Jun Jie (@nanjj), @sgati-bodhi

Documentation (including README, NEWS, CHANGELOG)

@randomwangran, marty hiatt (@mooseyboots), @jsntn

Thank-you to all the comments, issues, and questions on GitHub!

License

This work is licensed under a GPLv3 license. For a full copy of the license, refer to LICENSE.

org-remark's People

Contributors

jsntn avatar nobiot avatar randomwangran avatar sati-bodhi avatar vedang 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

org-remark's Issues

Default keybindings

This is a suggestion about the default keybindings ("C-c n" map). The Emacs key binding guidelines say:

Don’t define C-c letter as a key in Lisp programs. Sequences consisting of C-c and a letter (either upper or lower case) are reserved for users; they are the only sequences reserved for users, so do not block them.
Changing all the Emacs major modes to respect this convention was a lot of work; abandoning this convention would make that work go to waste, and inconvenience users. Please comply with it.

I believe org-roam suggests C-c n bindings but doesn't bake them into org-roam.el.

Can this be changed to something else?

TeX Export Options

Cool package, was looking for something like this a year ago. Will try using it for commenting on colleagues papers, annotating sources, and grading papers.

Are there already some TeX templates for export? e.g., having annotations appear in a colored box or the side window of the main body of text using something like minipage? Do annotations export as pdf annotations?

Personally, I'm not fond of pdf annotations. They are boring and don't show off 1337 skills enough. If they aren't already in this package, I'll probably just design a few TeX templates for different tasks (literate email with org-mime, literate bibliographies, lecture notes, grading ...)

preview the content under point

Thanks for grouping this package. I find the ability to connect
Org-mode notes is extremely useful. The format saving the
annotations in Org-mode format is also intuitive for me, so it
can be easily incorporated into Org-roam.

After a very short interaction with the code, I found something
that might be useful. I jot down them in the issue tracker
but do not feel any pressure on it. I am also trying to implement
these features as well.

I find that we need to use om/open to open the notes.

I believe when the marker is visiting a marked object, it can
prompt up the content of the associated annotation.

I will try to play with it using posframe.

Highlights inactive after "org-remark-note-body" property is suddently introduced...

Hi there! Something is happening in some of the files I'm editing, where the property drawer changes and the highlights in the corresponding file are not shown anymore:

For example, this is how all the highlight headlines in marginalia file look now:

Note the property :org-remark-note-body which is not present typically, and the position of :org-remark-beg which should be the first one in the list.

:org-remark-id: 2804fd1f
:org-remark-label: yellow
:CATEGORY: important
:org-remark-link: [[file:ocr/Horwitz2016.org::30]]
:org-remark-beg: 1543
:org-remark-end: 2216
:org-remark-note-body: Throughout most of the sixteenth century, this community attracted a very
impressive array of....

My source file, the one I'n annotating, has this prop line:

# -*- org-remark-notes-file-name: "../Horwitz2016.org"; lingva-target: "iw"; -*-

I never had any problem until today and all the other annotation, i.e. existing org files I've edited still function as expected.

org-remark-link descripton

hi

in my setting org-remark-mark
add an entry to the marginalia.org of the form
** \NiceMatrixOptions{letter-for-dotted-lines=V}
:PROPERTIES:
:org-remark-beg: 472
:org-remark-end: 427
:org-remark-id: 6860f5d7
:org-remark-label: nil
:org-remark-link: [[file:~/ALLES/HGs/tex/vorlesungen/MasterIQ/HGMaster-IQ/Folien/Examen/test.m::22]]
:END:

could it be please
[[file:/ALLES/HGs/tex/vorlesungen/MasterIQ/HGMaster-IQ/Folien/Examen/test.m::22][link1]]
or something similar? or say
[[file:
/ALLES/HGs/tex/vorlesungen/MasterIQ/HGMaster-IQ/Folien/Examen/test.m::22][linenumer::22]]

BTW what is org-remark-label supposed to do?
Uwe Brauer

Calibre epub notes intergration via calibredb

This may be beyond the scope of the current project, but I see a lot of potential - as far as epub-reader support is concerned.

The issue is this: before my discovery of org-remark, I add highlights to my epub library primarily through Calibre's E-book Viewer. These are not easily accessible for consolidation in org-noter at present.

Again, pdfs are "more equal" than epubs in this case because org-noter has a create-skeleton function that can extract annotations out from the pdfs through pdf-tools. org-remark can now serve as an annotating device with nov; but notes previously taken in Calibre remain out of reach.

Annotations for a single Calibre Library are collectively stored in metadata.db, which can be accessed with sqlite3.

Here's the fun part: the calibredb.el project has already built up a whole ecosystem to access and process data stored in that database from Emacs.

This means, with a little bit of effort, we might just be able to integrate the two systems together to build an epub note-taking system on Emacs which is at least as good as the present pdf support.

Notes taken in Calibre can be imported into org-remark and accessed with nov; vice-versa. How cool would that be.

This also fits nicely with your intuition of having a separate module for epub support and integration.

Originally posted by @sati-bodhi in #54 (comment)

[Feature Request] Export PDF/HTML with original text and notes in the margin as a single document

It would be great to have an export option (pdf/html) to export the original text (with highlights) and along side the notes in the margin (ha!). The margin width could be an user settable variable but maybe 20% is a good starting point?

This would allow easily reviewing a document and send it to someone who is not an emacs user while maintaining rich context.

Great package, keep up the good work!

Highlight text gets cut off in notes buffer if the highlight spans across two lines

Original: #54

Thanks to @sati-bodhi

This should (probably) apply to regular notes as well (in cases, for example, where fill-paragraph is used:

When we add a new highlight note, if that highlight happens to span across two consecutive lines, the part of the text that is on the second line tends to be cut off from the main text body and inserted as part of the note content under the properties drawer.

Say I have [some 
text] highlighted like this. 

I would get:

** some
:PROPERTIES:
:org-remark-beg: 2604
:org-remark-end: 2679
:org-remark-id: c2097d20
:org-remark-label: nil
:END:
text

In my new note. 

You need to pre-process the text variable with (replace-regexp-in-string "\n" " " text) before passing it to (insert (concat "** " text "\n")) in highlight-save.

Improve error message when essential props are missing from the property drawer....

Not sure if this is related to the previous issue I've reported, but I've noticed that when the props :org-remark-beg: and ~
:org-remark-end:~ are missing, when the mode is activated you see this unhelpful error: "org-remark-highlights-load: Wrong type argument: stringp, nil"... now, I'm not sure why it was missing, but just in case it's possible to validate the existence of the essential props, it might be helpful...

Getting started

I went to the documentation but I may be a fool, I can't find how to CREATE a highlight. The documentation assumes I have created highlights in the text and teaches me how to navigate them.

Not all highlights loaded when marginalia.org file does not show all the headlnies

Describe the bug
creating a highlight of a file requiring differnt encoding will cause issues with reload of highlights.

To Reproduce

  1. refer to files test files.zip
  2. if file open of asdf.org, expect highlights of words "ipsum is" and "‘Rautāwhiri’" (as setup per marginalia.org)
  3. it doesn't.
  4. to fix, open up marganalia file, the go back to text file buffer, toggle org-remark-mode. highligts then become visible. if try and kill buffer marginalia again, prompts to save particular encoding. once selected, bug can be reproduced again.

[Requst for Help] Please test dev/nov branch for backward compatibility before merge

I am about to merge a development branch dev/nov that has been in the works for 6-7 months. It will add support for EPUB books with nov.el and open up more possibility to support non-file-visiting major mode such as Info.

The dev branch contains a lot of refactoring. I have been trying my best to make this change as smooth as possible for existing Org-remark users. I believe there is no break changes in the eye of users. My tests have been good so far. My old notes file work with no adjustments.

It would be great if anyone could spare some of your time to test the branch to see there is any backward compatibility issues. I intend to merge it with the main branch once two or three volunteers have their eyes on it and issues resolved.

What would be great is if you simply open the files (or webpages) where you have highlights, do things you would normally do, and see if anything breaks.

As the new code should be backward compatible as is, you should not have to do any extra config. And your notes should load just fine.

Nevertheless, there will be a few visible changes with additional features (please see below).

I am excited about the new features and will really appreciate if you could help me bring them to whoever benefits from them as smoothly as we can.

Thank you.
nobiot

1. "Icons" for highlights with annotations

Screenshot from 2023-07-15 14-09-52

The "icon" is a string at the moment and you can customize it with org-remark-icon-notes. If you set it to nil, you can disable it.

2. Automatic adjustment of highlight positions when different from original

Screenshot from 2023-07-15 14-20-08

This is a new feature that is originally designed to tackle specific rendering issue of nov.el (issue #50). Now it has become a generic feature. I think it would work nicely for webpages when they are edited as you can see in the example of Wikipedia in the image above.

I have introduced another icon to indicate that Org-remark has automatically adjusted the position. You can customize the "icon" string with org-remark-icon-position-adjusted (setting it to nil disable the icon but the adjustment still occurs) and face with org-remark-highlighter-warning.

If you are interested, more technical detail is described in this section of the user manual (already publicly visible).

3. How to set up the new EPUB support

image

This is not an element for backward compatibility, but you might be still interested in trying it out. It is as easy as adding the following in your configuration (the same mechanism as EWW support as described in README and user manual).

;; Optional if you would like to highlight EPUB books via nov.el
(with-eval-after-load 'nov
  (org-remark-nov-mode +1))

Let me know if you have any questions or comments. Thank you again for reading this.

@mooseyboots @vedang @nanjj @sati-bodhi @randomwangran, @karthink, @holtzermann17, @shombando, @magthe, @linwaytin, @rtrppl, @ryanprior, @ericsfraga, @darcamo, @zhewy, @QMeqGR, @Vidianos-Giannitsis, @AtomicNess123, @ouboub, @dian-yu-luo, @SylvianHemus, @basaran, @Ypot, @oatmealm

Notes in websites?

Could org-remark be used for static web pages?
I think it could be a very useful feature, since it would allow reading and annotating the WWW directly with org-mode.

Maybe it should be useful just for static websites, or it could save a copy of the web page and ask to the user if she wants to reload it?

Inspired by a couple of friendly suggestions:
https://lists.gnu.org/archive/html/emacs-orgmode/2022-10/msg00451.html
https://lists.gnu.org/archive/html/emacs-orgmode/2022-10/msg00442.html

org-remark breaks export to pdf, html

If I enable org-remark and try to export /some/ org files to pdf or html it fails with an error: "Wrong type argument: stringp, nil". I tried isolating parts of the files and I think (not 100% certain) that it has something to do with line(s) like:

#+INCLUDE: "./P4350_course.org::#Syllabus" :only-contents t

If I don't load org-remark everything works fine.

The backtrace on error is:

Debugger entered--Lisp error: (wrong-type-argument stringp nil)
expand-file-name(nil)
file-relative-name(nil)
org-remark-source-get-file-name(nil)
org-remark-highlights-get()
org-remark-highlights-load()
org-remark-mode()
run-hooks(change-major-mode-after-body-hook text-mode-hook outline-mode-hook org-mode-hook)
apply(run-hooks (change-major-mode-after-body-hook text-mode-hook outline-mode-hook org-mode-hook))
run-mode-hooks(org-mode-hook)
org-mode()
org-link-open-from-string("[[elisp:(org-latex-export-to-pdf nil t)][PDF]]")
org-open-at-point-global()
funcall-interactively(org-open-at-point-global)
call-interactively(org-open-at-point-global)
#f(compiled-function (&optional arg) "Open link, timestamp, footnote or tags at point.\n\nWhen point is on a link, follow it. Normally, files will be\nopened by an appropriate application. If the optional prefix\nargument ARG is non-nil, Emacs will visit the file. With\na double prefix argument, try to open outside of Emacs, in the\napplication the system uses for this file type.\n\nWhen point is on a timestamp, open the agenda at the day\nspecified.\n\nWhen point is a footnote definition, move to the first reference\nfound. If it is on a reference, move to the associated\ndefinition.\n\nWhen point is on a headline, display a list of every link in the\nentry, so it is possible to pick one, or all, of them. If point\nis on a tag, call org-tags-view' instead.\n\nOn top of syntactically correct links, this function also tries\nto open links and time-stamps in comments, node properties, and\nkeywords if point is on something looking like a timestamp or\na link." (interactive "P") #<bytecode 0x61a3bdf87b4e3f8>)(nil) ad-Advice-org-open-at-point(#f(compiled-function (&optional arg) "Open link, timestamp, footnote or tags at point.\n\nWhen point is on a link, follow it. Normally, files will be\nopened by an appropriate application. If the optional prefix\nargument ARG is non-nil, Emacs will visit the file. With\na double prefix argument, try to open outside of Emacs, in the\napplication the system uses for this file type.\n\nWhen point is on a timestamp, open the agenda at the day\nspecified.\n\nWhen point is a footnote definition, move to the first reference\nfound. If it is on a reference, move to the associated\ndefinition.\n\nWhen point is on a headline, display a list of every link in the\nentry, so it is possible to pick one, or all, of them. If point\nis on a tag, call org-tags-view' instead.\n\nOn top of syntactically correct links, this function also tries\nto open links and time-stamps in comments, node properties, and\nkeywords if point is on something looking like a timestamp or\na link." (interactive "P") #<bytecode 0x61a3bdf87b4e3f8>))
apply(ad-Advice-org-open-at-point #f(compiled-function (&optional arg) "Open link, timestamp, footnote or tags at point.\n\nWhen point is on a link, follow it. Normally, files will be\nopened by an appropriate application. If the optional prefix\nargument ARG is non-nil, Emacs will visit the file. With\na double prefix argument, try to open outside of Emacs, in the\napplication the system uses for this file type.\n\nWhen point is on a timestamp, open the agenda at the day\nspecified.\n\nWhen point is a footnote definition, move to the first reference\nfound. If it is on a reference, move to the associated\ndefinition.\n\nWhen point is on a headline, display a list of every link in the\nentry, so it is possible to pick one, or all, of them. If point\nis on a tag, call `org-tags-view' instead.\n\nOn top of syntactically correct links, this function also tries\nto open links and time-stamps in comments, node properties, and\nkeywords if point is on something looking like a timestamp or\na link." (interactive "P") #<bytecode 0x61a3bdf87b4e3f8>) nil)
org-open-at-point()
org-open-at-mouse((mouse-2 (#<window 3 on P4350_course.org> 1193 (409 . 612) 216533407 nil 1193 (24 . 14) nil (1 . 24) (17 . 42))))
funcall-interactively(org-open-at-mouse (mouse-2 (#<window 3 on P4350_course.org> 1193 (409 . 612) 216533407 nil 1193 (24 . 14) nil (1 . 24) (17 . 42))))
call-interactively(org-open-at-mouse nil nil)
command-execute(org-open-at-mouse)

Visit source buffer at location from notes

Just wondering if it is possible to "sync" current note with the source buffer in the sense that when I call a function at point under a note heading, I would be brought to the highlight position in my source.

This would probably not be as straightforward with epub support because org-remark needs to know the source file but the nov buffer is not really visiting a file when rendering the ebook.

[Feature Request] Delete notes when highlight is removed if the notes are empty

I understand the importance of having separated org-remark-remove and org-remark-delete functions, since one might want to remove the highlight without deleting any associated notes.

I also assume that when I manually delete the highlighted text (for instance, using something like kill-whole-line) org-remark calls org-remark-remove to delete the properties in the notes file, while keeping any notes there intact.

In both cases (calling org-remark-remove or manually deleting the highlighted text) it would be nice if org-remark deleted the whole heading in the notes file like org-remark-delete does, provided that there are no notes there. This would help keeping the notes file clean.

Cool package!

This is very cool package! Is there a plan to add it to melpa soon?

Display remarks in buffer as overlays?

Hi there! This looks fantastic, I love all the thoughtful touches you've put on it.

For some time I've wanted an alternative to annotate.el that stores marginalia using org-mode instead of a big alist. I love the feature of annotate.el that it can show the text as an overlay directly in the buffer and would miss it if I switched over now–would you be interested in adding that capability to org-remark?

if I marked a word ,don't mark it again

Should I execute the function org-remark-mark on a given word, said word shall be marked correspondingly. However, should I execute this function again, the said word will be marked again, which is considered as an undesirable output.
The said word should not be marked twice.
Should I execute another function on the given word, such as (org-remark-delete)
Additionally, if I mark the said word, and delete the mark thereupon, a blank line would appear in marginalia buffer.

Version 1.0.4: when does org-remark-link use an absolute path, and when not

Hi

I start to use the package frequently, and just found out that
org-remark-mark, either inserts
** Ejercicio 1 (Rutinas de Matlab y un método adaptativo): 2 puntos
:PROPERTIES:
:org-remark-beg: 253
:org-remark-end: 187
:org-remark-id: d01909f8
:org-remark-label: nil
:org-remark-link: [[file:annu_examen_mayo2022_text.m::13]]
:END:

or

** ode45
:PROPERTIES:
:org-remark-beg: 1026
:org-remark-end: 1018
:org-remark-id: aedfe90e
:org-remark-label: nil
:org-remark-link: [[file:~/ALLES/HGs/tex/vorlesungen/HGAnnu/Klausuren/Arbeit22/Mayo/Matlab/ExamenMatlabStudAnnu22/G1/Student_4004945_assignsubmission_file_/annu_examen_mayo2022_text.m::33]]
:END:

I need an absolute path, not a relative one

how can I achieve this?
regards
Uwe Brauer

Help in styling highlights?

This is a great package for doing translations! Could you help with the styling of the actual highlights? I would prefer green or blue text and an underline in the same color instead of a white highlight (on a dark theme, white text becomes almost invisible when highlighted). Thanks in advance!

prompt for 'org-remark-hidden value:' on saving buffer

hi, i'm new to org-remark, and i'm puzzled by this prompt i get on saving.

i can't see in your code where such a prompt is given, nor can i understand how to even provide it with a value that it will accept.

looks like it is coming from somewhere in org-remark-highlight-save.

not sure if i need to set things up a little more for it to work right?

buffers save 8 times on save

after adding a remark, on saving, my buffer and my notes buffer save around 8 times.

i only have really basic remarks, and only a few.

i also have an undo tree buffer being saved. i'm not sure if it is interfering with org-remark.

has anyone else seen this?

[EWW] Debugger entered--Lisp error: (wrong-type-argument number-or-marker-p nil)

In EWW with org-remark-eww-mode, you add and delete a highlight in a web page. Now there is no valid highlight on the page. You then call org-remark-next or org-remark-prev. You will get the error: (wrong-type-argument number-or-marker-p nil)

org-remark-highlights-housekeep need to be more carefully added for non-file-visitng buffers as they are not saved to trigger housekeep.

hook for notes file

Hello, thank you for org-remark. I just started using it today. Is there a hook we can use for doing things on a marginalia.org after invoking org-remark-open.

For instance, I use auto-fill in my org files, and should like to disable it for marginalia.org. It opens by default on a slim buffer already. What would be the best way to go at this?

I am now using a slightly modified org-remark-open to disable the auto-fill mode.

`nov` epub-reader and `org-noter` support

Regarding @darcamo's nov epub-reader support request above, I find:

(defun org-remark-source-find-file-name ()
  "Assumes that we are currently in the source buffer.
Returns the filename for the source buffer.  We use this filename
to identify the source buffer in all operations related to
marginal notes."
  (let ((filename (or buffer-file-name
                      (run-hook-with-args-until-success
                       'org-remark-source-find-file-name-functions))))
    filename))

It seems to me org-remark-source-find-file-name-functions can be customized to make use of, say, in-built org-noter functions that return the epub source file referenced by the org-noter--session.

Here is my preliminary setup:

  ;; compatibility with org-noter
  (defun org-noter-get-epub-source ()
    "Returns the path of the epub source from which the present session is initiated."
    (org-noter--session-property-text org-noter--session))

  (setq org-remark-source-find-file-name-functions '(org-noter-get-epub-source))

I was able to highlight and add notes to epub files viewed in nov with this simple setup.

Only issue is, the notes file, marginalia.org in this case is stored at the temporary location where the session.10e8598b3bc0292941167275239838173700000033310232 instance lives - ~/.emacs.d/.local/cache - by default.

Tried setting org-remark-notes-file-name to an absolute path, but wasn't able to change this behavior.

Any leads?

Originally posted by @sati-bodhi in #21 (comment)

org-remark-notes-display-buffer-action documentation could be more specific

Hi

I would like to try out to have the org-remark-window instead of the left margin
either on the top or button and to try to play with its size, however

(defcustom org-remark-notes-display-buffer-action
  `((display-buffer-in-side-window)
    (side . left)
    (slot . 1))
  "Buffer display action that Org-remark uses to open marginal notes buffer.

does not provide much information how to achieve that.

thanks
Uwe Brauer

Using org-remark with buffers not associated with a file

Hello,
I was trying to setup integration between org-remark and zetteldesk.el and was facing some issues.
Zetteldesk.el is a library that creates the so-called "desktop" described in How to Take Smart Notes, a buffer where you can gather all your org-roam nodes (and more generally your information sources) for use in revision, outlining and creating manuscripts. From the inception of this, I was thinking it would definitely be useful to have the ability to annotate the buffer and write notes on each node. Naturally, this buffer isn't associated with any file, so I have been having some difficulties with org-remark due to it needing a file.

I wrote an advice function trying to solve this starting with org-remark-mark, which should highlight the section and save it in a specified file. It takes the heading's title, finds a node associated with it (which in my system will yield a result) and with that file-name and does the part org-remark-mark missed. Here is the code for it

(defun zetteldesk-remark-highlight-advice
    (beg end &optional id mode label face properties)
  "Advice function to be used with `org-remark-highlight-mark'.

If the current buffer isn't associated to a file, find the
heading's title, associate it with an org-roam-node and find the
file associated with that node. Then run the part of
`org-remark-highlight-save' that wasn't ran if the buffer isn't
associated with a file. This part is a call to
`org-remark-highlight-save'.

This is meant to be used when taking margin notes from the
*zetteldesk-scratch* buffer. However, this will only work if the
current heading's title is associated with a node. In this case
org-remark will be able to associate the margin note with the
node its related to."
  (unless buffer-file-name
    (let* ((title (org-entry-get nil "ITEM"))
	   (node (org-roam-node-from-title-or-alias title))
	   (file (org-roam-node-file node))
	   (org-remark-notes-file-name
	    (concat org-roam-directory "zetteldesk-margin-notes.org"))
	   (ov (make-overlay beg end nil :front-advance)))
      (org-remark-highlight-save file
				 beg end
				 (overlay-properties ov)
				 title))))

(advice-add 'org-remark-highlight-mark :after #'zetteldesk-remark-highlight-advice)

However, this does not appear to be ample. This will make org-remark-mark have the behavior I want, however, the rest of the package won't interface properly with this, meaning that I will need to write advice (or in some cases maybe rewrite functions) for all the functionality I need.

Since this is a feature I am interested in, I am considering trying it, even if it will have difficulties. However, I thought I should ask if there is any plan for something like this or if you have any ideas for helping me in this endeavor. I think it would benefit both packages to have the ability to use org-remark in buffers not associated with a file.

Thanks in advance for your help,
Best regards,
Vidianos

source code edit buffer in org-mode

Hi
When working with code blocks in org-mode it would be useful if we could use org-remark when we are in the code edit buffer that you get after doing C-c '. Currently it says buffer is not supported.

thanks
FKG

❦❦❦ IMPORTANT NOTICE ❦❦❦ on name change

❦❦❦ IMPORTANT NOTICE ❦❦❦

[This notice written on 3 January 2022]

Happy 2022!

I am finalizing the the name of the package and GitHub repo. See PR #10. It’s probably going to be ”Org-remark”. The dev/name-change branch contains all the changes pertaining to the name change along some additional features – most notably, different highlighter pen colors and capability to let you create different pens (an idea borrowed from John Kitchin’s Ov-highlight).

There will be some minor breaking changes, which I am going through right now in my own machine. I will document the ways to bridge the breakages; nothing really major and I’m also trying to make the new version as backward compatible as possible from my lessons learnt.

After the change, I will propose the package to be added to ELPA.

I would appreciate any feedback or comment via PR #10, Org-roam discourse, or direct email (probably not Slack or Reddit as I’m really not present on these media).

marks not associated with a file in eww?

Hello
I tried to visit a website and used org-remark-mark to mark a highlight. This is the message that I received.

org-remark: Highlights not saved; buffer is not visiting a file 

Please advise.
thanks
Peter

Exclude pdfs from default file type

Org-remark doesn't work with PDFs.

This is because of the PDF file structure, which EMACS renders as images. As a result, annotations are handled differently within the PDF file specification.

When we accidentally call org-remark-mark on a PDF, we get the following text inserted into marginalia.org:

* Mind, Self, and Society from the Standpoint of a Social Behaviorist
:PROPERTIES:
:org-remark-file: ../../Zotero/storage/8KBMIA4U/Mind, Self, and Society from the Standpoint of a Social Behaviorist.pdf
:END:

** %
:PROPERTIES:
:org-remark-beg: 1
:org-remark-end: 2
:org-remark-id: da48727d
:org-remark-label: nil
:org-remark-link: [[file:../../Zotero/storage/8KBMIA4U/Mind, Self, and Society from the Standpoint of a Social Behaviorist.pdf::1]]
:END:

We can do nothing about it except manually remove the insertion from the file, which is an inconvenience that disrupts the reading workflow.

Could some kind of filter be written to exclude pdf-view-mode from the default set up?

Highlight, not underline

I am not able to highlight, but underline only. Is this the default behaviour?

According to the guidelines to create highlights, this should create a yellow highlight, but I only see an underline:

  (org-remark-create "yellow"
                     '(:underline "gold" :background "yellow" :foreground:"black")
                     '(CATEGORY "important"))

Why not removing the full note?

The documentation of org-marginalia-remove states that

It will remove the highlight, and remove the properties from the marginalia, but will keep the headline and notes.

What's the reason for this?

I was very surprised when I observed this behaviour. Is there some way of making org-marginalia-remove remove the full note?

Fix source-file-name incorrect issue

This is the issue addressed by PR #38

find-file-noselect makes nodes buffer as current buffer, after that,
org-remark-source-get-file-name will get the notes buffer's file
name(marginalia.org) instead of the source file name. So org remark
will report warning message like No highlights or annotations found for marginalia.org

The fix finds source file name first, then set notes-buf.

remarks get displaced/offset from their word

as i edit my file, i find my org-remark annotations drift away from what they originally marked.

i have random, unrelated things annotated, and don't know where the annotations belong.

at the moment i don't have any further debug-info about this. if i obtain any i'll report back.

start-end highlight positions get messed up when long documents are edited

Though I am unable to come up with a reproducible scenario for this bug upfront, I've had experience of highlights being displaced when a relatively long (>600 lines) document is edited.

I have worked on similar issues before and the solution (or hack) I came up with is to perform a search for the precise string in question on the line or relevant region itself to double-check start-end positions whenever the document is edited.

This would probably take up (significantly) more computing resources, especially when highlights are many. But it fixes the problem.

I have not figured out why relative regions run awry easily, even when changes are traceable and meticulously synchronized.

workflow query

hi again,

i have a query about workflow.

to me it would make sense if a) when you create a remark the notes buffer also opens and is active, and b) you cd hit C-c C-c or similar when done to save and close the notes buffer and return to your work.

i guess this is based on a lot of other workflow habits, like annotating pdfs, or org-capture, etc.

it's also fast, especially when all you need to do is attach something to your text, and move on right away.

is there a reason org-remark avoids this approach? or am i doing it wrong maybe?

unable to load package on windows

Hi,
I don't reckon it's an actual issue with the package, although I don't have this issue with any other package..
I'm on doom - so I added org-remark to the packages file and synced - and I saw that the package was fetched and built, but I can't see any of its functions, and can't locate-library it. I also tried to M-x package-install it, but couldn't find it there(??).
I'd appreciate any direction, thanks!

Could notes be saved within the annotated file?

This package looks very nice.
I am not a big fan of the annotations being in a separate file as it makes sharing difficult. I am also curious what happens when you have more than one org file being annotated in the same directory. I wonder whether it would be possible to have the annotations stored within the same file, e.g. as a separate top level heading?

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.