Clean up evil-collection-util

This commit is contained in:
James Nguyen 2017-12-09 08:00:24 -08:00
parent be63ed1dfa
commit df5d161017
12 changed files with 11 additions and 60 deletions

View File

@ -28,7 +28,7 @@
;;; Code:
(require 'cider nil t)
(require 'evil-collection-util)
(require 'evil)
(defun evil-collection-cider-last-sexp (command &rest args)
"In normal-state or motion-state, last sexp ends at point."

View File

@ -27,7 +27,7 @@
;; Evil bindings for `compile'.
;;; Code:
(require 'evil-collection-util)
(require 'evil)
(require 'compile)
(defun evil-collection-compile-setup ()

View File

@ -28,7 +28,7 @@
;;; Code:
(require 'dired)
(require 'evil-collection-util)
(require 'evil)
(defun evil-collection-dired-setup ()
"Set up `evil' bindings for `dired'."

View File

@ -28,7 +28,7 @@
;; `evil-mode'.
;;; Code:
(require 'evil-collection-util)
(require 'evil)
(require 'elisp-refs nil t)
(defun evil-collection-elisp-refs-setup ()

View File

@ -27,7 +27,7 @@
;; Evil bindings for `flycheck-mode'.
;;; Code:
(require 'evil-collection-util)
(require 'evil)
(require 'flycheck nil t)
(defvar flycheck-error-list-mode-map)

View File

@ -27,7 +27,7 @@
;; Evil bindings for `ggtags-mode'.
;;; Code:
(require 'evil-collection-util)
(require 'evil)
(require 'ggtags nil t)
(defvar ggtags-global-mode-map)

View File

@ -27,7 +27,7 @@
;; Evil bindings for `macrostep-mode'.
;;; Code:
(require 'evil-collection-util)
(require 'evil)
(require 'macrostep nil t)
(defun evil-collection-macrostep-setup ()

View File

@ -27,7 +27,7 @@
;; Evil bindings for `occur'.
;;; Code:
(require 'evil-collection-util)
(require 'evil)
(when (> emacs-major-version 25)
(require 'replace))

View File

@ -27,7 +27,7 @@
;; Evil bindings for `pass-mode'.
;;; Code:
(require 'evil-collection-util)
(require 'evil)
(require 'pass nil t)
(defvar pass-mode-map)

View File

@ -1,49 +0,0 @@
;;; evil-collection-util.el --- Base Evil Utilities -*- lexical-binding: t -*-
;; Copyright (C) 2017 James Nguyen
;; Author: James Nguyen <james@jojojames.com>
;; Maintainer: James Nguyen <james@jojojames.com>
;; Pierre Neidhardt <ambrevar@gmail.com>
;; URL: https://github.com/jojojames/evil-collection
;; Version: 0.0.1
;; Package-Requires: ((emacs "25.1"))
;; Keywords: evil, tools
;; This program 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 of the License, or
;; (at your option) any later version.
;; This program 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.
;; You should have received a copy of the GNU General Public License
;; along with this program. If not, see <http://www.gnu.org/licenses/>.
;;; Commentary:
;; This package provides a set of utility functions to integrate with
;; `evil-mode'.
;;; Code:
(require 'evil)
(defmacro evil-collection-util-set-initial-state (mode state)
"Set the default STATE for MODE."
(let* ((mode-str (symbol-name mode))
(state-str (symbol-name state))
(defun-name (intern (format "evil-collection-%s-set-%s-default"
mode-str
state-str))))
`(progn
(defun ,defun-name (&rest _)
,(format "Default `evil-state' of `%s' to '%s." mode-str state-str)
(if ,mode
(,(intern (format "evil-%s-state" state)))
(evil-normal-state)))
(advice-add #',mode :after #',defun-name))))
(provide 'evil-collection-util)
;;; evil-collection-util.el ends here

View File

@ -27,7 +27,7 @@
;; Evil bindings for `vlf'.
;;; Code:
(require 'evil-collection-util)
(require 'evil)
(require 'vlf nil t)
(defvar vlf-mode-map)

View File

@ -27,7 +27,7 @@
;; Evil bindings for `xref'.
;;; Code:
(require 'evil-collection-util)
(require 'evil)
(require 'xref)
(defun evil-collection-xref-setup ()