-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathcc-main-tmenu.el
102 lines (77 loc) · 3.41 KB
/
cc-main-tmenu.el
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
;;; cc-main-tmenu.el --- Main Menu -*- lexical-binding: t; -*-
;; Copyright (C) 2024-2025 Charles Choi
;; Author: Charles Choi <[email protected]>
;; Keywords: tools
;; This program is free software; you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation, either version 3 of the License, or
;; (at your option) any later version.
;; This program is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;; GNU General Public License for more details.
;; You should have received a copy of the GNU General Public License
;; along with this program. If not, see <https://www.gnu.org/licenses/>.
;;; Commentary:
;;
;;; Code:
(require 'casual-editkit)
(require 'cclisp)
(require 'password-store-menu)
(require 'google-translate-smooth-ui)
(require 'webpaste)
(require 'markdown-mode)
(require 'git-link)
(defvar cc-main-tmenu-customize-enable t
"If t then enable Casual menu customizations.")
(when (and cc-main-tmenu-customize-enable (not (featurep 'cc-main-tmenu)))
;; modify `casual-editkit-main-tmenu'
(transient-append-suffix 'casual-editkit-main-tmenu "R"
'("j" "Goto Journal…" cc/select-journal-file))
(transient-append-suffix 'casual-editkit-main-tmenu "C-o"
'("I" "Korean Input"
(lambda () (interactive)(set-input-method 'korean-hangul))
:transient nil))
(transient-append-suffix 'casual-editkit-main-tmenu "I"
'("1" "Translate"
google-translate-smooth-translate
:inapt-if-not use-region-p
:transient nil))
;; (transient-append-suffix 'casual-editkit-main-tmenu "C"
;; '("!" "Shell Command…" shell-command))
;; modify `casual-editkit-tools-tmenu'
(transient-append-suffix 'casual-editkit-tools-tmenu "w"
'("P" "Password›" password-store-menu))
(transient-append-suffix 'casual-editkit-tools-tmenu "P"
'("l" "Git Link›" git-link-dispatch
:if casual-editkit-version-controlled-p))
(transient-append-suffix 'casual-editkit-tools-tmenu "l"
'("H" "Git Homepage›" git-link-homepage
:if casual-editkit-version-controlled-p))
(transient-append-suffix 'casual-editkit-tools-tmenu "M-e"
'("C-p" "Call" cc/call-nanp-phone-number
:inapt-if-not use-region-p))
(transient-append-suffix 'casual-editkit-tools-tmenu "C-p"
'("m" "Maps" cc/open-region-in-apple-maps
:inapt-if-not use-region-p))
(transient-append-suffix 'casual-editkit-tools-tmenu "m"
'("M-s" "Say" cc/say-region
:inapt-if-not use-region-p))
(transient-append-suffix 'casual-editkit-tools-tmenu "M-s"
'("M-t" "Translate" google-translate-smooth-translate
:inapt-if-not use-region-p))
(transient-append-suffix 'casual-editkit-tools-tmenu "M-t"
'("M-p" "Webpaste" webpaste-paste-region
:inapt-if-not use-region-p))
(transient-append-suffix 'casual-editkit-tools-tmenu "z"
'("F" "Fireplace" fireplace))
(transient-append-suffix 'casual-editkit-tools-tmenu "F"
'("Z" "Snow" snow))
(transient-append-suffix 'casual-editkit-narrow-tmenu '(0 0)
["Markdown"
:if (lambda () (derived-mode-p 'markdown-mode))
("s" "Subtree" markdown-narrow-to-subtree)
("b" "Block" markdown-narrow-to-block)
("p" "Page" markdown-narrow-to-page)]))
(provide 'cc-main-tmenu)
;;; cc-main-tmenu.el ends here