Move spacemacs/next-error and spacemacs/previous-error to func.el

And remove associated keybindings from spacemacs/init-flycheck

- fixes issue #567
- this binds both SPC e N and SPC e p to spacemacs/previous-error
This commit is contained in:
Christoph Paulik 2015-02-11 00:03:06 +01:00 committed by syl20bnr
parent 00ae3672ff
commit 4293313413
3 changed files with 20 additions and 20 deletions

View file

@ -805,6 +805,22 @@ If ASCII si not provided then UNICODE is used instead."
(start-process "" nil "xdg-open" file-path)))
)))
(defun spacemacs/next-error (&optional n reset)
"Dispatch to flycheck or standard emacs error."
(interactive "P")
(if (and (boundp 'flycheck-mode)
(symbol-value flycheck-mode))
(call-interactively 'flycheck-next-error)
(call-interactively 'next-error)))
(defun spacemacs/previous-error (&optional n reset)
"Dispatch to flycheck or standard emacs error."
(interactive "P")
(if (and (boundp 'flycheck-mode)
(symbol-value flycheck-mode))
(call-interactively 'flycheck-previous-error)
(call-interactively 'previous-error)))
;; Window Manipulation Micro State
(defun spacemacs/shrink-window-horizontally (delta)

View file

@ -72,8 +72,9 @@
"hdv" 'describe-variable)
;; errors ---------------------------------------------------------------------
(evil-leader/set-key
"en" 'next-error
"ep" 'previous-error)
"en" 'spacemacs/next-error
"ep" 'spacemacs/previous-error
"eN" 'spacemacs/previous-error)
;; find -----------------------------------------------------------------------
(evil-leader/set-key
"ff" 'ido-find-file

View file

@ -996,29 +996,12 @@ which require an initialization must be listed explicitly in the list.")
:fringe-bitmap 'my-flycheck-fringe-indicator
:fringe-face 'flycheck-fringe-info)
(defun spacemacs/next-error (&optional n reset)
"Dispatch to flycheck or standard emacs error."
(interactive "P")
(if (and (boundp 'flycheck-mode)
(symbol-value flycheck-mode))
(call-interactively 'flycheck-next-error)
(call-interactively 'next-error)))
(defun spacemacs/previous-error (&optional n reset)
"Dispatch to flycheck or standard emacs error."
(interactive "P")
(if (and (boundp 'flycheck-mode)
(symbol-value flycheck-mode))
(call-interactively 'flycheck-previous-error)
(call-interactively 'previous-error)))
;; key bindings
(evil-leader/set-key
"ec" 'flycheck-clear
"ef" 'flycheck-mode
"el" 'flycheck-list-errors
"en" 'spacemacs/next-error
"eN" 'spacemacs/previous-error))))
"el" 'flycheck-list-errors))))
(defun spacemacs/init-flyspell ()
(use-package flyspell