feat(emacs): more commands in perspective

This commit is contained in:
Pavel Korytov 2021-12-06 14:56:49 +03:00
parent bcbea86087
commit 5be9577a2e
3 changed files with 31 additions and 34 deletions

View file

@ -22,7 +22,7 @@
(my-leader-def (my-leader-def
:infix "am" :infix "am"
"" '(:which-key "notmuch") "" '(:which-key "notmuch")
"m" 'notmuch) "m" (my/command-in-persp "notmuch" "mail" 0 (notmuch)))
(setq notmuch-saved-searches (setq notmuch-saved-searches
'((:name "drafts" :query "tag:draft") '((:name "drafts" :query "tag:draft")
@ -42,20 +42,20 @@
(my-leader-def (my-leader-def
:infix "am" :infix "am"
"t" '(:which-key "thexcloud@gmail.com") "t" '(:which-key "thexcloud@gmail.com")
"ti" '((lambda () (interactive) (notmuch-search "tag:main AND tag:inbox")) :which-key "inbox") "ti" (my/command-in-persp "tag:main AND tag:inbox" "mail" 0 (notmuch-search "inbox"))
"tu" '((lambda () (interactive) (notmuch-search "tag:main AND tag:unread")) :which-key "unread") "tu" (my/command-in-persp "tag:main AND tag:unread" "mail" 0 (notmuch-search "unread"))
"ts" '((lambda () (interactive) (notmuch-search "tag:main AND tag:sent")) :which-key "sent") "ts" (my/command-in-persp "tag:main AND tag:sent" "mail" 0 (notmuch-search "sent"))
"ta" '((lambda () (interactive) (notmuch-search "tag:main")) :which-key "all mail") "ta" (my/command-in-persp "tag:main" "mail" 0 (notmuch-search "all mail"))
"p" '(:which-key "progin6304@gmail.com") "p" '(:which-key "progin6304@gmail.com")
"pi" '((lambda () (interactive) (notmuch-search "tag:progin AND tag:inbox")) :which-key "inbox") "pi" (my/command-in-persp "tag:progin AND tag:inbox" "mail" 0 (notmuch-search "inbox"))
"pu" '((lambda () (interactive) (notmuch-search "tag:progin AND tag:unread")) :which-key "unread") "pu" (my/command-in-persp "tag:progin AND tag:unread" "mail" 0 (notmuch-search "unread"))
"ps" '((lambda () (interactive) (notmuch-search "tag:progin AND tag:sent")) :which-key "sent") "ps" (my/command-in-persp "tag:progin AND tag:sent" "mail" 0 (notmuch-search "sent"))
"pa" '((lambda () (interactive) (notmuch-search "tag:progin")) :which-key "all mail") "pa" (my/command-in-persp "tag:progin" "mail" 0 (notmuch-search "all mail"))
"e" '(:which-key "pvkorytov@etu.ru") "e" '(:which-key "pvkorytov@etu.ru")
"ei" '((lambda () (interactive) (notmuch-search "tag:pvkorytov AND tag:inbox")) :which-key "inbox") "ei" (my/command-in-persp "tag:pvkorytov AND tag:inbox" "mail" 0 (notmuch-search "inbox"))
"eu" '((lambda () (interactive) (notmuch-search "tag:pvkorytov AND tag:unread")) :which-key "unread") "eu" (my/command-in-persp "tag:pvkorytov AND tag:unread" "mail" 0 (notmuch-search "unread"))
"es" '((lambda () (interactive) (notmuch-search "tag:pvkorytov AND tag:sent")) :which-key "sent") "es" (my/command-in-persp "tag:pvkorytov AND tag:sent" "mail" 0 (notmuch-search "sent"))
"ea" '((lambda () (interactive) (notmuch-search "tag:pvkorytov")) :which-key "all mail")) "ea" (my/command-in-persp "tag:pvkorytov" "mail" 0 (notmuch-search "all mail")))
(with-eval-after-load 'notmuch (with-eval-after-load 'notmuch
(add-hook 'message-setup-hook 'mml-secure-sign-pgpmime)) (add-hook 'message-setup-hook 'mml-secure-sign-pgpmime))

View file

@ -562,11 +562,11 @@ Also other local keybindings, that are also available only in =line-mode=:
(general-define-key (general-define-key
:keymaps '(exwm-mode-map) :keymaps '(exwm-mode-map)
"C-q" 'exwm-input-send-next-key "C-q" #'exwm-input-send-next-key
"<print>" (my/app-command "flameshot gui") "<print>" (my/app-command "flameshot gui")
"<mode-line> s-<mouse-4>" 'perspective-exwm-cycle-exwm-buffers-backward "<mode-line> s-<mouse-4>" #'perspective-exwm-cycle-exwm-buffers-backward
"<mode-line> s-<mouse-5>" 'perspective-exwm-cycle-exwm-buffers-forward "<mode-line> s-<mouse-5>" #'perspective-exwm-cycle-exwm-buffers-forward
"M-x" 'counsel-M-x "M-x" #'counsel-M-x
"M-SPC" (general-key "SPC")) "M-SPC" (general-key "SPC"))
#+end_src #+end_src

View file

@ -3535,7 +3535,7 @@ So there we have a minor mode that overrides this behavior.
(advice-add 'jupyter-org-scalar :around #'my/jupyter-org-scalar-around) (advice-add 'jupyter-org-scalar :around #'my/jupyter-org-scalar-around)
#+end_src #+end_src
*** Wrap source code output *** Wrap source code output
A function to remove :RESULTS: drawer from the results. Once again, necessary because emacs-jupyter doesn't seem to respect :results raw. A function to remove the :RESULTS: drawer from results. Once again, it's necessary because emacs-jupyter doesn't seem to respect =:results raw=.
#+begin_src emacs-lisp #+begin_src emacs-lisp
(defun my/org-strip-results (data) (defun my/org-strip-results (data)
(replace-regexp-in-string ":\\(RESULTS\\|END\\):\n" "" data)) (replace-regexp-in-string ":\\(RESULTS\\|END\\):\n" "" data))
@ -3543,10 +3543,10 @@ A function to remove :RESULTS: drawer from the results. Once again, necessary be
And an all-in-one function to: And an all-in-one function to:
- prepend =#+NAME:= and =#+CAPTION:= to the source block output. Useful if the output is an image. - prepend =#+NAME:= and =#+CAPTION:= to the source block output. Useful if the output is an image.
- strip :RESULTS: drawer from the output, if necessary - strip the :RESULTS: drawer from the output, if necessary
- wrap results in the =src= block - wrap results in the =src= block
As for now, looks sufficient to format source code outputs to get a tolerable LaTeX. As for now, it looks sufficient to format source code outputs to get a tolerable LaTeX.
#+begin_src emacs-lisp #+begin_src emacs-lisp
(defun my/org-caption-wrap (data &optional name caption attrs strip-drawer src-wrap) (defun my/org-caption-wrap (data &optional name caption attrs strip-drawer src-wrap)
@ -5048,22 +5048,13 @@ A bunch of functions for managing dotfiles with yadm.
*** Open Emacs config *** Open Emacs config
#+begin_src emacs-lisp #+begin_src emacs-lisp
(defun my/edit-configuration () (general-define-key
"Open the init file." "C-c c" (my/command-in-persp "Emacs.org" "conf" 1 (find-file "~/Emacs.org")))
(interactive)
(find-file "~/Emacs.org"))
;; (defun my/edit-exwm-configuration ()
;; "Open the exwm config file."
;; (interactive)
;; (find-file "~/.emacs.d/exwm.org"))
(general-define-key "C-c c" 'my/edit-configuration)
;; (general-define-key "C-c C" 'my/edit-exwm-configuration)
(my-leader-def (my-leader-def
:infix "c" :infix "c"
"" '(:which-key "configuration") "" '(:which-key "configuration")
"c" 'my/edit-configuration) "c" (my/command-in-persp "Emacs.org" "conf" 1 (find-file "~/Emacs.org")))
#+end_src #+end_src
*** Open Magit for yadm *** Open Magit for yadm
Idea: Idea:
@ -5102,8 +5093,14 @@ Open a file managed by yadm.
(split-string (split-string
(shell-command-to-string "yadm ls-files $HOME --full-name") "\n"))))) (shell-command-to-string "yadm ls-files $HOME --full-name") "\n")))))
(general-define-key "C-c f" 'my/open-yadm-file) (general-define-key
(my-leader-def "cf" 'my/open-yadm-file) "C-c f" (my/command-in-persp
"yadm file" "conf" 1
(my/open-yadm-file)))
(my-leader-def
"cf" (my/command-in-persp
"yadm file" "conf" 1
(my/open-yadm-file)))
#+end_src #+end_src
** Internet & Multimedia ** Internet & Multimedia
*** Notmuch *** Notmuch