From 17ee0e400bef47c371afcae76037f9ea6a44ad13 Mon Sep 17 00:00:00 2001 From: William Carroll Date: Mon, 10 Sep 2018 14:51:14 -0400 Subject: Support Vim, Tmux, Emacs with Stow After moving off of Meta, Dotfiles has a greater responsibility to manage configs. Vim, Tmux, and Emacs are now within Stow's purview. --- .../evil-collection-mu4e-conversation.el | 74 ++++++++++++++++++++++ 1 file changed, 74 insertions(+) create mode 100644 configs/shared/emacs/.emacs.d/elpa/evil-collection-20180720.526/evil-collection-mu4e-conversation.el (limited to 'configs/shared/emacs/.emacs.d/elpa/evil-collection-20180720.526/evil-collection-mu4e-conversation.el') diff --git a/configs/shared/emacs/.emacs.d/elpa/evil-collection-20180720.526/evil-collection-mu4e-conversation.el b/configs/shared/emacs/.emacs.d/elpa/evil-collection-20180720.526/evil-collection-mu4e-conversation.el new file mode 100644 index 000000000000..fe592c7537a7 --- /dev/null +++ b/configs/shared/emacs/.emacs.d/elpa/evil-collection-20180720.526/evil-collection-mu4e-conversation.el @@ -0,0 +1,74 @@ +;;; evil-collection-mu4e-conversation.el --- Evil bindings for mu4e-conversation -*- lexical-binding: t -*- + +;; Copyright (C) 2018 Pierre Neidhardt + +;; Author: Pierre Neidhardt +;; Maintainer: James Nguyen +;; Pierre Neidhardt +;; URL: https://github.com/emacs-evil/evil-collection +;; Version: 0.0.1 +;; Package-Requires: ((emacs "24.4") (evil "1.2.10")) +;; Keywords: evil, mu4e, tools + +;; This file is free software; you can redistribute it and/or modify +;; it under the terms of the GNU General Public License as published +;; by the Free Software Foundation; either version 3, or (at your +;; option) any later version. +;; +;; This file is distributed in the hope that it will be useful, +;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;; GNU General Public License for more details. +;; +;; For a full copy of the GNU General Public License +;; see . + +;;; Commentary: +;; Evil bindings for mu4e-conversation. + +;;; Code: + +(require 'evil-collection) +(require 'mu4e-conversation nil t) + +(defconst evil-collection-mu4e-conversation-maps '(mu4e-conversation-map + mu4e-conversation-thread-map)) + +(defvar evil-collection-mu4e-conversation--local-map-p nil + "Non-nil if last position was on a local-map property.") + +(defun evil-collection-mu4e-conversation--switch () + "Re-compute the bindings if point has moved between the thread + area and the composition area." + (let ((local-map-here (get-text-property (point) 'local-map))) + (when (or (and evil-collection-mu4e-conversation--local-map-p + (not local-map-here)) + (and (not evil-collection-mu4e-conversation--local-map-p) + local-map-here)) + (evil-normalize-keymaps)) + (setq evil-collection-mu4e-conversation--local-map-p local-map-here))) + +(defun evil-collection-mu4e-conversation--update-local-map () + (setq evil-collection-mu4e-conversation--local-map-p (get-text-property (point) 'local-map)) + (evil-normalize-keymaps) + (add-hook 'post-command-hook 'evil-collection-mu4e-conversation--switch nil t)) + +(defun evil-collection-mu4e-conversation-setup () + "Set up `evil' bindings for `mu4e-conversation'." + ;; Evil does not update its current keymap state when it the point hits a + ;; local-map property is used. See + ;; https://github.com/emacs-evil/evil/issues/301. Thus we force the update + ;; with a technique similar to what `org~mu4e-mime-switch-headers-or-body' + ;; does. + (add-hook 'mu4e-conversation-hook 'evil-collection-mu4e-conversation--update-local-map) + (evil-collection-define-key 'normal 'mu4e-conversation-map + " " 'evil-scroll-page-down + (kbd "S-SPC") 'evil-scroll-page-up + "[" 'mu4e-conversation-previous-message + "]" 'mu4e-conversation-next-message + "zv" 'mu4e-conversation-toggle-view + "za" 'mu4e-conversation-toggle-hide-cited + "q" 'mu4e-conversation-quit)) + +(provide 'evil-collection-mu4e-conversation) +;;; evil-collection-mu4e-conversation.el ends here -- cgit 1.4.1