org-remark icon indicating copy to clipboard operation
org-remark copied to clipboard

Suggestions for org-remark-mark-line (multiple lines, and automatic sentences)

Open Ypot opened this issue 6 months ago • 2 comments

Dear Nobiot

I propose two features to improve org-remark-mark-line:

  1. Multi-Line Selection for Single Note: Allow org-remark-mark-line to mark multiple lines in a region as a single marginal note, similar to org-remark-mark for words. If there are several lines marked, just to create 1 marginal note when evaluating org-remark-mark-line

  2. Automatic Sentence Marking: It would be nice to have the option to mark full sentences (using sentences boundaries) automatically.

These would enhance annotation workflows in Org-mode. Happy to discuss further!

Best regards

Ypot avatar Jun 29 '25 00:06 Ypot

Hi @Ypot , No worries.

Point 1.

I have been trying to implement 1 since I started the initial design of line highlights -- so, on it for a couple of years, if I am not mistaken. I have finally found a good-enough design that may solve the problem: https://git.sr.ht/~nobiot/chu. I am hoping to take some time toward the end of this year to re-implement the highlighting logic of Org-remark (the whole thing) based on the linked library I have been experimenting.

Point 2.

I am not keen to implement it as part of org-remark. How about something like this?

(defun my/highlight-sentence ()
  "Highlight a sentence at point with `org-remark-mark'."
  (interactive)
  (if-let* ((beg-end (bounds-of-thing-at-point 'sentence))
             (beg (car beg-end))
             (end (cdr beg-end)))
      (org-remark-mark beg end)
    (user-error "No sentence can be selected")))

nobiot avatar Jul 03 '25 09:07 nobiot

Thanks!

Point 1. https://git.sr.ht/~nobiot/chu

Then will it be possible to write in epubs directly? That sounds great! It would be very interesting to use org-mode emphasis hardcoded by the user in such case!

Point 2. As you shared, the script works great. But I wanted to mark full sentences with org-remark-mark-line: It finds well the beggining of the sentences, but it only finds the end if it is at the end of a paragraph.

I tried this. It finds well the beggining of the sentences, but it only finds the end if it is at the end of a paragraph.

(defun my/highlight-sentence ()
  "Highlight a sentence at point with `org-remark-mark'."
  (interactive)
  (if-let* ((beg-end (bounds-of-thing-at-point 'sentence))
             (beg (car beg-end))
             (end (cdr beg-end)))
      (org-remark-mark-line beg end)
    (user-error "No sentence can be selected")))

Anyway, your script will be useful too, thanks.

Ypot avatar Jul 03 '25 17:07 Ypot