Saner defaults for preview buffer location
This commit is contained in:
parent
dc03882b90
commit
17fc31d7f8
|
@ -241,9 +241,9 @@ default output type for new buffers."
|
|||
(defun plantuml-preview-string (prefix string)
|
||||
"Preview diagram from PlantUML sources (as STRING), using prefix (as PREFIX)
|
||||
to choose where to display it:
|
||||
- 4 (when prefixing the command with C-u) -> new window
|
||||
- 16 (when prefixing the command with C-u C-u) -> new frame.
|
||||
- else -> new buffer"
|
||||
- 4 (when prefixing the command with C-u) -> current buffer
|
||||
- 16 (when prefixing the command with C-u C-u) -> new frame
|
||||
- else -> new window"
|
||||
(let ((b (get-buffer plantuml-preview-buffer)))
|
||||
(when b
|
||||
(kill-buffer b)))
|
||||
|
@ -262,12 +262,13 @@ to choose where to display it:
|
|||
(lambda (_ps event)
|
||||
(unless (equal event "finished\n")
|
||||
(error "PLANTUML Preview failed: %s" event))
|
||||
|
||||
(cond
|
||||
((= prefix 16)
|
||||
(switch-to-buffer-other-frame plantuml-preview-buffer))
|
||||
((= prefix 4)
|
||||
(switch-to-buffer-other-window plantuml-preview-buffer))
|
||||
(t (switch-to-buffer plantuml-preview-buffer)))
|
||||
(switch-to-buffer plantuml-preview-buffer))
|
||||
(t (switch-to-buffer-other-window plantuml-preview-buffer)))
|
||||
(when imagep
|
||||
(image-mode)
|
||||
(set-buffer-multibyte t)))))))
|
||||
|
|
Loading…
Reference in New Issue