From ec00dbe1c03527ec46a0faa20545a7acd382da84 Mon Sep 17 00:00:00 2001 From: Craig Jennings Date: Tue, 5 May 2026 09:48:13 -0500 Subject: feat: add wttrin-display-options for wttr.in flag customization (closes #3) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit wttr.in accepts single-character flags appended to the URL that control what the report looks like — no Follow line (F), narrow output (n), quiet mode (q), forecast horizon (0/1/2), console-glyph mode (d), and so on. Until now wttrin always used the same default report shape with no way to opt into these. Added a `wttrin-display-options` defcustom that takes a string of concatenated flags, e.g. "0Fq" for current weather only with no Follow line and no header. The flags get appended to every request via `wttrin--build-url`. The defcustom defaults to nil so existing users see no change. I excluded `A` and `T` from the recommended set in the docstring since wttrin needs ANSI output for the xterm-color rendering to produce the colored glyphs. The user could still pass them, but the docstring nudges them away. Tests cover the normal cases (single, multi-flag, with and without unit system), the boundaries (nil and empty string both leave the URL unchanged from baseline, single character works), and a sanity check that the new flags slot in after the always-on `A`. Existing build-url tests stay green because they don't bind the new variable, and the default is nil. Also added `.claude/` to .gitignore — the scheduled-tasks lockfile from local wakeup scheduling shouldn't be tracked. --- README.org | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'README.org') diff --git a/README.org b/README.org index ea4aaf0..e3e5c98 100644 --- a/README.org +++ b/README.org @@ -174,6 +174,17 @@ Wttrin's default is to select the unit system appropriate for the location you q (setq wttrin-unit-system nil) ;; the default of using units appropriate for the queried location. #+end_src +*** Display Options +wttr.in supports a handful of single-character flags that change what the report looks like. Concatenate them in =wttrin-display-options= and they'll be appended to every request: + +#+begin_src emacs-lisp + (setq wttrin-display-options "0Fq") ;; current weather only, no Follow line, no header + (setq wttrin-display-options "n") ;; narrow version (only day and night) + (setq wttrin-display-options nil) ;; default (all options off) +#+end_src + +The full list of flags is at https://wttr.in/:help. Skip =A= and =T= — wttrin manages ANSI output internally so the colored glyphs render correctly. + *** Cache Settings Wttrin caches weather data and refreshes it in the background. By default it refreshes every hour and keeps up to 50 entries. You can adjust both: -- cgit v1.2.3