branch: externals/org-remark commit ce1fd7bb237bce31db6ddc2b5c8ce8365798bd8a Author: Noboru Ota <m...@nobiot.com> Commit: Noboru Ota <m...@nobiot.com>
doc: Update for transient navigation (next/prev) --- README.org | 39 +++++++++++++++++++++++++++------------ org-marginalia.el | 50 ++++++++++++++++++++++++++++++++------------------ 2 files changed, 59 insertions(+), 30 deletions(-) diff --git a/README.org b/README.org index 660aeca4da..5013e1b311 100644 --- a/README.org +++ b/README.org @@ -97,8 +97,18 @@ This command removes the highlight at point. It will remove the highlight, and r - =om/next= (=C-c n ]= by default) :: Move to the next highlight if any. If there is none below the cursor, and there is a highlight above, loop back to the top one. +If the point has moved to the next highlight, this function enables transient map with `set-transient-map'. You don't have to press the keybinding prefix again to move further to the next. That is, you can do a key sequence like this: + + =C-c n ] ] ] ]= + +If you have the same prefix for `om/prev', you can combine it in +the sequence like so: + + =C-c n ] ] [ [= + This lets your cursor back to where you started (next next prev prev) + - =om/prev= (=C-c n [= by default) :: -Move to the previous highlight if any. If there is none above the cursor, and there is a highlight below, loop back to the bottom one. +Move to the previous highlight if any. If there is none above the cursor, and there is a highlight below, loop back to the bottom one. This function enables transient map. See =om/next= for detail. - =om/toggle= :: Toggle showing/hiding of highlighters in current buffer. It only affects the display of the highlighters. When hidden, highlights' locations are still kept tracked; thus, upon buffer-save the correct locations are still recorded in the marginalia file. @@ -126,6 +136,9 @@ Personally I have never experienced such performance issues with overlays; never :TOC: :depth 0 :END: +** 0.0.4 +- feat: Add transient navigation to next/prev + ** 0.0.3 - feat: Add om/toggle for show/hide highlighters @@ -155,7 +168,6 @@ I am aiming to keep this package to be small and focused. I plan to add the foll 2. =om/next= and =om/prev= to easily navigate highlighted regions in the buffer This is done (v0.0.2), but I would like to try a transient (don't want to repeat the prefix everytime). - * License This work is licensed under a GPLv3 license. For a full copy of the licese, refer to [[./LICENSE][LICENSE]]. @@ -169,8 +181,8 @@ This section is used as a demonstration and a collection of my ideas for this pa ** :PROPERTIES: :marginalia-id: 33710cc4 -:marginalia-source-beg: 21619 -:marginalia-source-end: 21619 +:marginalia-source-beg: 23896 +:marginalia-source-end: 23896 :END: [[file:~/local-repos/org-marginalia/org-marginalia.el][org-marginalia]] I need to think it through. @@ -180,29 +192,32 @@ At the moment, ~om/list-highlights-positions~ has been changed to return beginni ** (defgroup org-marginalia :PROPERTIES: :marginalia-id: 0d953675 -:marginalia-source-beg: 6402 -:marginalia-source-end: 6426 +:marginalia-source-beg: 6921 +:marginalia-source-end: 6945 :END: +For demonstration [[file:~/local-repos/org-marginalia/org-marginalia.el][org-marginalia]] ** (defface om/highlighter :PROPERTIES: :marginalia-id: 8ccff166 -:marginalia-source-beg: 6617 -:marginalia-source-end: 6640 +:marginalia-source-beg: 7136 +:marginalia-source-end: 7159 :END: +For demonstration [[file:~/local-repos/org-marginalia/org-marginalia.el][org-marginalia]] ** :PROPERTIES: :marginalia-id: 9f60c405 -:marginalia-source-beg: 21619 -:marginalia-source-end: 21619 +:marginalia-source-beg: 23896 +:marginalia-source-end: 23896 :END: +Keepting this one for testing for later [[file:~/local-repos/org-marginalia/org-marginalia.el][org-marginalia]] ** defun om/mark :PROPERTIES: :marginalia-id: b652604e -:marginalia-source-beg: 9101 -:marginalia-source-end: 9114 +:marginalia-source-beg: 9620 +:marginalia-source-end: 9633 :END: [[file:~/local-repos/org-marginalia/org-marginalia.el][org-marginalia]] Some syntactic elements keep their faces descpite being marked. diff --git a/org-marginalia.el b/org-marginalia.el index f8d3b4d640..d22a46393d 100644 --- a/org-marginalia.el +++ b/org-marginalia.el @@ -48,27 +48,27 @@ ;;;; Usage -;; - =org-marginalia-mode= :: +;; - `org-marginalia-mode' :: ;; Org-marginalia is a local minor mode. Toggle it on/off with using -;; =org-marginalia-mode=. On activating, it loads your saved highlighters from +;; `org-marginalia-mode'. On activating, it loads your saved highlighters from ;; the marginalia file, and enables automatic saving of highlighters. The -;; automatic saving is achieved via function =om/save= added to -;; =after-save-hook=. +;; automatic saving is achieved via function `om/save' added to +;; `after-save-hook'. -;; - =om/mark= (C-c n m by default) :: -;; Select a region of text, and call =om/mark= (bound to =C-c n m= by default) +;; - `om/mark' (C-c n m by default) :: +;; Select a region of text, and call `om/mark' (bound to C-c n m by default) ;; to highlight the region. It will generate a new ID, and start tracking the ;; location -- so you can edit text around the marked text. Do not copy and ;; paste as it will disappear and it is a bit tricky to recover the ;; highlighter. To create a new margin note entry in themarginalia file, save the buffer. -;; - =om/save= :: +;; - `om/save' :: ;; By default, Org-marginalia creates or updates the highlighter's location ;; and text inside automatically in the marginalia file. You can manually call -;; =om/save= to manually do it (automatic process also call this command). +;; `om/save' to manually do it (automatic process also call this command). -;; - =om/open= (C-c o by default) :: -;; Move your cursor on the highlighted text, and call =om/open= to open the +;; - `om/open' (C-c o by default) :: +;; Move your cursor on the highlighted text, and call `om/open' to open the ;; relevant margin notes in a separate window. Your cursor should move to the ;; marginalia buffer narrowed to the relevant margin notes entry. You can edit ;; the margin notes as a normal Org file. Once you have done editing, you can @@ -76,28 +76,42 @@ ;; normal workflow. Technically, the marginalia buffer is a cloned indirect ;; buffer of the marginalia file. -;; - =om/load= :: +;; - `om/load' :: ;; This command open the marginalia file and load the saved highlights onto ;; current buffer. If there is no margin notes for it, it will output a ;; message in the echo. Highlights tracked locally by this packages cannot ;; persist when you kill the buffer, or quit Emacs. When you re-launch Emacs, -;; ensure to turn on =org-marginalia-mode= to load the highlights. Load is +;; ensure to turn on `org-marginalia-mode' to load the highlights. Load is ;; automatically done when you activate the minor mode. -;; - =om/remove= :: +;; - `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. -;; - =om/next= (C-c n ] by default) :: +;; - `om/next' (C-c n ] by default) :: ;; Move to the next highlight if any. If there is none below the cursor, and ;; there is a highlight above, loop back to the top one. -;; - =om/prev= (C-c n [ by default) :: -;; Move to the previous highlight if any. If there is none above the cursor, -;; and there is a highlight below, loop back to the bottom one. +;; If the point has moved to the next highlight, this function enables +;; transient map with `set-transient-map'. You don't have to press the +;; keybinding prefix again to move further to the next. That is, you can do a +;; key sequence like this: -;; - =om/toggle= :: +;; C-c n ] ] ] ] + +;; If you have the same prefix for `om/prev', you can combine it in the +;; sequence like so: + +;; C-c n ] ] [ [ +;; This lets your cursor back to where you started (next next prev prev) + +;; - `om/prev' (C-c n [ by default) :: Move to the previous highlight if any. +;; If there is none above the cursor, and there is a highlight below, loop +;; back to the bottom one. This function enables transient map. See `om/next' +;; for detail. + +;; - `om/toggle' :: ;; Toggle showing/hiding of highlighters in current buffer. It only affects ;; the display of the highlighters. When hidden, highlights' locations are ;; still kept tracked; thus, upon buffer-save the correct locations are still