branch: externals/org-remark commit 2687b8eabf6aca05fed31b2a86a59751f02bda28 Merge: de889ea114 66da9a3fb9 Author: Noboru Ota <m...@nobiot.com> Commit: Noboru Ota <m...@nobiot.com>
admin: merging two machines on my end --- README.org | 14 ++++-- ...efractions,_inflexions_and_colours_of_light.png | Bin 0 -> 352833 bytes demo/demo.txt | 7 +++ demo/marginalia.org | 46 +++++++++++++++++++ marginalia.org | 51 ++++++++++----------- resources/images/2020-12-24T101116_Title.png | Bin 0 -> 988035 bytes 6 files changed, 87 insertions(+), 31 deletions(-) diff --git a/README.org b/README.org index b641d6ae00..1197954b04 100644 --- a/README.org +++ b/README.org @@ -6,14 +6,14 @@ # Note: I use the readme template that alphapapa shares on his GitHub repo <https://github.com/alphapapa/emacs-package-dev-handbook#template>. It works with the org-make-toc <https://github.com/alphapapa/org-make-toc> package, which automatically updates the table of contents. -Org-marginalia lets you highlight text, and write margin notes (marginalia) for any text file in a separate Org file. Refer to the screenshots below for a teaser of what it can do. +Org-marginalia lets you highlight text, and write margin notes (marginalia) for any text file in a separate Org file. -Technically, it implements the highlighting feature solely with text properties, and avoids overlays. This is done in light of oft-mentioned performance degradation with the latter. - -Personally I have never experienced such performance issues with overlays; nevertheless, given that we might have many highlighted text regions in a single file, I thought I would take this as an opportunity to take advantage of text properties. +[[./resources/images/2020-12-24T101116_Title.png]] * Screenshots +Refer to the screenshots below for a teaser of what it can do. + [[./resources/images/2020-12-22T141331-OM-screen-shot-01.png]] *Figure 1*. Left: main note with some text highlighted in green; Right: margin notes in a marginalia file @@ -31,6 +31,7 @@ Personally I have never experienced such performance issues with overlays; never - [[#installation][Installation]] - [[#usage][Usage]] - [[#customizing][Customizing]] +- [[#text-properties-not-overlays][Text-properties, Not Overlays]] - [[#known-limitations][Known Limitations]] - [[#changelog][Changelog]] - [[#credits][Credits]] @@ -101,6 +102,11 @@ Toggle showing/hiding of highlighters in current buffer. It only affects the dis - Highlight's face can be changed via =om/highlighter= - Marginalia file is defined by =om/notes-file-path= +* Text-properties, Not Overlays +Technically, Org-marginalia implements the highlighting feature solely with text properties, and avoids overlays. This is done in light of oft-mentioned performance degradation with the latter. + +Personally I have never experienced such performance issues with overlays; nevertheless, given that we might have many highlighted text regions in a single file, I thought I would take this as an opportunity to take advantage of text properties. + * 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. diff --git a/demo/Marginalia_from_Opticks_or,_A_treatise_of_the_reflexions,_refractions,_inflexions_and_colours_of_light.png b/demo/Marginalia_from_Opticks_or,_A_treatise_of_the_reflexions,_refractions,_inflexions_and_colours_of_light.png new file mode 100644 index 0000000000..5bdcb1cab1 Binary files /dev/null and b/demo/Marginalia_from_Opticks_or,_A_treatise_of_the_reflexions,_refractions,_inflexions_and_colours_of_light.png differ diff --git a/demo/demo.txt b/demo/demo.txt new file mode 100644 index 0000000000..443f2879aa --- /dev/null +++ b/demo/demo.txt @@ -0,0 +1,7 @@ + + *Org-marginalia* + + Highlight text; + write marginalia for any + text file. + diff --git a/demo/marginalia.org b/demo/marginalia.org new file mode 100644 index 0000000000..7fc2f481c6 --- /dev/null +++ b/demo/marginalia.org @@ -0,0 +1,46 @@ + +* demo +:PROPERTIES: +:marginalia-source-file: ~/local-repos/org-marginalia/demo/demo.txt +:END: + +** marginalia +:PROPERTIES: +:marginalia-id: cba8da6a +:marginalia-source-beg: 51 +:marginalia-source-end: 61 +:END: +[[file:~/local-repos/org-marginalia/demo/demo.txt][demo]] + +*** Definition +*Notes in the margin of a document*. [from 1830s] +Source: https://en.wiktionary.org/wiki/marginalia + +Synonyms: apostil, marginal note, gloss + +We know what the composer was thinking as he wrote the piece because we can read his handwritten marginalia on the manuscript. + +*** Pronunciation +(General American) IPA(key): /mɑɹdʒɪˈneɪli.ə/ +(Received Pronunciation) IPA(key): /mɑːdʒɪˈneɪli.ə/ +Rhymes: -eɪliə +Hyphenation: mar‧gi‧na‧lia + +*** Etymology +From New Latin marginālia, from Medieval Latin neuter plural of marginālis (“on the periphery”), from Latin margō (“border, edge”). Compare margin. +[[file:Marginalia_from_Opticks_or,_A_treatise_of_the_reflexions,_refractions,_inflexions_and_colours_of_light.png]] +Marginalia from Opticks or, A treatise of the reflexions, refractions, inflexions and colours of light, is lincensed under CC BY 2.0. Obtained via https://en.wiktionary.org/wiki/marginalia + + +* marginalia +:PROPERTIES: +:marginalia-source-file: ~/local-repos/org-marginalia/demo/marginalia.org +:END: + +** *Notes in the margin of a document +:PROPERTIES: +:marginalia-id: 929981c5 +:marginalia-source-beg: 283 +:marginalia-source-end: 317 +:END: +[[file:~/local-repos/org-marginalia/demo/marginalia.org][marginalia]] diff --git a/marginalia.org b/marginalia.org index a55cc2e1d1..795d2ffd91 100644 --- a/marginalia.org +++ b/marginalia.org @@ -10,8 +10,8 @@ ** Screenshots :PROPERTIES: :marginalia-id: 1306ba7f -:marginalia-source-beg: 1007 -:marginalia-source-end: 1018 +:marginalia-source-beg: 566 +:marginalia-source-end: 577 :END: [[file:~/local-repos/org-marginalia/README.org][Org-marginalia]] @@ -40,10 +40,21 @@ For listing, built-in `tabulated-list-mode` exists. Additionallly, hierarchy.el, ** g . ,end) highlights)))))) [[file:~/local-repos/org-marginalia/org-marginalia.el][org-marginalia]] -** ght) +** +:PROPERTIES: +:marginalia-id: 3cf97a37 +:marginalia-source-beg: 22494 +:marginalia-source-end: 22494 +:END: [[file:~/local-repos/org-marginalia/org-marginalia.el][org-marginalia]] -** variable-pitch f +** +:PROPERTIES: +:marginalia-id: c16e73f8 +:marginalia-source-beg: 22494 +:marginalia-source-end: 22494 +:END: +>>>>>>> 66da9a3fb918f598ff6fbc169fa4ac78172a8604 [[file:~/local-repos/org-marginalia/org-marginalia.el][org-marginalia]] (defun om/list-highlights-positions () "This is an empty function definition to be replaced by a real one later. @@ -52,33 +63,19 @@ this file, as it is a utility function. This empty declation is necessary in to avoid the macro expansion from failing for `seq-find'.") -** h f -[[file:~/local-repos/org-marginalia/org-marginalia.el][org-marginalia]] - -** t-properties beg end '(om/hidden)) -[[file:~/local-repos/org-marginalia/org-marginalia.el][org-marginalia]] -Note that you can use markers directly wihtin add/remove-text-properties functions. -No need to replace specifically markers with points. - -** (defvar-local om/highlights '() -[[file:~/local-repos/org-marginalia/org-marginalia.el][org-marginalia]] - -** ;;;###autoload -[[file:~/local-repos/org-marginalia/org-marginalia.el][org-marginalia]] - -** defvar-local om/highlights +** :PROPERTIES: -:marginalia-id: 7ece4f53 -:marginalia-source-beg: 7182 -:marginalia-source-end: 7208 +:marginalia-id: f55e13ab +:marginalia-source-beg: 22494 +:marginalia-source-end: 22494 :END: [[file:~/local-repos/org-marginalia/org-marginalia.el][org-marginalia]] -This is a margin note for the Org-marginalia source code. -** define-minor-mode org-marginalia-mode +** :PROPERTIES: -:marginalia-id: d4ec82f4 -:marginalia-source-beg: 7941 -:marginalia-source-end: 7978 +:marginalia-id: 74fd21ea +:marginalia-source-beg: 22494 +:marginalia-source-end: 22494 +>>>>>>> 66da9a3fb918f598ff6fbc169fa4ac78172a8604 :END: [[file:~/local-repos/org-marginalia/org-marginalia.el][org-marginalia]] diff --git a/resources/images/2020-12-24T101116_Title.png b/resources/images/2020-12-24T101116_Title.png new file mode 100644 index 0000000000..4fe013b811 Binary files /dev/null and b/resources/images/2020-12-24T101116_Title.png differ