Skip to content

Commit e399856

Browse files
authored
Merge pull request #884 from Homo-carbonis/main
Use (switch-to-window) where appropriate.
2 parents 6494f6e + aed1a6f commit e399856

File tree

13 files changed

+17
-19
lines changed

13 files changed

+17
-19
lines changed

modes/elisp-mode/run-elisp.lisp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@
5959
(when (ppcre:scan "^[0-9]+>" (line-string p))
6060
(lem/listener-mode:refresh-prompt buffer nil))
6161
(unless already-exists
62-
(setf (current-window) (pop-to-buffer buffer)))
62+
(switch-to-window (pop-to-buffer buffer)))
6363
(alexandria:when-let (window (first (get-buffer-windows buffer)))
6464
(with-current-window window
6565
(buffer-end p)

modes/elixir-mode/run-elixir.lisp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@
5656
(when (ppcre:scan "^(iex|...)(.+)" (line-string p))
5757
(lem/listener-mode:refresh-prompt buffer nil))
5858
(unless already-exists
59-
(setf (current-window) (pop-to-buffer buffer)))
59+
(switch-to-window (pop-to-buffer buffer)))
6060
(alexandria:when-let (window (first (get-buffer-windows buffer)))
6161
(with-current-window window
6262
(buffer-end p)

modes/lisp-mode/inspector.lisp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@
103103
(move-to-line point (car inspector-position))
104104
(line-offset point 0 (cdr inspector-position))))))
105105
(cond (focus
106-
(setf (current-window) (pop-to-buffer buffer :split-action :negative))
106+
(switch-to-window (pop-to-buffer buffer :split-action :negative))
107107
(body))
108108
(t
109109
(with-current-window (pop-to-buffer buffer :split-action :negative)

modes/lisp-mode/lisp-mode.lisp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -975,7 +975,7 @@
975975
(let ((xref-location (source-location-to-xref-location source-location)))
976976
(go-to-location xref-location
977977
(lambda (buffer)
978-
(setf (current-window)
978+
(switch-to-window
979979
(pop-to-buffer buffer))))))))
980980

981981
(defun source-location-to-xref-location (location &optional content no-errors)

modes/lisp-mode/repl.lisp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@
232232
(let ((buffer (ensure-repl-buffer-exist)))
233233
(push thread (read-string-thread-stack))
234234
(push tag (read-string-tag-stack))
235-
(setf (current-window) (pop-to-buffer buffer))
235+
(switch-to-window (pop-to-buffer buffer))
236236
(buffer-end (current-point))
237237
(lem/listener-mode:change-input-start-point (current-point))
238238
(repl-change-read-line-input)))
@@ -263,7 +263,7 @@
263263
(check-connection)
264264
(flet ((switch (buffer split-window-p)
265265
(if split-window-p
266-
(setf (current-window) (pop-to-buffer buffer))
266+
(switch-to-window (pop-to-buffer buffer))
267267
(switch-to-buffer buffer))))
268268
(lem/listener-mode:listener-start
269269
"*lisp-repl*"
@@ -273,7 +273,7 @@
273273
(define-command lisp-switch-to-repl-buffer () ()
274274
(let ((buffer (repl-buffer)))
275275
(if buffer
276-
(setf (current-window) (pop-to-buffer buffer))
276+
(switch-to-window (pop-to-buffer buffer))
277277
(start-lisp-repl))))
278278

279279
(defun copy-down-to-repl (slimefun &rest args)

modes/lisp-mode/sldb.lisp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -145,8 +145,7 @@
145145

146146
(defun sldb-setup (thread level condition restarts frames conts)
147147
(let ((buffer (get-sldb-buffer-create thread)))
148-
(let ((window (pop-to-buffer buffer :split-action :negative)))
149-
(setf (current-window) window))
148+
(switch-to-window (pop-to-buffer buffer :split-action :negative))
150149
(change-buffer-mode buffer 'sldb-mode)
151150
(setf (buffer-read-only-p buffer) nil)
152151
(setf (variable-value 'line-wrap :buffer buffer) nil)
@@ -500,7 +499,7 @@
500499
(save-excursion
501500
(lem/language-mode:go-to-location source-location
502501
(lambda (buffer)
503-
(setf (current-window)
502+
(switch-to-window
504503
(pop-to-buffer buffer))))
505504
(lisp-compile-defun)))
506505

modes/python-mode/run-python.lisp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@
5757
(ppcre:scan "^... " (line-string p)))
5858
(lem/listener-mode:refresh-prompt buffer nil))
5959
(unless already-exists
60-
(setf (current-window) (pop-to-buffer buffer)))
60+
(switch-to-window (pop-to-buffer buffer)))
6161
(alexandria:when-let (window (first (get-buffer-windows buffer)))
6262
(with-current-window window
6363
(buffer-end p)

modes/scheme-mode/repl.lisp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,14 +61,14 @@
6161
(lem/listener-mode:listener-start "*scheme-repl*" 'scheme-repl-mode))
6262
((:scheme-process)
6363
(scheme-run-process)
64-
(setf (current-window) (pop-to-buffer (scheme-process-buffer))))
64+
(switch-to-window (pop-to-buffer (scheme-process-buffer))))
6565
(t
6666
(editor-error "Scheme repl is not available."))))
6767

6868
(define-command scheme-switch-to-repl-buffer () ()
6969
(let ((buffer (repl-buffer)))
7070
(if buffer
71-
(setf (current-window) (pop-to-buffer buffer))
71+
(switch-to-window (pop-to-buffer buffer))
7272
(start-scheme-repl))))
7373

7474
(define-command scheme-eval-or-newline () ()
@@ -368,7 +368,7 @@
368368
(let ((buffer (repl-buffer)))
369369
(push thread (read-string-thread-stack))
370370
(push tag (read-string-tag-stack))
371-
(setf (current-window) (pop-to-buffer buffer))
371+
(switch-to-window (pop-to-buffer buffer))
372372
(buffer-end (current-point))
373373
(lem/listener-mode:change-input-start-point (current-point))
374374
(repl-change-read-line-input)))

modes/scheme-mode/swank-connection.lisp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -896,7 +896,7 @@
896896
(let ((xref-location (source-location-to-xref-location source-location)))
897897
(go-to-location xref-location
898898
(lambda (buffer)
899-
(setf (current-window)
899+
(switch-to-window
900900
(pop-to-buffer buffer))))))))
901901

902902
(defun source-location-to-xref-location (location &optional content no-errors)

modes/shell-mode/shell-mode.lisp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,5 +81,5 @@
8181
:output-callback-type :process-input)))
8282

8383
(define-command run-shell () ()
84-
(setf (current-window)
84+
(switch-to-window
8585
(pop-to-buffer (run-shell-internal))))

0 commit comments

Comments
 (0)