summaryrefslogtreecommitdiff
path: root/wttrin.el
diff options
context:
space:
mode:
authorkuanyui <azazabc123@gmail.com>2016-03-06 01:19:26 +0800
committerkuanyui <azazabc123@gmail.com>2016-03-06 01:19:26 +0800
commit06f7449302f60d4a35ff4c2dd16f70e1beda8472 (patch)
treebe2b9e939a77fba635717acb002a425550885c21 /wttrin.el
parent8f0e3539c0cb86986365f21021a21ad03b2908cc (diff)
Prevent creating duplicated buffers
Diffstat (limited to 'wttrin.el')
-rw-r--r--wttrin.el3
1 files changed, 1 insertions, 2 deletions
diff --git a/wttrin.el b/wttrin.el
index c8b6847..564eb81 100644
--- a/wttrin.el
+++ b/wttrin.el
@@ -38,8 +38,7 @@
(defun wttrin-exec ()
"Display weather information."
(interactive)
- (let* ((name (generate-new-buffer-name (concat "wttr.in - " wttrin-query)))
- (buf (get-buffer-create name)))
+ (let ((buf (get-buffer-create (format "*wttr.in - %s*" wttrin-query))))
(switch-to-buffer buf))
(insert (xterm-color-filter (wttrin-fetch wttrin-query)))
(goto-char (point-min))