diff options
| author | Frank Fischer <frank.fischer@mathematik.tu-chemnitz.de> | 2012-02-09 09:50:26 +0100 |
|---|---|---|
| committer | Frank Fischer <frank.fischer@mathematik.tu-chemnitz.de> | 2012-02-09 09:50:26 +0100 |
| commit | f625a5256af4b95c77738faff4ccd786cd80a683 (patch) | |
| tree | a651eb550be2da78b86a105add7dbae5839e150d | |
| parent | d60cb3d0b3448dd7e6d340e6096165943e8c939a (diff) | |
Do not load "goto-chg.el" from "evil-integration.el"
If the goto-chg.el package is available and installed properly it is
autoloaded (or should be loaded manually). The corresponding motions
g; and g, are now *always* bound to `goto-last-change' and
`goto-last-change-reverse', resp., and work if goto-chg.el is
available, otherwise an error is raised. The old implementation loaded
"goto-chg.el" automatically from "evil-integration.el". But even if
this succeeded the corresponding bindings for g; and g, would not have
been installed (unless "goto-chg.el" had been loaded manually before
evil), because "evil-maps.el" is loaded *before*
"evil-integration.el", thus the loading of "goto-chg.el" in the latter
file is useless.
The package "lib/goto-chg.el" coming with evil is loaded automatically
for "make emacs" and "make terminal".
| -rw-r--r-- | Makefile | 8 | ||||
| -rw-r--r-- | evil-integration.el | 5 | ||||
| -rw-r--r-- | evil-maps.el | 6 | ||||
| -rw-r--r-- | evil.el | 9 |
4 files changed, 16 insertions, 12 deletions
@@ -64,18 +64,20 @@ tests: compile # Load Evil in a fresh instance of Emacs and run all tests. emacs: - $(EMACS) -Q -L . $(LIBS) -l evil-tests.el --eval "(evil-mode 1)" \ + $(EMACS) -Q -L . $(LIBS) -l goto-chg.el -l evil-tests.el \ +--eval "(evil-mode 1)" \ --eval "(evil-tests-initialize '(${TAG}) '(${PROFILER}) t)" & # Load Evil in a terminal Emacs and run all tests. term: terminal terminal: - $(EMACS) -nw -Q -L . $(LIBS) -l evil-tests.el --eval "(evil-mode 1)" \ + $(EMACS) -nw -Q -L . $(LIBS) -l goto-chg.el -l evil-tests.el \ +--eval "(evil-mode 1)" \ --eval "(evil-tests-initialize '(${TAG}) '(${PROFILER}) t)" # Run all tests with profiler. profiler: - $(EMACS) --batch -Q -L . $(LIBS) -l evil-tests.el \ + $(EMACS) --batch -Q -L . $(LIBS) -l goto-chg.el -l evil-tests.el \ --eval "(evil-tests-initialize '(${TAG}) (or '(${PROFILER}) t))" # Re-indent all Evil code. diff --git a/evil-integration.el b/evil-integration.el index 7e2e711..8753eec 100644 --- a/evil-integration.el +++ b/evil-integration.el @@ -101,11 +101,6 @@ '(defadvice elp-results (after evil activate) (evil-motion-state))) -;; load goto-chg.el if available -(condition-case nil - (require 'goto-chg) - (error nil)) - ;;; Info (evil-add-hjkl-bindings Info-mode-map 'motion diff --git a/evil-maps.el b/evil-maps.el index b17f6f2..769061f 100644 --- a/evil-maps.el +++ b/evil-maps.el @@ -65,10 +65,8 @@ (define-key evil-normal-state-map [remap yank-pop] 'evil-paste-pop) ;; go to last change -(when (fboundp 'goto-last-change) - (define-key evil-normal-state-map "g;" 'goto-last-change)) -(when (fboundp 'goto-last-change-reverse) - (define-key evil-normal-state-map "g," 'goto-last-change-reverse)) +(define-key evil-normal-state-map "g;" 'goto-last-change) +(define-key evil-normal-state-map "g," 'goto-last-change-reverse) ;; undo (define-key evil-normal-state-map "u" 'undo) @@ -47,6 +47,15 @@ ;; http://www.emacswiki.org/emacs/UndoTree ;; ;; Otherwise, Evil uses regular Emacs undo. +;; +;; Evil requires `goto-last-change' and `goto-last-change-reverse' +;; function for the corresponding motions g; g, as well as the +;; last-change-register `.'. One package providing these functions is +;; goto-chg.el: +;; +;; http://www.emacswiki.org/emacs/GotoChg +;; +;; Without this package the corresponding motions will raise an error. ;;; License: |
