summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--wttrin.el12
1 files changed, 8 insertions, 4 deletions
diff --git a/wttrin.el b/wttrin.el
index c92ff1d..512b6a7 100644
--- a/wttrin.el
+++ b/wttrin.el
@@ -66,10 +66,14 @@
(setq buffer-read-only t)))))
;;;###autoload
-(defun wttrin ()
- "Display weather information."
- (interactive)
- (wttrin-query (completing-read "City name: " wttrin-default-cities nil nil)))
+(defun wttrin (city)
+ "Display weather information for CITY."
+ (interactive
+ (list
+ (completing-read "City name: " wttrin-default-cities nil nil
+ (when (= (length wttrin-default-cities) 1)
+ (car wttrin-default-cities)))))
+ (wttrin-query city))
(provide 'wttrin)