Commit 7771706a authored by Troels Henriksen's avatar Troels Henriksen

Added `switch-or-move-to-view' function.

parent 21321fe1
......@@ -262,7 +262,7 @@ Each newline and following whitespace is replaced by a single space."
all))
(expansion-string (with-output-to-string (s)
(pprint expansion s))))
(let ((view (climacs-core:switch-to-view (current-window) "*Macroexpansion*")))
(let ((view (climacs-core:switch-or-move-to-view (current-window) "*Macroexpansion*")))
(set-syntax view "Lisp"))
(let ((header-string (one-line-ify (subseq string 0
(min 40 (length string))))))
......
......@@ -71,6 +71,15 @@ displayed by a Drei instance."))
(pane-frame pane) 'textual-drei-syntax-view
:name name)))))
(defun switch-or-move-to-view (pane view)
"Switch `pane' to show `view'. If `view' is already on display
in some other pane, switch that pane to be the active one."
(handler-bind ((view-already-displayed
#'(lambda (c)
(declare (ignore c))
(invoke-restart 'switch-to-pane))))
(switch-to-view pane view)))
(defun views-having-buffer (climacs buffer)
"Return a list of the buffer-views of `climacs' showing
`buffer'."
......
......@@ -98,7 +98,7 @@
#:no-upper-p
#:case-relevant-test
#:switch-to-view
#:switch-to-view #:switch-or-move-to-view
#:make-new-buffer
#:make-new-named-buffer
#:erase-buffer
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment