summaryrefslogtreecommitdiff
path: root/pancake.el
diff options
context:
space:
mode:
authordefanor <defanor@uberspace.net>2017-12-05 17:36:06 +0300
committerdefanor <defanor@uberspace.net>2017-12-05 17:36:06 +0300
commit6b2677bd59b082096149c1581738eb749537f589 (patch)
tree4632b44be408b16fbeee90e461ce37a2ed4a7205 /pancake.el
parent014d75030c32347a5c040a2be3ed30142b969261 (diff)
pancake-browse-url: use current buffer if it's a pancake buffer
Diffstat (limited to 'pancake.el')
-rw-r--r--pancake.el9
1 files changed, 6 insertions, 3 deletions
diff --git a/pancake.el b/pancake.el
index 03022be..c11edf5 100644
--- a/pancake.el
+++ b/pancake.el
@@ -168,9 +168,12 @@
`browse-url-browser-function'."
(when (or new-session (not (consp pancake-buffers)))
(pancake))
- (with-current-buffer (car pancake-buffers)
- (process-send-string pancake-process (concat url "\n"))
- (display-buffer (current-buffer))))
+ (let ((buffer (if (eq major-mode 'pancake-mode)
+ (current-buffer)
+ (car pancake-buffers))))
+ (with-current-buffer buffer
+ (process-send-string pancake-process (concat url "\n"))
+ (display-buffer (current-buffer)))))
(defun pancake-translate-color (name attr)
"Translate pancake colors into emacs faces."