Remove the use of 'spacemacs|advise-commands'

This commit is contained in:
Bet4 2018-09-18 21:23:43 +08:00 committed by duianto
parent 554ca097f2
commit 44cd57d2e2
2 changed files with 7 additions and 19 deletions

View File

@ -25,14 +25,14 @@
:defer t
:init
(progn
(spacemacs|advise-commands "store-initial-buffer-name"
(swift-mode-run-repl) around
"Store current buffer bane in bufffer local variable,
(defun spacemacs//swift-store-initial-buffer-name (func &rest args)
"Store current buffer bane in bufffer local variable,
before activiting or switching to REPL."
(let ((initial-buffer (current-buffer)))
ad-do-it
(with-current-buffer swift-repl-buffer
(setq swift-repl-mode-previous-buffer initial-buffer))))
(let ((initial-buffer (current-buffer)))
(apply func args)
(with-current-buffer swift-repl-buffer
(setq swift-repl-mode-previous-buffer initial-buffer))))
(advice-add 'swift-mode-run-repl :around #'spacemacs//swift-store-initial-buffer-name)
(defun spacemacs/swift-repl-mode-hook ()
"Hook to run when starting an interactive swift mode repl"

View File

@ -983,18 +983,6 @@ toggling fullscreen."
'maximized)
'fullboth)))))
;; taken from Prelude: https://github.com/bbatsov/prelude
(defmacro spacemacs|advise-commands (advice-name commands class &rest body)
"Apply advice named ADVICE-NAME to multiple COMMANDS.
The body of the advice is in BODY."
`(progn
,@(mapcar (lambda (command)
`(defadvice ,command
(,class ,(intern (format "%S-%s" command advice-name))
activate)
,@body))
commands)))
(defun spacemacs/safe-revert-buffer ()
"Prompt before reverting the file."
(interactive)