[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/org-remark 3af3a47e1b 047/173: feat: Add transient navi
From: |
ELPA Syncer |
Subject: |
[elpa] externals/org-remark 3af3a47e1b 047/173: feat: Add transient navigation to next/prev |
Date: |
Fri, 28 Jan 2022 16:57:58 -0500 (EST) |
branch: externals/org-remark
commit 3af3a47e1b1e8fb37ee93165b11d9a3a1ab2bcd3
Author: Noboru Ota <me@nobiot.com>
Commit: Noboru Ota <me@nobiot.com>
feat: Add transient navigation to next/prev
---
org-marginalia.el | 54 ++++++++++++++++++++++++++++++++++++++++++++++++++----
1 file changed, 50 insertions(+), 4 deletions(-)
diff --git a/org-marginalia.el b/org-marginalia.el
index 9aa76b81f1..f8d3b4d640 100644
--- a/org-marginalia.el
+++ b/org-marginalia.el
@@ -381,23 +381,69 @@ marginalia, but will keep the headline and notes."
(defun om/next ()
"Look at the current point, and move to the next highlight, if any.
If there is none below the point, but there is a highlight in the
-buffer, go back to the first one."
+buffer, go back to the first 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 \] \] \[ \[
+
+"
(interactive)
(if (not om/highlights)
(progn (message "No highlights present in this buffer.") nil)
(let ((p (om/find-next-highlight)))
- (if p (progn (goto-char p) t)
+ (if p (progn
+ (goto-char p)
+ ;; Setup the overriding keymap.
+ (unless overriding-terminal-local-map
+ (let ((prefix-keys (substring (this-single-command-keys) 0 -1))
+ (map (cdr org-marginalia-mode-map)))
+ (when (< 0 (length prefix-keys))
+ (mapc (lambda (k) (setq map (assq k map))) prefix-keys)
+ (setq map (cdr-safe map))
+ (when (keymapp map) (set-transient-map map t)))))
+ t)
(message "Nothing done. No more visible highlights exist") nil))))
(defun om/prev ()
"Look at the current point, and move to the previous highlight, if any.
If there is none above the point, but there is a highlight in the
-buffer, go back to the last one."
+buffer, go back to the last one.
+
+If the point has moved to the previous 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/next', you can combine it in
+the sequence like so:
+
+ C-c n \] \] \[ \["
(interactive)
(if (not om/highlights)
(progn (message "No highlights present in this buffer.") nil)
(let ((p (om/find-prev-highlight)))
- (if p (progn (goto-char p) t)
+ (if p (progn
+ (goto-char p)
+ ;; Setup the overriding keymap.
+ (unless overriding-terminal-local-map
+ (let ((prefix-keys (substring (this-single-command-keys) 0 -1))
+ (map (cdr org-marginalia-mode-map)))
+ (when (< 0 (length prefix-keys))
+ (mapc (lambda (k) (setq map (assq k map))) prefix-keys)
+ (setq map (cdr-safe map))
+ (when (keymapp map) (set-transient-map map t)))))
+ t)
(message "Nothing done. No more visible highlights exist") nil))))
(defun om/toggle ()
- [elpa] externals/org-remark 1dd28ecd4c 081/173: lint, (continued)
- [elpa] externals/org-remark 1dd28ecd4c 081/173: lint, ELPA Syncer, 2022/01/28
- [elpa] externals/org-remark 029efeb2a0 084/173: doc: README, ELPA Syncer, 2022/01/28
- [elpa] externals/org-remark 4e28dd1923 092/173: add: load works with a different pen, ELPA Syncer, 2022/01/28
- [elpa] externals/org-remark f9e432b486 103/173: docs: org-remark documentation, ELPA Syncer, 2022/01/28
- [elpa] externals/org-remark 73e332b1d5 113/173: add: convert-legacy-data + refactor, ELPA Syncer, 2022/01/28
- [elpa] externals/org-remark 2954965bb3 127/173: add: define org-remark-mark explicitly for autoload cookie, ELPA Syncer, 2022/01/28
- [elpa] externals/org-remark e27e0d6dad 023/173: feat: Add om/toggle for show/hide highlighters, ELPA Syncer, 2022/01/28
- [elpa] externals/org-remark bfeffae259 027/173: doc: Minor update, ELPA Syncer, 2022/01/28
- [elpa] externals/org-remark 6be3fc988b 039/173: doc: Minor update, ELPA Syncer, 2022/01/28
- [elpa] externals/org-remark 3c270b4e28 025/173: doc: Update readme with a title screen, ELPA Syncer, 2022/01/28
- [elpa] externals/org-remark 3af3a47e1b 047/173: feat: Add transient navigation to next/prev,
ELPA Syncer <=
- [elpa] externals/org-remark d8908d6aba 054/173: doc: fix code example in README, ELPA Syncer, 2022/01/28
- [elpa] externals/org-remark f9c313342c 067/173: chg: separate global-tracking.el, ELPA Syncer, 2022/01/28
- [elpa] externals/org-remark a42ca0f756 066/173: readme for marginalia, ELPA Syncer, 2022/01/28
- [elpa] externals/org-remark e78f549267 069/173: intrnl: housekeep to save; refactor remove, ELPA Syncer, 2022/01/28
- [elpa] externals/org-remark 7176e9d460 073/173: add: ID inherits. fix: housekeep, ELPA Syncer, 2022/01/28
- [elpa] externals/org-remark 9bb66a742e 074/173: fix: overlay front-advance, ELPA Syncer, 2022/01/28
- [elpa] externals/org-remark 2ed345c66c 071/173: rm: create-id option, ELPA Syncer, 2022/01/28
- [elpa] externals/org-remark b6e6a55f63 075/173: chg: customization notes-file-path type to file, ELPA Syncer, 2022/01/28
- [elpa] externals/org-remark ca0c0ac674 080/173: doc: global-tracking docstring, ELPA Syncer, 2022/01/28
- [elpa] externals/org-remark 12e0b631eb 076/173: lint: shorten longer than 80 char, ELPA Syncer, 2022/01/28