Replace define-advice with advice-add in the shell layer

`define-advice` requires Emacs 25.

 Addresses: https://github.com/syl20bnr/spacemacs/pull/8635#issuecomment-297887734
This commit is contained in:
Steven Allen 2017-04-29 15:50:15 -07:00 committed by syl20bnr
parent e17460f0e6
commit 604c24bf0e
1 changed files with 5 additions and 1 deletions

View File

@ -89,12 +89,16 @@
;; buffer. This breaks the xterm color filtering when the eshell buffer is updated
;; when it's not currently focused.
;; To remove if/when fixed upstream.
(define-advice eshell-output-filter (:around (fn process string) with-buffer)
(defun eshell-output-filter@spacemacs-with-buffer (fn process string)
(let ((proc-buf (if process (process-buffer process)
(current-buffer))))
(when proc-buf
(with-current-buffer proc-buf
(funcall fn process string)))))
(advice-add
#'eshell-output-filter
:around
#'eshell-output-filter@spacemacs-with-buffer)
(require 'esh-opt)