summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSean Whitton <spwhitton@spwhitton.name>2023-03-24 13:29:17 -0700
committerSean Whitton <spwhitton@spwhitton.name>2023-03-24 13:29:17 -0700
commit44ad0e076672ae867e48e9252dea410f3074f189 (patch)
treecedbc2169b83cf08b03ba3aceb077a169de740a8
parent37f736e2286acca0db5c728202400ba6126382a0 (diff)
downloaddotfiles-44ad0e076672ae867e48e9252dea410f3074f189.tar.gz
move some SLIME advice setup out of with-eval-after-load
-rw-r--r--.emacs.d/init.el31
1 files changed, 14 insertions, 17 deletions
diff --git a/.emacs.d/init.el b/.emacs.d/init.el
index b59e849f..a271c683 100644
--- a/.emacs.d/init.el
+++ b/.emacs.d/init.el
@@ -4454,12 +4454,24 @@ mutt's review view, after exiting EDITOR."
;; without using the customisation interface.
(setq inferior-lisp-program "sbcl")
+(defvar spw/last-command-was-slime-async-eval nil)
+(defvar spw/last-slime-async-eval-command-frame nil)
+
(defun spw/record-last-command-was-slime-async-eval (&rest ignore)
(spw/add-once-hook 'pre-command-hook
(lambda ()
(setq spw/last-command-was-slime-async-eval nil)))
(setq spw/last-command-was-slime-async-eval t
spw/last-slime-async-eval-command-frame (selected-frame)))
+(dolist (f '(slime-repl-return slime-mrepl-return
+ slime-compile-region slime-compile-file sldb-eval-in-frame
+ sldb-invoke-restart-0 sldb-invoke-restart-1
+ sldb-invoke-restart-2 sldb-invoke-restart-3
+ sldb-invoke-restart-4 sldb-invoke-restart-5
+ sldb-invoke-restart-6 sldb-invoke-restart-7
+ sldb-invoke-restart-8 sldb-invoke-restart-9
+ slime-interactive-eval slime-interrupt spw/go-to-consfig))
+ (advice-add f :after #'spw/record-last-command-was-slime-async-eval))
;; Here we assume that (spw/use-tabs-not-frames) yields nil.
(defun spw/sldb-setup-avoid-focus-grab (orig-fun &rest args)
@@ -4473,6 +4485,7 @@ that the user is expecting that it might pop up."
(apply orig-fun args))
(apply orig-fun args))))
(setq spw/last-slime-async-eval-command-frame nil))
+(advice-add 'sldb-setup :around #'spw/sldb-setup-avoid-focus-grab)
(defun spw/slime-repl-header-line (&optional pwd)
(with-current-buffer (slime-connection-output-buffer)
@@ -4493,24 +4506,8 @@ that the user is expecting that it might pop up."
(advice-add 'slime-set-default-directory :after #'spw/slime-repl-header-line)
(with-eval-after-load 'slime-repl
(add-hook 'slime-change-directory-hooks #'spw/slime-repl-header-line))
-
(with-eval-after-load 'slime
- (setq slime-contribs (remq 'slime-banner slime-contribs))
-
- (defvar spw/last-command-was-slime-async-eval nil)
- (defvar spw/last-slime-async-eval-command-frame nil)
-
- (dolist (f '(slime-repl-return slime-mrepl-return
- slime-compile-region slime-compile-file sldb-eval-in-frame
- sldb-invoke-restart-0 sldb-invoke-restart-1
- sldb-invoke-restart-2 sldb-invoke-restart-3
- sldb-invoke-restart-4 sldb-invoke-restart-5
- sldb-invoke-restart-6 sldb-invoke-restart-7
- sldb-invoke-restart-8 sldb-invoke-restart-9
- slime-interactive-eval slime-interrupt spw/go-to-consfig))
- (advice-add f :after #'spw/record-last-command-was-slime-async-eval))
-
- (advice-add 'sldb-setup :around #'spw/sldb-setup-avoid-focus-grab))
+ (setq slime-contribs (remq 'slime-banner slime-contribs)))
(defun spw/slime-clear-source-registry ()
(interactive)