summaryrefslogtreecommitdiff
path: root/wttrin.el
diff options
context:
space:
mode:
Diffstat (limited to 'wttrin.el')
-rw-r--r--wttrin.el7
1 files changed, 6 insertions, 1 deletions
diff --git a/wttrin.el b/wttrin.el
index b2a3d97..199ade6 100644
--- a/wttrin.el
+++ b/wttrin.el
@@ -12,6 +12,8 @@
;; Provides the weather information from wttr.in based on your query condition.
;;; Code:
+(require 'url)
+(require 'xterm-color)
(defgroup wttrin nil
"Emacs frontend for weather web service wttr.in."
@@ -32,7 +34,7 @@
(lambda (status) (switch-to-buffer (current-buffer))))
(decode-coding-string (buffer-string) 'utf-8))))
-(require 'xterm-color)
+
(defun wttrin-exec ()
"Display weather information."
(interactive)
@@ -40,6 +42,9 @@
(buf (get-buffer-create name)))
(switch-to-buffer buf))
(insert (xterm-color-filter (wttrin-fetch wttrin-query)))
+ (goto-char (point-min))
+ (re-search-forward "^$")
+ (delete-region (point-min) (1+ (point)))
(setq buffer-read-only t))
(provide 'wttrin)