diff options
| author | Dave Pearson <davep@davep.org> | 2017-06-12 14:54:06 +0100 |
|---|---|---|
| committer | Dave Pearson <davep@davep.org> | 2017-06-12 14:54:06 +0100 |
| commit | 3f5de24334a7edcaa7f67738be26540b42441621 (patch) | |
| tree | 5275500b4a1f2157be3a3bfb10f59bc9eeac086d | |
| parent | 9cd7ce58757bdc1db466c89976bdac75884800d4 (diff) | |
Default the city name if only one city is defined.
If wttrin-default-cities only has the one city in it, default the input to
wttrin to that so that it's easier and faster to get the weather.
| -rw-r--r-- | wttrin.el | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -68,7 +68,11 @@ ;;;###autoload (defun wttrin (city) "Display weather information for CITY." - (interactive (list (completing-read "City name: " wttrin-default-cities nil nil))) + (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) |
