aboutsummaryrefslogtreecommitdiff
path: root/pearl.el
diff options
context:
space:
mode:
Diffstat (limited to 'pearl.el')
-rw-r--r--pearl.el126
1 files changed, 96 insertions, 30 deletions
diff --git a/pearl.el b/pearl.el
index 1c6e6f9..fc7667e 100644
--- a/pearl.el
+++ b/pearl.el
@@ -4140,39 +4140,105 @@ reported (refresh to reconcile)."
;;;###autoload (autoload 'pearl-menu "pearl" nil t)
(transient-define-prefix pearl-menu ()
"Dispatch menu for pearl commands."
- ["Linear"
+ ;; Grouped to mirror the `pearl-prefix-map' categories (save / edit / new /
+ ;; delete); fetch / view / setup are the operational groups with no keymap
+ ;; equivalent. The org-sync commands (enable / disable / push-file) are
+ ;; deliberately not surfaced -- they are plumbing (see the todo).
+ ["Ticket"
+ ["Save"
+ ("e" "save ticket" pearl-save-issue)
+ ("E" "save all" pearl-save-all)]
+ ["Edit"
+ ("D" "edit description" pearl-compose-current-description)
+ ("M" "edit comment" pearl-edit-current-comment)
+ ("P" "edit priority" pearl-set-priority)
+ ("s" "edit state" pearl-set-state)
+ ("a" "edit assignee" pearl-set-assignee)
+ ("L" "edit labels" pearl-set-labels)]
+ ["New"
+ ("n" "new ticket" pearl-new-issue)
+ ("c" "new comment" pearl-add-comment)]
+ ["Delete"
+ ("k" "delete ticket" pearl-delete-current-issue)]]
+ ["Workspace"
["Fetch"
- ("l" "My open issues" pearl-list-issues)
- ("p" "By project" pearl-list-issues-by-project)
- ("f" "Build a filter" pearl-list-issues-filtered)
- ("v" "Custom view" pearl-run-view)
- ("Q" "Saved query" pearl-run-saved-query)]
+ ("l" "my open issues" pearl-list-issues)
+ ("p" "by project" pearl-list-issues-by-project)
+ ("f" "build a filter" pearl-list-issues-filtered)
+ ("v" "custom view" pearl-run-view)
+ ("Q" "saved query" pearl-run-saved-query)]
["View"
- ("g" "Refresh view" pearl-refresh-current-view)
- ("r" "Refresh issue" pearl-refresh-current-issue)
- ("b" "Open view in Linear" pearl-open-current-view-in-linear)]
- ["Issue at point"
- ("e" "Edit desc -> push" pearl-sync-current-issue)
- ("D" "Compose desc -> push" pearl-compose-current-description)
- ("t" "Edit title -> push" pearl-sync-current-issue-title)
- ("s" "Set state" pearl-set-state)
- ("a" "Set assignee" pearl-set-assignee)
- ("P" "Set priority" pearl-set-priority)
- ("L" "Set labels" pearl-set-labels)
- ("c" "Add comment" pearl-add-comment)
- ("M" "Edit comment" pearl-edit-current-comment)
- ("k" "Delete issue" pearl-delete-current-issue)
- ("o" "Open in browser" pearl-open-current-issue)]
- ["Create & org-sync"
- ("n" "New issue" pearl-new-issue)
- ("E" "Enable org-sync" pearl-enable-org-sync)
- ("X" "Disable org-sync" pearl-disable-org-sync)
- ("u" "Push file -> Linear" pearl-sync-org-to-linear)]
+ ("g" "refresh view" pearl-refresh-current-view)
+ ("r" "refresh issue" pearl-refresh-current-issue)
+ ("b" "open view in Linear" pearl-open-current-view-in-linear)
+ ("o" "open ticket in browser" pearl-open-current-issue)]
["Setup"
- ("T" "Test connection" pearl-test-connection)
- ("C" "Check setup" pearl-check-setup)
- ("!" "Toggle debug" pearl-toggle-debug)
- ("x" "Clear cache" pearl-clear-cache)]])
+ ("T" "test connection" pearl-test-connection)
+ ("C" "check setup" pearl-check-setup)
+ ("!" "toggle debug" pearl-toggle-debug)
+ ("x" "clear cache" pearl-clear-cache)]])
+
+;;; Prefix Keymap
+;;
+;; An opt-in prefix keymap organizing the commands under save / edit / new /
+;; delete sub-maps. It is defined but NOT bound at load -- a global prefix
+;; isn't reliably free across terminals and GUIs, and auto-installing one is a
+;; compatibility call the user should own. Bind it to a free prefix, e.g.
+;;
+;; (global-set-key (kbd "C-; L") pearl-prefix-map)
+;; ;; or, with use-package: :bind-keymap ("C-; L" . pearl-prefix-map)
+;;
+;; Each binding is a (LABEL . COMMAND) menu item, so `which-key' shows the
+;; verb-matched label (e.g. "edit priority") without pearl depending on
+;; which-key. Lookups still resolve straight to the command.
+;;
+;; The labels follow the edit/new verbs even though some commands keep older
+;; names (`pearl-compose-current-description', `pearl-set-state', and
+;; `pearl-add-comment'); aligning the command names is a separate task. The
+;; `d c' delete-comment slot is intentionally empty until that command exists.
+
+(defvar pearl-save-map
+ (let ((map (make-sparse-keymap)))
+ (define-key map "s" (cons "save ticket" #'pearl-save-issue))
+ (define-key map "a" (cons "save all" #'pearl-save-all))
+ map)
+ "Pearl save commands; a sub-keymap of `pearl-prefix-map'.")
+
+(defvar pearl-edit-map
+ (let ((map (make-sparse-keymap)))
+ (define-key map "d" (cons "edit description" #'pearl-compose-current-description))
+ (define-key map "c" (cons "edit comment" #'pearl-edit-current-comment))
+ (define-key map "p" (cons "edit priority" #'pearl-set-priority))
+ (define-key map "s" (cons "edit state" #'pearl-set-state))
+ (define-key map "a" (cons "edit assignee" #'pearl-set-assignee))
+ (define-key map "l" (cons "edit labels" #'pearl-set-labels))
+ map)
+ "Pearl edit commands; a sub-keymap of `pearl-prefix-map'.")
+
+(defvar pearl-new-map
+ (let ((map (make-sparse-keymap)))
+ (define-key map "t" (cons "new ticket" #'pearl-new-issue))
+ (define-key map "c" (cons "new comment" #'pearl-add-comment))
+ map)
+ "Pearl new-object commands; a sub-keymap of `pearl-prefix-map'.")
+
+(defvar pearl-delete-map
+ (let ((map (make-sparse-keymap)))
+ (define-key map "t" (cons "delete ticket" #'pearl-delete-current-issue))
+ map)
+ "Pearl delete commands; a sub-keymap of `pearl-prefix-map'.")
+
+(defvar pearl-prefix-map
+ (let ((map (make-sparse-keymap)))
+ (define-key map "s" (cons "+save" pearl-save-map))
+ (define-key map "e" (cons "+edit" pearl-edit-map))
+ (define-key map "n" (cons "+new" pearl-new-map))
+ (define-key map "d" (cons "+delete" pearl-delete-map))
+ (define-key map "m" (cons "menu" #'pearl-menu))
+ map)
+ "Opt-in Pearl command prefix keymap.
+Not bound at load. Bind it to a free prefix, such as the suggested
+\\=`C-; L\\=', in your own configuration (see the Commentary above).")
(provide 'pearl)
;;; pearl.el ends here \ No newline at end of file