aboutsummaryrefslogtreecommitdiff
path: root/.emacs.local.d
diff options
context:
space:
mode:
authorRaul Benencia <rul@kalgan.cc>2021-04-22 19:00:46 -0700
committerRaul Benencia <rul@kalgan.cc>2021-04-22 19:01:50 -0700
commit8c238b9f3b5ff254530b7c88c6073d372bec53df (patch)
treea7061f6d5dadc2660ba049256c5c06577f8b3cde /.emacs.local.d
parente8c5f226f1d42e5bb0d649da7ff76878e6fe4492 (diff)
emacs: clean notmuch
Diffstat (limited to '.emacs.local.d')
-rw-r--r--.emacs.local.d/modes/notmuch.el105
1 files changed, 0 insertions, 105 deletions
diff --git a/.emacs.local.d/modes/notmuch.el b/.emacs.local.d/modes/notmuch.el
deleted file mode 100644
index f5096c8..0000000
--- a/.emacs.local.d/modes/notmuch.el
+++ /dev/null
@@ -1,105 +0,0 @@
-;; --------
-;; notmuch mode
-;; --------
-(require 'notmuch)
-
-;; This should be upstream
-(require 'notmuch-show)
-(require 'notmuch-tag)
-(defun notmuch-tree-show-message-in ()
- "Show the current message (in split-pane)."
- (interactive)
- (let ((id (notmuch-tree-get-message-id))
- (inhibit-read-only t)
- buffer)
- (when id
- ;; We close and reopen the window to kill off un-needed buffers
- ;; this might cause flickering but seems ok.
- (notmuch-tree-close-message-window)
- (setq notmuch-tree-message-window
- (split-window-vertically (/ (window-height) 4)))
- (with-selected-window notmuch-tree-message-window
- ;; Since we are only displaying one message do not indent.
- (let ((notmuch-show-indent-messages-width 0)
- (notmuch-show-only-matching-messages t))
- (setq buffer (notmuch-show id))))
- ;; We need the `let' as notmuch-tree-message-window is buffer local.
- (let ((window notmuch-tree-message-window))
- (with-current-buffer buffer
- (setq notmuch-tree-message-window window)
- (add-hook 'kill-buffer-hook 'notmuch-tree-message-window-kill-hook)))
- (when notmuch-show-mark-read-tags
- (notmuch-tree-tag-update-display notmuch-show-mark-read-tags)
- (notmuch-tree-tag notmuch-show-mark-read-tags))
- (setq notmuch-tree-message-buffer buffer))))
-;; End upstream
-
-(define-key notmuch-show-mode-map "S"
- (lambda ()
- "mark message as spam"
- (interactive)
- (notmuch-show-tag (list "+spam" "-inbox" "-unread"))))
-
-(define-key notmuch-search-mode-map "S"
- (lambda (&optional beg end)
- "mark thread as spam"
- (interactive (notmuch-search-interactive-region))
- (notmuch-search-tag (list "+spam" "-inbox" "-unread") beg end)))
-
-(define-key notmuch-search-mode-map "R"
- (lambda (&optional beg end)
- "mark thread as read"
- (interactive (notmuch-search-interactive-region))
- (notmuch-search-tag (list "-unread") beg end)
- (notmuch-search-next-thread)))
-
-(define-key notmuch-search-mode-map (kbd "RET")
- (lambda ()
- "Show the selected thread with notmuch-tree if it has more
-than one email. Use notmuch-show otherwise."
- (interactive)
- (if (= (plist-get (notmuch-search-get-result) :total) 1)
- (notmuch-search-show-thread)
- (notmuch-tree (notmuch-search-find-thread-id)
- notmuch-search-query-string
- nil
- (notmuch-prettify-subject (notmuch-search-find-subject))))))
-
-(setq notmuch-folders '(("inbox" . "tag:inbox")
- ("debian-announce" . "tag:inbox AND tag:debian-announce")
- ("debian-devel" . "tag:inbox AND tag:debian-devel")
- ("debian-haskell" . "tag:inbox AND tag:debian-haskell")
- ))
-
-(defun color-inbox-if-unread () (interactive)
- (save-excursion
- (goto-char (point-min))
- (let ((cnt (car (process-lines "notmuch" "count" "tag:inbox and tag:unread"))))
- (when (> (string-to-number cnt) 0)
- (save-excursion
- (when (search-forward "inbox" (point-max) t)
- (let* ((overlays (overlays-in (match-beginning 0) (match-end 0)))
- (overlay (car overlays)))
- (when overlay
- (overlay-put overlay 'face '((:inherit bold) (:foreground "green")))))))))))
-(add-hook 'notmuch-hello-refresh-hook 'color-inbox-if-unread)
-
-(defun my-notmuch-show-view-as-patch ()
- "View the the current message as a patch."
- (interactive)
- (let* ((id (notmuch-show-get-message-id))
- (subject (concat "Subject: " (notmuch-show-get-subject) "\n"))
- (diff-default-read-only t)
- (buf (get-buffer-create (concat "*notmuch-patch-" id "*")))
- (map (make-sparse-keymap)))
- (define-key map "q" 'notmuch-kill-this-buffer)
- (switch-to-buffer buf)
- (let ((inhibit-read-only t))
- (erase-buffer)
- (insert subject)
- (insert (notmuch-get-bodypart-internal id 1 nil)))
- (set-buffer-modified-p nil)
- (diff-mode)
- (lexical-let ((new-ro-bind (cons 'buffer-read-only map)))
- (add-to-list 'minor-mode-overriding-map-alist new-ro-bind))
- (goto-char (point-min))))
nihil fit ex nihilo