branch: externals/org-remark commit 3d6207ae2016cdd67453314523720f98abd94276 Author: Noboru Ota <m...@nobiot.com> Commit: Noboru Ota <m...@nobiot.com>
doc: Update doc --- README.org | 11 ++++++----- marginalia.org | 10 +++------- org-marginalia.el | 41 ++++++++++++++++++++++++++++------------- 3 files changed, 37 insertions(+), 25 deletions(-) diff --git a/README.org b/README.org index dc43890fec..c87e0d150a 100644 --- a/README.org +++ b/README.org @@ -26,9 +26,11 @@ Org-marginalia lets you write margin notes (marginalia) for any text files in a :CONTENTS: - [[#installation][Installation]] - [[#usage][Usage]] +- [[#customizing][Customizing]] +- [[#known-limitations][Known Limitations]] - [[#changelog][Changelog]] - [[#credits][Credits]] -- [[#development][Development]] +- [[#feedback][Feedback]] - [[#license][License]] :END: @@ -79,13 +81,13 @@ This command open the marginalia file and load the saved highlights onto current - =om/remove= :: This command removes the highlight at point. It will remove the highlight, and remove the properties from the marginalia, but will keep the headline and notes in tact. -** Customizing +* Customizing - You can customize settings in the =org-marginalia= group. - Highlight face can be changed via =om/highlight= - Marginalia file is defined with =om/notes-file-path= -** Known Limitations +* Known Limitations - Turning off minor mode does not turn off the highlights :: This should not do any harm, but if you are distracted, kill the buffer (not revert) and visit it again. Toggling show/hide of highlights is something I would like to add later. - Copy & pasting loses highlights :: You could manually recover it by adjusting the properties in the margin notes file. @@ -107,8 +109,7 @@ To create this package, I was inspired by the following packages. I did not copy - [[https://github.com/tkf/org-mode/blob/master/contrib/lisp/org-annotate-file.el][Org-annotate-file]] :: Part of Org's contrib library. It seems to be designed to annotate a whole file in a separate Org file, rather than specific text items - [[https://github.com/IdoMagal/ipa.el][InPlaceAnnotations (ipa-mode)]] :: It looks similar to Annotate.el above - -* Development +* Feedback Feedback welcome in this repo, or in [[https://org-roam.discourse.group/t/prototype-org-marginalia-write-margin-notes-with-org-mode/1080][Org-roam Discourse forum]]. diff --git a/marginalia.org b/marginalia.org index f4d136d4db..b4041ee473 100644 --- a/marginalia.org +++ b/marginalia.org @@ -7,14 +7,10 @@ :marginalia-source-file: ~/local-repos/org-marginalia/README.org :END: -** - =om/mark= (=C-c m= by default) :: -[[file:~/local-repos/org-marginalia/README.org][Org-marginalia]] -It works :) - ** Screenshots :PROPERTIES: -:marginalia-id: db316c9a -:marginalia-source-beg: 332 -:marginalia-source-end: 343 +:marginalia-id: 1306ba7f +:marginalia-source-beg: 494 +:marginalia-source-end: 505 :END: [[file:~/local-repos/org-marginalia/README.org][Org-marginalia]] diff --git a/org-marginalia.el b/org-marginalia.el index 7b99e3372f..d1f8b3ab68 100644 --- a/org-marginalia.el +++ b/org-marginalia.el @@ -32,7 +32,7 @@ ;;;;; MELPA -;; It's yet to be on MELPA. Manual installation required. +;; This package is not available on MELPA. Manual installation required. ;;;;; Manual @@ -43,10 +43,7 @@ ;; Then put this file in your load-path, and put this in your init ;; file: - -(require 'org) -(declare-function org-id-uuid 'org-id) -(declare-function org-collect-keywords 'org) +;; (require 'org-marginalia) ;;;; Usage @@ -106,17 +103,37 @@ ;;;; Credits -;; This package would not have been possible without the following -;; packages: foo[1], which showed me how to bifurcate, and bar[2], -;; which takes care of flanges. -;; -;; [1] https://example.com/foo.el -;; [2] https://example.com/bar.el +;; To create this package, I was inspired by the following packages. I did not +;; copy any part of them, but borrowed some ideas from them -- e.g. saving the +;; margin notes in a separate file. + +;; - [[https://github.com/jkitchin/ov-highlight][ov-highlight]] +;; John Kitchin's (author of Org-ref). Great UX for markers with hydra. +;; Saves the marker info and comments directly within the Org file as Base64 +;; encoded string. It uses overlays. + +;; - [[https://github.com/bastibe/annotate.el][Annotate.el]] +;; Bastian Bechtold's (author of Org-journal). Unique display of annotations +;; right next to (or on top of) the text. It seems to be designed for very +;; short annotations, and perhaps for code review (programming practice); I +;; have seen recent issues reported when used with variable-pitch fonts +;; (prose). + +;; - [[https://github.com/tkf/org-mode/blob/master/contrib/lisp/org-annotate-file.el][Org-annotate-file]] +;; Part of Org's contrib library. It seems to be designed to annotate a +;; whole file in a separate Org file, rather than specific text items + +;; - [[https://github.com/IdoMagal/ipa.el][InPlaceAnnotations (ipa-mode)]] +;; It looks similar to Annotate.el above ;;; Code: ;;;; Requirements +(require 'org) +(declare-function org-id-uuid 'org-id) +(declare-function org-collect-keywords 'org) + ;;;; Customization (defgroup org-marginalia nil @@ -182,12 +199,10 @@ beginning point; this should be useful when `om/next' and (when (not id) (setq id (substring (org-id-uuid) 0 8))) ;; Add highlight to the text (add-text-properties beg end '(font-lock-face om/highlighter)) - ;; This beg and end are not always in sync when you change the text in it (add-text-properties beg end `(om/id ,id)) ;; Keep track in a local variable It's alist; don't forget the dot ;; (beg . end) ;; The dot "." is imporant to make the car/cdr "getter" interface clean. - ;; Also, `set-marker-insertion-type' to set the type t is necessary to move ;; the cursor in sync with the font-lock-face property of the text property. (push `(,id