2018-01-07 04:50:52 +00:00
|
|
|
;;; packages.el --- Notmuch Layer packages File for Spacemacs
|
2017-08-11 18:46:41 +00:00
|
|
|
;;
|
2018-01-04 07:00:25 +00:00
|
|
|
;; Copyright (c) 2012-2018 Sylvain Benner & Contributors
|
2017-08-11 18:46:41 +00:00
|
|
|
;;
|
|
|
|
;; Author: Sylvain Benner <sylvain.benner@gmail.com>
|
|
|
|
;; URL: https://github.com/syl20bnr/spacemacs
|
|
|
|
;;
|
|
|
|
;; This file is not part of GNU Emacs.
|
|
|
|
;;
|
|
|
|
;;; License: GPLv3
|
|
|
|
|
2018-01-07 04:50:52 +00:00
|
|
|
(setq notmuch-packages
|
|
|
|
'(
|
2018-09-08 15:19:54 +00:00
|
|
|
(counsel-notmuch :requires ivy)
|
2018-01-08 07:47:42 +00:00
|
|
|
(helm-notmuch :requires helm)
|
2018-01-07 04:50:52 +00:00
|
|
|
notmuch
|
2018-01-07 05:44:50 +00:00
|
|
|
org
|
2018-11-20 19:55:37 +00:00
|
|
|
persp-mode
|
2018-01-08 07:53:13 +00:00
|
|
|
window-purpose
|
2018-11-20 19:55:37 +00:00
|
|
|
))
|
2017-08-11 18:46:41 +00:00
|
|
|
|
2018-01-07 04:50:52 +00:00
|
|
|
(defun notmuch/init-counsel-notmuch ()
|
|
|
|
(use-package counsel-notmuch
|
2018-03-04 04:37:53 +00:00
|
|
|
:defer t
|
2018-01-07 04:50:52 +00:00
|
|
|
:init (spacemacs/set-leader-keys "aNn" 'counsel-notmuch)))
|
|
|
|
|
|
|
|
(defun notmuch/init-helm-notmuch ()
|
|
|
|
(use-package helm-notmuch
|
2018-03-04 04:37:53 +00:00
|
|
|
:defer t
|
2018-01-07 04:50:52 +00:00
|
|
|
:init (spacemacs/set-leader-keys "aNn" 'helm-notmuch)))
|
|
|
|
|
2017-08-11 18:46:41 +00:00
|
|
|
(defun notmuch/init-notmuch ()
|
|
|
|
(use-package notmuch
|
2018-03-04 04:37:53 +00:00
|
|
|
:defer t
|
2018-01-10 21:23:06 +00:00
|
|
|
:commands notmuch
|
2017-08-11 18:46:41 +00:00
|
|
|
:init
|
|
|
|
(progn
|
|
|
|
(spacemacs/declare-prefix "aN" "notmuch")
|
2018-01-07 04:50:52 +00:00
|
|
|
(spacemacs/set-leader-keys
|
|
|
|
"aNN" 'notmuch
|
|
|
|
"aNi" 'spacemacs/notmuch-inbox
|
|
|
|
"aNj" 'notmuch-jump-search
|
2018-01-10 15:59:15 +00:00
|
|
|
"aNs" 'notmuch-search))
|
2017-08-11 18:46:41 +00:00
|
|
|
:config
|
|
|
|
(progn
|
|
|
|
(dolist (prefix '(("ms" . "stash")
|
|
|
|
("mp" . "part")
|
|
|
|
("mP" . "patch")))
|
|
|
|
(spacemacs/declare-prefix-for-mode 'notmuch-show-mode
|
2018-01-07 04:50:52 +00:00
|
|
|
(car prefix) (cdr prefix)))
|
|
|
|
;; key bindings
|
|
|
|
(evil-define-key 'visual notmuch-search-mode-map
|
|
|
|
"*" 'notmuch-search-tag-all
|
|
|
|
"a" 'notmuch-search-archive-thread
|
|
|
|
"-" 'notmuch-search-remove-tag
|
|
|
|
"+" 'notmuch-search-add-tag)
|
2017-08-11 18:46:41 +00:00
|
|
|
(spacemacs/set-leader-keys-for-major-mode 'notmuch-show-mode
|
|
|
|
"a" 'notmuch-show-save-attachments
|
|
|
|
;; part
|
|
|
|
"pm" 'notmuch-show-choose-mime-of-part
|
2018-05-25 19:35:35 +00:00
|
|
|
"pp" 'spacemacs/notmuch-show-as-patch
|
2017-08-11 18:46:41 +00:00
|
|
|
"p|" 'notmuch-show-pipe-part
|
|
|
|
"po" 'notmuch-show-interactively-view-part
|
|
|
|
"pv" 'notmuch-show-view-part
|
|
|
|
"ps" 'notmuch-show-save-part
|
|
|
|
;; stash
|
|
|
|
"sG" 'notmuch-show-stash-git-send-email
|
|
|
|
"sL" 'notmuch-show-stash-mlarchive-link-and-go
|
|
|
|
"sl" 'notmuch-show-stash-mlarchive-link
|
|
|
|
"st" 'notmuch-show-stash-to
|
|
|
|
"sT" 'notmuch-show-stash-tags
|
|
|
|
"ss" 'notmuch-show-stash-subject
|
|
|
|
"sI" 'notmuch-show-stash-message-id-stripped
|
|
|
|
"si" 'notmuch-show-stash-message-id
|
|
|
|
"sf" 'notmuch-show-stash-from
|
|
|
|
"sF" 'notmuch-show-stash-filename
|
|
|
|
"sd" 'notmuch-show-stash-date
|
|
|
|
"sc" 'notmuch-show-stash-cc
|
|
|
|
;; patch
|
|
|
|
"Po" 'spacemacs/notmuch-show-open-github-patch
|
|
|
|
"Pa" 'spacemacs/notmuch-git-apply-patch
|
2018-01-07 04:50:52 +00:00
|
|
|
"PA" 'spacemacs/notmuch-git-apply-patch-part)
|
|
|
|
;; evilified maps
|
|
|
|
(evilified-state-evilify-map notmuch-hello-mode-map
|
|
|
|
:mode notmuch-hello-mode)
|
2017-08-11 18:46:41 +00:00
|
|
|
(evilified-state-evilify-map notmuch-show-mode-map
|
|
|
|
:mode notmuch-show-mode
|
|
|
|
:bindings
|
|
|
|
;; In notmuch-show-mode n would be bound to `notmuch-show-next-message`
|
|
|
|
;; but the evilified state moves the `n' bound function to C-n while
|
|
|
|
;; it's counterpart `notmuch-show-previous-message` remains bound to
|
|
|
|
;; `p'. Adding a binding for the previous function to `C-p' becomes
|
|
|
|
;; handy while navigation messages back and forth.
|
|
|
|
(kbd "C-p") 'notmuch-show-previous-message
|
|
|
|
(kbd "n") 'notmuch-show-next-open-message
|
|
|
|
(kbd "o") 'notmuch-show-open-or-close-all
|
2018-01-07 04:50:52 +00:00
|
|
|
(kbd "O") 'spacemacs/notmuch-show-close-all)
|
2017-08-11 18:46:41 +00:00
|
|
|
(evilified-state-evilify-map notmuch-tree-mode-map
|
|
|
|
:mode notmuch-tree-mode
|
|
|
|
:bindings
|
|
|
|
(kbd "d") 'spacemacs/notmuch-message-delete-down
|
|
|
|
(kbd "D") 'spacemacs/notmuch-message-delete-up
|
|
|
|
(kbd "M") 'compose-mail-other-frame)
|
|
|
|
(evilified-state-evilify-map notmuch-search-mode-map
|
|
|
|
:mode notmuch-search-mode
|
|
|
|
:bindings
|
|
|
|
(kbd "a") 'spacemacs/notmuch-search-archive-thread-down
|
|
|
|
(kbd "A") 'spacemacs/notmuch-search-archive-thread-up
|
|
|
|
(kbd "d") 'spacemacs/notmuch-message-delete-down
|
|
|
|
(kbd "D") 'spacemacs/notmuch-message-delete-up
|
|
|
|
(kbd "J") 'notmuch-jump-search
|
|
|
|
(kbd "L") 'notmuch-search-filter
|
|
|
|
(kbd "gg") 'notmuch-search-first-thread
|
|
|
|
(kbd "gr") 'notmuch-refresh-this-buffer
|
|
|
|
(kbd "gR") 'notmuch-refresh-all-buffers
|
|
|
|
(kbd "G") 'notmuch-search-last-thread
|
2018-01-07 04:50:52 +00:00
|
|
|
(kbd "M") 'compose-mail-other-frame))))
|
2017-08-11 18:46:41 +00:00
|
|
|
|
2018-01-07 04:50:52 +00:00
|
|
|
(defun notmuch/pre-init-org ()
|
|
|
|
(spacemacs|use-package-add-hook org
|
|
|
|
:post-config (require 'org-notmuch)))
|
2018-01-07 05:44:50 +00:00
|
|
|
|
2018-01-10 04:01:34 +00:00
|
|
|
(defun notmuch/pre-init-persp-mode ()
|
|
|
|
(spacemacs|use-package-add-hook persp-mode
|
|
|
|
:post-config
|
2018-01-07 05:44:50 +00:00
|
|
|
(progn
|
2018-01-10 04:01:34 +00:00
|
|
|
(add-to-list 'persp-filter-save-buffers-functions
|
|
|
|
'spacemacs//notmuch-persp-filter-save-buffers-function)
|
|
|
|
(spacemacs|define-custom-layout notmuch-spacemacs-layout-name
|
|
|
|
:binding notmuch-spacemacs-layout-binding
|
|
|
|
:body
|
|
|
|
(progn
|
|
|
|
(dolist (mode notmuch-modes)
|
|
|
|
(let ((hook (intern (concat (symbol-name mode) "-hook"))))
|
|
|
|
(add-hook hook #'spacemacs//notmuch-buffer-to-persp)))
|
|
|
|
(call-interactively 'notmuch))))))
|
2018-01-08 07:53:13 +00:00
|
|
|
|
|
|
|
(defun notmuch/pre-init-window-purpose ()
|
|
|
|
(spacemacs|use-package-add-hook window-purpose
|
|
|
|
:pre-config
|
|
|
|
(dolist (mode notmuch-modes)
|
|
|
|
(add-to-list 'purpose-user-mode-purposes (cons mode 'mail)))))
|