diff options
author | Thanos Apollo <[email protected]> | 2023-04-27 17:46:04 +0300 |
---|---|---|
committer | Thanos Apollo <[email protected]> | 2023-04-27 17:46:04 +0300 |
commit | 0e90a4ac3d9fa2bc8756427f2f88c4aa9e3414ec (patch) | |
tree | c9194a3347b580e4e4188b645172d26da5e1923a | |
parent | a62076ff2941d5c0be4407e4baa456b028833e06 (diff) |
emacs: Update mu4e actions and set backup dir
-rw-r--r-- | .emacs.d/init.el | 34 | ||||
-rwxr-xr-x | org/emacs.org | 42 |
2 files changed, 51 insertions, 25 deletions
diff --git a/.emacs.d/init.el b/.emacs.d/init.el index c092880..472b35e 100644 --- a/.emacs.d/init.el +++ b/.emacs.d/init.el @@ -4,6 +4,8 @@ (setq browse-url-browser-function 'browse-url-generic browse-url-generic-program "mullvad-browser") +(setq backup-directory-alist '((".*" . "~/.Trash"))) + (defconst my-package-list '(org-snooze all-the-icons all-the-icons-dired @@ -741,6 +743,16 @@ Contains the list of packages that need to be installed.") (setq message-send-mail-function 'smtpmail-send-it smtpmail-stream-type 'ssl)) +(setq mu4e-view-actions + (delete-dups + (append + '(("gapply git patches" . mu4e-action-git-apply-patch) + ("mgit am patch" . mu4e-action-git-apply-mbox) + ("bb4 am patch" . mu4e-action-git-apply-b4) + ("ssetup reword list with b4" . mu4e-action-setup-reword-b4) + ("crun checkpatch script" . my-mu4e-action-run-check-patch) + ("MCheck if merged" . my-mu4e-action-check-if-merged))))) + ;;;; sudo completion (defun pcomplete/sudo () "Completion rules for the `sudo' command." @@ -795,19 +807,9 @@ Contains the list of packages that need to be installed.") :type '(repeat (string :tag "hut command")) :group 'pcomplete) -(defvar pcomplete-hut-user-commands - (split-string - (shell-command-to-string - "hut |while read -r a b; do echo \" $a\";done;")) - "p-completion candidates for `hut' command") - -(defun apollo/hut () - "Replace." - (replace-match "Usage:" "Someasdf")) - (defun pcomplete/hut () "Completion rules for `hut' command" - (pcomplete-here (append pcomplete-hut-user-commands))) + (pcomplete-here (append pcomplete-hut-commands))) (defun apollo/html-boostrap-boilerplate () "Insert html boilerplate with boostrap link." @@ -921,6 +923,16 @@ Contains the list of packages that need to be installed.") (switch-to-buffer (get-buffer-create "*scratch*")) (emacs-lisp-mode)) +(defun get-mail-pass () + (interactive) + ;; Get fastmail API Key + (insert + (password-store-get-field "fastmail.com/thanosapollo.com" "API"))) + +(global-set-key (kbd "C-c p m") 'get-mail-pass) + +;; + (define-key dired-mode-map "b" 'dired-up-directory) (global-set-key (kbd "<escape>") 'keyboard-escape-quit) diff --git a/org/emacs.org b/org/emacs.org index d6020dc..937ad94 100755 --- a/org/emacs.org +++ b/org/emacs.org @@ -13,6 +13,10 @@ Setup default browser as ~mullvad-browser~ (setq browse-url-browser-function 'browse-url-generic browse-url-generic-program "mullvad-browser") #+end_src +Set backup fails at ~~/Trash~ +#+begin_src emacs-lisp + (setq backup-directory-alist '((".*" . "~/.Trash"))) +#+end_src * Setting up Packages ** Define and install packages ** List of required packages @@ -777,7 +781,7 @@ Hook with ~dired-mode~ (add-to-list 'auto-mode-alist '("\\.pdf\\'" . pdf-view-mode)) #+end_src * mu4e - +** Setting up mail #+begin_src emacs-lisp ;; Check if we have mu4e available ;; if t load mu4e settings @@ -835,10 +839,20 @@ Hook with ~dired-mode~ (setq message-send-mail-function 'smtpmail-send-it smtpmail-stream-type 'ssl)) - - #+end_src +** Actions +#+begin_src emacs-lisp + (setq mu4e-view-actions + (delete-dups + (append + '(("gapply git patches" . mu4e-action-git-apply-patch) + ("mgit am patch" . mu4e-action-git-apply-mbox) + ("bb4 am patch" . mu4e-action-git-apply-b4) + ("ssetup reword list with b4" . mu4e-action-setup-reword-b4) + ("crun checkpatch script" . my-mu4e-action-run-check-patch) + ("MCheck if merged" . my-mu4e-action-check-if-merged))))) +#+end_src * Eshell #+begin_src emacs-lisp ;;;; sudo completion @@ -895,19 +909,9 @@ Hook with ~dired-mode~ :type '(repeat (string :tag "hut command")) :group 'pcomplete) - (defvar pcomplete-hut-user-commands - (split-string - (shell-command-to-string - "hut |while read -r a b; do echo \" $a\";done;")) - "p-completion candidates for `hut' command") - - (defun apollo/hut () - "Replace." - (replace-match "Usage:" "Someasdf")) - (defun pcomplete/hut () "Completion rules for `hut' command" - (pcomplete-here (append pcomplete-hut-user-commands))) + (pcomplete-here (append pcomplete-hut-commands))) #+end_src * Misc ** Random functions @@ -1023,6 +1027,16 @@ Hook with ~dired-mode~ (interactive) (switch-to-buffer (get-buffer-create "*scratch*")) (emacs-lisp-mode)) + + (defun get-mail-pass () + (interactive) + ;; Get fastmail API Key + (insert + (password-store-get-field "fastmail.com/thanosapollo.com" "API"))) + + (global-set-key (kbd "C-c p m") 'get-mail-pass) + + ;; #+end_src ** Keybindings #+begin_src emacs-lisp |