From b7d190c5130f46123864feecc1155ad6573e1948 Mon Sep 17 00:00:00 2001 From: Daniel Borchmann Date: Mon, 1 Jan 2024 16:58:53 +0100 Subject: [PATCH] Introduce separate hydra for Org jump commands `hydra-org-clock` thus only hosts keybindings for clock-related commands, while the new `hydra-org-jump` is for jumping to Org items in various ways. Feels cleaner to me this way. --- init.el | 4 +++- site-lisp/db-org.el | 17 +++++++++++++++-- 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/init.el b/init.el index c2a78f6..df13fcc 100644 --- a/init.el +++ b/init.el @@ -538,6 +538,7 @@ db/org-timestamp-difference db/org-capture-code-snippet hydra-org-clock/body + hydra-org-jump/body db/make-org-capture-frame db/org-onenote-open db/org-outlook-open @@ -3031,7 +3032,8 @@ eventuelly be set to nil, however)." (bind-key "C-c n f" #'org-roam-node-find) (bind-key "C-c n i" #'org-roam-node-insert) (bind-key "C-c n c" #'org-roam-capture) - (bind-key "C-c o" #'hydra-org-clock/body) + (bind-key "C-c o c" #'hydra-org-clock/body) + (bind-key "C-c o j" #'hydra-org-jump/body) (bind-key "C-c t" #'hydra-toggle/body) (bind-key "C-h C-f" #'find-function) (bind-key "C-h C-k" #'find-function-on-key) diff --git a/site-lisp/db-org.el b/site-lisp/db-org.el index e2dc0f2..f2d508e 100644 --- a/site-lisp/db-org.el +++ b/site-lisp/db-org.el @@ -851,7 +851,7 @@ default task, though." Current Task: %s(replace-regexp-in-string \"%\" \"%%\" (or org-clock-current-task \"\")); - Clock in to [_w_]ork, [_h_]ome, [_b_]reak default task - Clock in to [_l_]ast, or [_s_]elect task to clock in to -- [_j_]ump to current clock or to [_a_]ny item +- [_j_]ump to current clock - Clock [_o_]ut " ("w" (db/org-clock-in-work-task) nil) @@ -863,7 +863,6 @@ Current Task: %s(replace-regexp-in-string \"%\" \"%%\" (or org-clock-current-tas nil) ("j" (db/org-clock-goto-first-open-checkbox) nil) - ("a" counsel-org-goto-all nil) ("o" org-clock-out nil) ("l" db/org-clock-in-last-task nil)) @@ -1037,6 +1036,20 @@ The password is assumed to be stored at the PASSWORD property." heading org-password-manager-default-password-wait-time)))) +(defhydra hydra-org-jump (:color blue) + ;; Quote %, as otherwise they would be misinterpreted as format characters + " +Current Task: %s(replace-regexp-in-string \"%\" \"%%\" (or org-clock-current-task \"\")); +- Jump to [_c_]urrent clock +- Jump to [_a_]ny item +- Jump to item [_s_]elected from clock history +" + ("c" (db/org-clock-goto-first-open-checkbox nil) + nil) + ("a" counsel-org-goto-all nil) + ("s" (db/org-clock-goto-first-open-checkbox t) + nil)) + ;;; Checklist Handling