diff --git a/Makefile b/Makefile index 6563e5e..a4cccfb 100755 --- a/Makefile +++ b/Makefile @@ -3,8 +3,9 @@ EMACS ?= emacs compile: cask exec $(EMACS) -Q -batch \ -L . \ + --eval '(setq evil-want-integration nil)' \ --eval '(setq byte-compile-error-on-warn t)' \ - -f batch-byte-compile *.el + -f batch-byte-compile *.el modes/*/*.el lint: cask exec $(EMACS) -Q -batch \ @@ -14,7 +15,7 @@ lint: --eval "(package-refresh-contents)" \ -l package-lint.el \ --eval "(advice-add 'package-lint--check-eval-after-load :around 'ignore)" \ - -f package-lint-batch-and-exit *.el + -f package-lint-batch-and-exit *.el modes/*/*.el test: cask exec ert-runner diff --git a/evil-collection.el b/evil-collection.el index 2908a03..39bccc9 100644 --- a/evil-collection.el +++ b/evil-collection.el @@ -37,6 +37,9 @@ (require 'evil) (require 'annalist) +(defvar evil-collection-base-dir (file-name-directory load-file-name) + "Store the directory evil-collection.el was loaded from.") + (defvar evil-want-integration) (defvar evil-want-keybinding) (if (featurep 'evil-keybindings) @@ -377,6 +380,41 @@ modes in the current buffer." 'evil-collection-active 'evil-collection-valid))) +(defun evil-collection--mode-file (mode file) + "Return path to FILE for MODE. Return nil if it doesn't exist." + (let ((path (expand-file-name + (format "modes/%s/%s" mode file) evil-collection-base-dir))) + (when (file-exists-p path) + path))) + +(defun evil-collection-open-config-file (mode) + "Open configuration file corresponding to MODE." + (interactive + (list + (completing-read + "Mode: " + (cl-remove-if-not + (lambda (mode) + (evil-collection--mode-file mode (format "evil-collection-%s.el" mode))) + (directory-files + (expand-file-name "modes" evil-collection-base-dir) + nil "^[^.]"))))) + (find-file (evil-collection--mode-file mode (format "evil-collection-%s.el" mode)))) + +(defun evil-collection-open-readme (mode) + "Open README.org corresponding to MODE." + (interactive + (list + (completing-read + "Mode: " + (cl-remove-if-not + (lambda (mode) + (evil-collection--mode-file mode "README.org")) + (directory-files + (expand-file-name "modes" evil-collection-base-dir) + nil "^[^.]"))))) + (find-file (evil-collection--mode-file mode "README.org"))) + (defun evil-collection--translate-key (state keymap-symbol translations destructive) @@ -485,7 +523,9 @@ instead of the modes in `evil-collection-mode-list'." reqs (cdr mode))) (dolist (req reqs) (with-eval-after-load req - (require (intern (concat "evil-collection-" (symbol-name m)))) + (load (expand-file-name (format "modes/%s/evil-collection-%s" m m) + evil-collection-base-dir) + nil t) (funcall (intern (concat "evil-collection-" (symbol-name m) "-setup"))) (let ((mode-keymaps diff --git a/evil-collection-ag.el b/modes/ag/evil-collection-ag.el similarity index 100% rename from evil-collection-ag.el rename to modes/ag/evil-collection-ag.el diff --git a/evil-collection-alchemist.el b/modes/alchemist/evil-collection-alchemist.el similarity index 100% rename from evil-collection-alchemist.el rename to modes/alchemist/evil-collection-alchemist.el diff --git a/evil-collection-anaconda-mode.el b/modes/anaconda-mode/evil-collection-anaconda-mode.el similarity index 100% rename from evil-collection-anaconda-mode.el rename to modes/anaconda-mode/evil-collection-anaconda-mode.el diff --git a/evil-collection-arc-mode.el b/modes/arc-mode/evil-collection-arc-mode.el similarity index 100% rename from evil-collection-arc-mode.el rename to modes/arc-mode/evil-collection-arc-mode.el diff --git a/evil-collection-bookmark.el b/modes/bookmark/evil-collection-bookmark.el similarity index 100% rename from evil-collection-bookmark.el rename to modes/bookmark/evil-collection-bookmark.el diff --git a/evil-collection-buff-menu.el b/modes/buff-menu/evil-collection-buff-menu.el similarity index 100% rename from evil-collection-buff-menu.el rename to modes/buff-menu/evil-collection-buff-menu.el diff --git a/evil-collection-calc.el b/modes/calc/evil-collection-calc.el similarity index 100% rename from evil-collection-calc.el rename to modes/calc/evil-collection-calc.el diff --git a/evil-collection-calendar.el b/modes/calendar/evil-collection-calendar.el similarity index 100% rename from evil-collection-calendar.el rename to modes/calendar/evil-collection-calendar.el diff --git a/evil-collection-cider.el b/modes/cider/evil-collection-cider.el similarity index 100% rename from evil-collection-cider.el rename to modes/cider/evil-collection-cider.el diff --git a/evil-collection-cmake-mode.el b/modes/cmake-mode/evil-collection-cmake-mode.el similarity index 100% rename from evil-collection-cmake-mode.el rename to modes/cmake-mode/evil-collection-cmake-mode.el diff --git a/evil-collection-comint.el b/modes/comint/evil-collection-comint.el similarity index 100% rename from evil-collection-comint.el rename to modes/comint/evil-collection-comint.el diff --git a/evil-collection-company.el b/modes/company/evil-collection-company.el similarity index 100% rename from evil-collection-company.el rename to modes/company/evil-collection-company.el diff --git a/evil-collection-compile.el b/modes/compile/evil-collection-compile.el similarity index 100% rename from evil-collection-compile.el rename to modes/compile/evil-collection-compile.el diff --git a/evil-collection-cus-theme.el b/modes/cus-theme/evil-collection-cus-theme.el similarity index 100% rename from evil-collection-cus-theme.el rename to modes/cus-theme/evil-collection-cus-theme.el diff --git a/evil-collection-custom.el b/modes/custom/evil-collection-custom.el similarity index 100% rename from evil-collection-custom.el rename to modes/custom/evil-collection-custom.el diff --git a/evil-collection-daemons.el b/modes/daemons/evil-collection-daemons.el similarity index 100% rename from evil-collection-daemons.el rename to modes/daemons/evil-collection-daemons.el diff --git a/evil-collection-debbugs.el b/modes/debbugs/evil-collection-debbugs.el similarity index 100% rename from evil-collection-debbugs.el rename to modes/debbugs/evil-collection-debbugs.el diff --git a/evil-collection-debug.el b/modes/debug/evil-collection-debug.el similarity index 100% rename from evil-collection-debug.el rename to modes/debug/evil-collection-debug.el diff --git a/evil-collection-diff-mode.el b/modes/diff-mode/evil-collection-diff-mode.el similarity index 100% rename from evil-collection-diff-mode.el rename to modes/diff-mode/evil-collection-diff-mode.el diff --git a/evil-collection-dired.el b/modes/dired/evil-collection-dired.el similarity index 100% rename from evil-collection-dired.el rename to modes/dired/evil-collection-dired.el diff --git a/evil-collection-doc-view.el b/modes/doc-view/evil-collection-doc-view.el similarity index 100% rename from evil-collection-doc-view.el rename to modes/doc-view/evil-collection-doc-view.el diff --git a/evil-collection-edebug.el b/modes/edebug/evil-collection-edebug.el similarity index 100% rename from evil-collection-edebug.el rename to modes/edebug/evil-collection-edebug.el diff --git a/evil-collection-ediff.el b/modes/ediff/evil-collection-ediff.el similarity index 100% rename from evil-collection-ediff.el rename to modes/ediff/evil-collection-ediff.el diff --git a/evil-collection-elfeed.el b/modes/elfeed/evil-collection-elfeed.el similarity index 100% rename from evil-collection-elfeed.el rename to modes/elfeed/evil-collection-elfeed.el diff --git a/evil-collection-elisp-mode.el b/modes/elisp-mode/evil-collection-elisp-mode.el similarity index 100% rename from evil-collection-elisp-mode.el rename to modes/elisp-mode/evil-collection-elisp-mode.el diff --git a/evil-collection-elisp-refs.el b/modes/elisp-refs/evil-collection-elisp-refs.el similarity index 100% rename from evil-collection-elisp-refs.el rename to modes/elisp-refs/evil-collection-elisp-refs.el diff --git a/evil-collection-emms.el b/modes/emms/evil-collection-emms.el similarity index 100% rename from evil-collection-emms.el rename to modes/emms/evil-collection-emms.el diff --git a/evil-collection-epa.el b/modes/epa/evil-collection-epa.el similarity index 100% rename from evil-collection-epa.el rename to modes/epa/evil-collection-epa.el diff --git a/evil-collection-ert.el b/modes/ert/evil-collection-ert.el similarity index 100% rename from evil-collection-ert.el rename to modes/ert/evil-collection-ert.el diff --git a/evil-collection-eshell.el b/modes/eshell/evil-collection-eshell.el similarity index 100% rename from evil-collection-eshell.el rename to modes/eshell/evil-collection-eshell.el diff --git a/evil-collection-eval-sexp-fu.el b/modes/eval-sexp-fu/evil-collection-eval-sexp-fu.el similarity index 100% rename from evil-collection-eval-sexp-fu.el rename to modes/eval-sexp-fu/evil-collection-eval-sexp-fu.el diff --git a/evil-collection-eww.el b/modes/eww/evil-collection-eww.el similarity index 100% rename from evil-collection-eww.el rename to modes/eww/evil-collection-eww.el diff --git a/evil-collection-flycheck.el b/modes/flycheck/evil-collection-flycheck.el similarity index 100% rename from evil-collection-flycheck.el rename to modes/flycheck/evil-collection-flycheck.el diff --git a/evil-collection-free-keys.el b/modes/free-keys/evil-collection-free-keys.el similarity index 100% rename from evil-collection-free-keys.el rename to modes/free-keys/evil-collection-free-keys.el diff --git a/evil-collection-geiser.el b/modes/geiser/evil-collection-geiser.el similarity index 100% rename from evil-collection-geiser.el rename to modes/geiser/evil-collection-geiser.el diff --git a/evil-collection-ggtags.el b/modes/ggtags/evil-collection-ggtags.el similarity index 100% rename from evil-collection-ggtags.el rename to modes/ggtags/evil-collection-ggtags.el diff --git a/evil-collection-git-timemachine.el b/modes/git-timemachine/evil-collection-git-timemachine.el similarity index 100% rename from evil-collection-git-timemachine.el rename to modes/git-timemachine/evil-collection-git-timemachine.el diff --git a/evil-collection-go-mode.el b/modes/go-mode/evil-collection-go-mode.el similarity index 100% rename from evil-collection-go-mode.el rename to modes/go-mode/evil-collection-go-mode.el diff --git a/evil-collection-grep.el b/modes/grep/evil-collection-grep.el similarity index 100% rename from evil-collection-grep.el rename to modes/grep/evil-collection-grep.el diff --git a/evil-collection-guix.el b/modes/guix/evil-collection-guix.el similarity index 100% rename from evil-collection-guix.el rename to modes/guix/evil-collection-guix.el diff --git a/evil-collection-helm.el b/modes/helm/evil-collection-helm.el similarity index 100% rename from evil-collection-helm.el rename to modes/helm/evil-collection-helm.el diff --git a/evil-collection-help.el b/modes/help/evil-collection-help.el similarity index 100% rename from evil-collection-help.el rename to modes/help/evil-collection-help.el diff --git a/evil-collection-ibuffer.el b/modes/ibuffer/evil-collection-ibuffer.el similarity index 100% rename from evil-collection-ibuffer.el rename to modes/ibuffer/evil-collection-ibuffer.el diff --git a/evil-collection-image+.el b/modes/image+/evil-collection-image+.el similarity index 100% rename from evil-collection-image+.el rename to modes/image+/evil-collection-image+.el diff --git a/evil-collection-image.el b/modes/image/evil-collection-image.el similarity index 100% rename from evil-collection-image.el rename to modes/image/evil-collection-image.el diff --git a/evil-collection-imenu-list.el b/modes/imenu-list/evil-collection-imenu-list.el similarity index 100% rename from evil-collection-imenu-list.el rename to modes/imenu-list/evil-collection-imenu-list.el diff --git a/evil-collection-indium.el b/modes/indium/evil-collection-indium.el similarity index 100% rename from evil-collection-indium.el rename to modes/indium/evil-collection-indium.el diff --git a/evil-collection-info.el b/modes/info/evil-collection-info.el similarity index 100% rename from evil-collection-info.el rename to modes/info/evil-collection-info.el diff --git a/evil-collection-ivy.el b/modes/ivy/evil-collection-ivy.el similarity index 100% rename from evil-collection-ivy.el rename to modes/ivy/evil-collection-ivy.el diff --git a/evil-collection-js2-mode.el b/modes/js2-mode/evil-collection-js2-mode.el similarity index 100% rename from evil-collection-js2-mode.el rename to modes/js2-mode/evil-collection-js2-mode.el diff --git a/evil-collection-kotlin-mode.el b/modes/kotlin-mode/evil-collection-kotlin-mode.el similarity index 100% rename from evil-collection-kotlin-mode.el rename to modes/kotlin-mode/evil-collection-kotlin-mode.el diff --git a/evil-collection-log-view.el b/modes/log-view/evil-collection-log-view.el similarity index 100% rename from evil-collection-log-view.el rename to modes/log-view/evil-collection-log-view.el diff --git a/evil-collection-lsp-ui-imenu.el b/modes/lsp-ui-imenu/evil-collection-lsp-ui-imenu.el similarity index 100% rename from evil-collection-lsp-ui-imenu.el rename to modes/lsp-ui-imenu/evil-collection-lsp-ui-imenu.el diff --git a/evil-collection-lua-mode.el b/modes/lua-mode/evil-collection-lua-mode.el similarity index 100% rename from evil-collection-lua-mode.el rename to modes/lua-mode/evil-collection-lua-mode.el diff --git a/evil-collection-macrostep.el b/modes/macrostep/evil-collection-macrostep.el similarity index 100% rename from evil-collection-macrostep.el rename to modes/macrostep/evil-collection-macrostep.el diff --git a/evil-collection-magit.el b/modes/magit/evil-collection-magit.el similarity index 100% rename from evil-collection-magit.el rename to modes/magit/evil-collection-magit.el diff --git a/evil-collection-man.el b/modes/man/evil-collection-man.el similarity index 100% rename from evil-collection-man.el rename to modes/man/evil-collection-man.el diff --git a/evil-collection-minibuffer.el b/modes/minibuffer/evil-collection-minibuffer.el similarity index 100% rename from evil-collection-minibuffer.el rename to modes/minibuffer/evil-collection-minibuffer.el diff --git a/evil-collection-mu4e-conversation.el b/modes/mu4e-conversation/evil-collection-mu4e-conversation.el similarity index 100% rename from evil-collection-mu4e-conversation.el rename to modes/mu4e-conversation/evil-collection-mu4e-conversation.el diff --git a/evil-collection-mu4e.el b/modes/mu4e/evil-collection-mu4e.el similarity index 100% rename from evil-collection-mu4e.el rename to modes/mu4e/evil-collection-mu4e.el diff --git a/evil-collection-neotree.el b/modes/neotree/evil-collection-neotree.el similarity index 100% rename from evil-collection-neotree.el rename to modes/neotree/evil-collection-neotree.el diff --git a/evil-collection-notmuch.el b/modes/notmuch/evil-collection-notmuch.el similarity index 100% rename from evil-collection-notmuch.el rename to modes/notmuch/evil-collection-notmuch.el diff --git a/evil-collection-nov.el b/modes/nov/evil-collection-nov.el similarity index 100% rename from evil-collection-nov.el rename to modes/nov/evil-collection-nov.el diff --git a/evil-collection-occur.el b/modes/occur/evil-collection-occur.el similarity index 100% rename from evil-collection-occur.el rename to modes/occur/evil-collection-occur.el diff --git a/evil-collection-outline.el b/modes/outline/evil-collection-outline.el similarity index 100% rename from evil-collection-outline.el rename to modes/outline/evil-collection-outline.el diff --git a/evil-collection-p4.el b/modes/p4/evil-collection-p4.el similarity index 100% rename from evil-collection-p4.el rename to modes/p4/evil-collection-p4.el diff --git a/evil-collection-package-menu.el b/modes/package-menu/evil-collection-package-menu.el similarity index 100% rename from evil-collection-package-menu.el rename to modes/package-menu/evil-collection-package-menu.el diff --git a/evil-collection-pass.el b/modes/pass/evil-collection-pass.el similarity index 100% rename from evil-collection-pass.el rename to modes/pass/evil-collection-pass.el diff --git a/evil-collection-pdf.el b/modes/pdf/evil-collection-pdf.el similarity index 100% rename from evil-collection-pdf.el rename to modes/pdf/evil-collection-pdf.el diff --git a/evil-collection-popup.el b/modes/popup/evil-collection-popup.el similarity index 100% rename from evil-collection-popup.el rename to modes/popup/evil-collection-popup.el diff --git a/evil-collection-proced.el b/modes/proced/evil-collection-proced.el similarity index 100% rename from evil-collection-proced.el rename to modes/proced/evil-collection-proced.el diff --git a/evil-collection-prodigy.el b/modes/prodigy/evil-collection-prodigy.el similarity index 100% rename from evil-collection-prodigy.el rename to modes/prodigy/evil-collection-prodigy.el diff --git a/evil-collection-profiler.el b/modes/profiler/evil-collection-profiler.el similarity index 100% rename from evil-collection-profiler.el rename to modes/profiler/evil-collection-profiler.el diff --git a/evil-collection-python.el b/modes/python/evil-collection-python.el similarity index 100% rename from evil-collection-python.el rename to modes/python/evil-collection-python.el diff --git a/evil-collection-quickrun.el b/modes/quickrun/evil-collection-quickrun.el similarity index 100% rename from evil-collection-quickrun.el rename to modes/quickrun/evil-collection-quickrun.el diff --git a/evil-collection-racer.el b/modes/racer/evil-collection-racer.el similarity index 100% rename from evil-collection-racer.el rename to modes/racer/evil-collection-racer.el diff --git a/evil-collection-realgud.el b/modes/realgud/evil-collection-realgud.el similarity index 100% rename from evil-collection-realgud.el rename to modes/realgud/evil-collection-realgud.el diff --git a/evil-collection-reftex.el b/modes/reftex/evil-collection-reftex.el similarity index 100% rename from evil-collection-reftex.el rename to modes/reftex/evil-collection-reftex.el diff --git a/evil-collection-rjsx-mode.el b/modes/rjsx-mode/evil-collection-rjsx-mode.el similarity index 100% rename from evil-collection-rjsx-mode.el rename to modes/rjsx-mode/evil-collection-rjsx-mode.el diff --git a/evil-collection-robe.el b/modes/robe/evil-collection-robe.el similarity index 100% rename from evil-collection-robe.el rename to modes/robe/evil-collection-robe.el diff --git a/evil-collection-rtags.el b/modes/rtags/evil-collection-rtags.el similarity index 100% rename from evil-collection-rtags.el rename to modes/rtags/evil-collection-rtags.el diff --git a/evil-collection-ruby-mode.el b/modes/ruby-mode/evil-collection-ruby-mode.el similarity index 100% rename from evil-collection-ruby-mode.el rename to modes/ruby-mode/evil-collection-ruby-mode.el diff --git a/evil-collection-simple.el b/modes/simple/evil-collection-simple.el similarity index 100% rename from evil-collection-simple.el rename to modes/simple/evil-collection-simple.el diff --git a/evil-collection-slime.el b/modes/slime/evil-collection-slime.el similarity index 100% rename from evil-collection-slime.el rename to modes/slime/evil-collection-slime.el diff --git a/evil-collection-term.el b/modes/term/evil-collection-term.el similarity index 100% rename from evil-collection-term.el rename to modes/term/evil-collection-term.el diff --git a/evil-collection-tide.el b/modes/tide/evil-collection-tide.el similarity index 100% rename from evil-collection-tide.el rename to modes/tide/evil-collection-tide.el diff --git a/evil-collection-transmission.el b/modes/transmission/evil-collection-transmission.el similarity index 100% rename from evil-collection-transmission.el rename to modes/transmission/evil-collection-transmission.el diff --git a/evil-collection-typescript-mode.el b/modes/typescript-mode/evil-collection-typescript-mode.el similarity index 100% rename from evil-collection-typescript-mode.el rename to modes/typescript-mode/evil-collection-typescript-mode.el diff --git a/evil-collection-vc-annotate.el b/modes/vc-annotate/evil-collection-vc-annotate.el similarity index 100% rename from evil-collection-vc-annotate.el rename to modes/vc-annotate/evil-collection-vc-annotate.el diff --git a/evil-collection-vc-git.el b/modes/vc-git/evil-collection-vc-git.el similarity index 100% rename from evil-collection-vc-git.el rename to modes/vc-git/evil-collection-vc-git.el diff --git a/evil-collection-vdiff.el b/modes/vdiff/evil-collection-vdiff.el similarity index 100% rename from evil-collection-vdiff.el rename to modes/vdiff/evil-collection-vdiff.el diff --git a/evil-collection-view.el b/modes/view/evil-collection-view.el similarity index 100% rename from evil-collection-view.el rename to modes/view/evil-collection-view.el diff --git a/evil-collection-vlf.el b/modes/vlf/evil-collection-vlf.el similarity index 100% rename from evil-collection-vlf.el rename to modes/vlf/evil-collection-vlf.el diff --git a/evil-collection-wdired.el b/modes/wdired/evil-collection-wdired.el similarity index 100% rename from evil-collection-wdired.el rename to modes/wdired/evil-collection-wdired.el diff --git a/evil-collection-wgrep.el b/modes/wgrep/evil-collection-wgrep.el similarity index 100% rename from evil-collection-wgrep.el rename to modes/wgrep/evil-collection-wgrep.el diff --git a/evil-collection-which-key.el b/modes/which-key/evil-collection-which-key.el similarity index 100% rename from evil-collection-which-key.el rename to modes/which-key/evil-collection-which-key.el diff --git a/evil-collection-woman.el b/modes/woman/evil-collection-woman.el similarity index 100% rename from evil-collection-woman.el rename to modes/woman/evil-collection-woman.el diff --git a/evil-collection-xref.el b/modes/xref/evil-collection-xref.el similarity index 100% rename from evil-collection-xref.el rename to modes/xref/evil-collection-xref.el diff --git a/evil-collection-ztree.el b/modes/ztree/evil-collection-ztree.el similarity index 100% rename from evil-collection-ztree.el rename to modes/ztree/evil-collection-ztree.el