[Emacs] add :package specification on some keybinds

This commit is contained in:
Lucien Cartier-Tilet 2023-04-12 15:09:49 +02:00
parent 511d0f8f38
commit d6b802f059
Signed by: phundrak
GPG Key ID: BD7789E705CB8DCA

View File

@ -794,26 +794,19 @@ can still feel some influence from my Spacemacs years here.
#+header: :tangle no :exports none :results value :cache yes #+header: :tangle no :exports none :results value :cache yes
#+begin_src emacs-lisp :var table=keybinds-windows prefix="" #+begin_src emacs-lisp :var table=keybinds-windows prefix=""
(mapconcat (lambda (line) (mapconcat (lambda (line)
(let* ((key (car line)) (let* ((key (nth 0 line))
(function (cadr line)) (function (nth 1 line))
(comment (caddr line))) (comment (or (nth 2 line) ""))
(package (or (nth 3 line) "")))
(format "\"%s%s\" %s" (format "\"%s%s\" %s"
prefix prefix
key key
(if (string= "" comment) (if (string= "" comment)
(if (or (string= "" function) (if (member function '("" "nil")) "nil" (concat "#'" function))
(string= "nil" function)) (format "'(%s :wk %s%s)"
"nil" (if (member function '("" "nil")) ":ignore t" function)
(concat "#'" function)) (if (member function '("none" "nil")) "t" (concat "\"" comment "\""))
(format "'(%s :wk %s)" (if (string-blank-p package) "" (concat ":package " package)))))))
(if (or (string= "" function)
(string= "nil" function))
":ignore t"
function)
(if (or (string= "none" comment)
(string= "nil" comment))
"t"
(concat "\"" comment "\"")))))))
table table
"\n") "\n")
#+end_src #+end_src
@ -8285,13 +8278,80 @@ and builds a heatmap out of it.
:defer t :defer t
:ensure t :ensure t
:straight (mastodon :type git :straight (mastodon :type git
:host nil :host codeberg
:repo "https://codeberg.org/rougier/mastodon.el" :repo "martianh/mastodon.el")
:branch "alt-timeline")
:config :config
(setq mastodon-instance-url "https://emacs.ch" (setq mastodon-instance-url "https://emacs.ch"
mastodon-active-user "phundrak") mastodon-active-user "phundrak")
(require 'mastodon-alt-tl) :general
(phundrak/evil
:packages '(mastodon mastodon-alt)
:keymaps 'mastodon-mode-map
"]]" '(mastodon-alt-tl--goto-next-toot :wk "Next status" :package 'mastodon-alt)
"[[" '(mastodon-alt-tl--goto-prev-toot :wk "Previous status" :package 'mastodon-alt)
"gt" '(mastodon-tl--next-tab-item :wk "Next tab item")
"gs" '(mastodon-tl--previous-tab-item :wk "Previous tab item"))
(phundrak/major-leader-key
:package 'mastodon
:keymaps 'mastodon-mode-map
"q" #'kill-current-buffer
"#" '(mastodon-tl--get-tag-timeline :wk "Tag timeline")
"f" '(mastodon-tl--get-federated-timeline :wk "Federated timeline")
"F" '(mastoton-tl--view-filters :wk "Filters")
"H" '(mastodon-tl--get-local-timeline :wk "Home timeline")
"L" '(mastodon-tl--get-local-timeline :wk "Local timeline")
"N" '(mastodon-notifications-get :wk "Notifications")
"U" '(mastodon-profile--show-user :wk "Show user")
"T" '(mastodon-tl--thread :wk "Thread")
"O" '(mastodon-profile--my-profile :wk "My profile")
"S" '(mastodon-tl--get-follow-suggestions :wk "Follow suggestions")
"a" '(mastodon-profile--get-toot-author :wk "Toot author")
"b" '(mastodon-profile--view-bookmarks :wk "Bookmarks")
"s" '(mastodon-search--search-query :wk "Search query")
"u" '(mastodon-alt-tl--update :wk "Update" :package 'mastodon-alt)
"t" '(nil :wk "Toots")
"tt" '(mastodon-toot :wk "Toot")
"tb" '(mastodon-alt-toot--toggle-boost :wk "Boost" :package 'mastodon-alt)
"tB" '(mastodon-alt-toot--bookmark-toot-toggle :wk "Bookmark" :package 'mastodon-alt)
"td" '(mastodon-toot--delete-toot :wk "Delete")
"tD" '(mastodon-toot--delete-and-redraft-toot :wk "Redraft")
"tf" '(mastodon-alt-toot--toggle-favourite :wk "Favourite" :package 'mastodon-alt)
"tF" '(mastodon-profile--view-favourites :wk "View favourites")
"tr" '(mastodon-toot--reply :wk "Reply")
"tp" '(mastodon-toot--pin-toot-toggle :wk "Pin")
"ts" '(mastodon-alt-tl--toggle-spoiler-text-in-toot :wk "Spoiler" :package 'mastodon-alt)
"tu" '(mastodon-toot--copy-toot-url :wk "Copy url")
"tv" '(mastodon-tl--poll-vote :wk "Vote on poll")
"f" '(nil :wk "Follow requests")
"fa" '(mastodon-notifications--follow-request-accept :wk "Accept")
"fr" '(mastodon-notifications--follow-request-reject :wk "Reject")
"fv" '(mastodon-profile--view-follow-requests :wk "View follow requests")
"u" '(nil :wk "User")
"uf" '(mastodon-tl--follow-user :wk "Follow")
"uF" '(mastodon-tl--unfollow-user :wk "Unfollow")
"ub" '(mastodon-tl--block-user :wk "Block")
"uB" '(mastodon-tl--unblock-user :wk "Unblock")
"um" '(mastodon-tl--mute-user :wk "Mute")
"uM" '(mastodon-tl--unmute-user :wk "Unmute")
"un" '(mastodon-profile--update-user-profile-note :wk "Update user profile note")))
#+end_src
#+RESULTS:
#+begin_src emacs-lisp
(use-package mastodon-alt
:defer t
:after 'mastodon
:straight (mastodon-alt :type git
:host github
:repo "rougier/mastodon-alt")
:init
(require 'mastodon-alt)
(mastodon-alt-tl-activate)) (mastodon-alt-tl-activate))
#+end_src #+end_src
@ -8422,29 +8482,33 @@ Undefining some stuff to make keybind prefixes work correctly.
:END: :END:
Here are my apps keybinds. Each one of them is prefixed by ~a~. Here are my apps keybinds. Each one of them is prefixed by ~a~.
#+name: keybinds-apps #+name: keybinds-apps
| Key | Function | Description | | Key | Function | Description | Package |
|-----+------------------+-------------| |-----+----------------------------+-------------+----------|
| | | apps | | | | apps | |
| c | calc | | | c | calc | | |
| d | docker | | | d | docker | | |
| E | elfeed | | | E | elfeed | | |
| e | | email | | e | | email | |
| ec | mu4e-compose-new | | | ec | mu4e-compose-new | | |
| em | mu4e | | | em | mu4e | | |
| k | keycast-mode | | | k | keycast-mode | | |
| K | keycast-log-mode | | | K | keycast-log-mode | | |
| T | tetris | | | m | | mastodon | |
| w | wttrin | | | mm | mastodon | | mastodon |
| C | calendar | | | mn | mastodon-notifications-get | | mastodon |
| mt | mastodon-toot | | mastodon |
| T | tetris | | |
| w | wttrin | | wttrin |
| C | calendar | | |
I also have two main shell-related functions, prefixed with ~as~. I also have two main shell-related functions, prefixed with ~as~.
#+name: keybinds-apps-shell #+name: keybinds-apps-shell
| Key | Function | Description | | Key | Function | Description | Package |
|-----+-------------+-------------| |-----+-------------+-------------+-------------|
| | | shells | | | | shells | |
| e | eshell-new | | | e | eshell-new | | |
| v | vterm | | | v | vterm | | vterm |
| V | multi-vterm | | | V | multi-vterm | | multi-vterm |
** Buffers ** Buffers
:PROPERTIES: :PROPERTIES:
@ -8491,8 +8555,8 @@ My buffer-related keybinds are all prefixed by ~b~.
"e" '(:ignore t :which-key "errors") "e" '(:ignore t :which-key "errors")
"e." '(hydra-flycheck/body :wk "hydra") "e." '(hydra-flycheck/body :wk "hydra")
"el" #'counsel-flycheck "el" #'counsel-flycheck
"ee" '(:keymap flycheck-command-map :wk "flycheck") "ee" '(:keymap flycheck-command-map :package 'flycheck :wk "flycheck")
"ef" '(:keymap flyspell-mode-map :wk "flyspell") "ef" '(:keymap flyspell-mode-map :package 'flyspell :wk "flyspell")
"eF" #'flyspell-hydra/body "eF" #'flyspell-hydra/body
#+end_src #+end_src