biome-query: add override-column-names

This commit is contained in:
Pavel Korytov 2023-08-19 17:22:18 +03:00
parent e1ab97b773
commit fc52a2b7ac

View file

@ -73,6 +73,12 @@ The format is: (name latitude longitude)."
(number :tag "Longitude")))
:group 'biome)
(defcustom biome-query-override-column-names nil
"Override column names for variables."
:type '(repeat (cons
(string :tag "Variable name")
(string :tag "Column name"))))
(defconst biome-query-groups '("daily" "hourly" "minutely_15" "hourly")
"Name of groups.
@ -163,7 +169,8 @@ disambiguations of parameters in `biome-api-data'."
KEY is the api key of the variable. VAR-NAMES is the output of
`biome-query--get-var-names-cache'."
(gethash key var-names
(or (cdr (assoc key biome-query-override-column-names))
(gethash key var-names)
(capitalize (replace-regexp-in-string
(regexp-quote "_") " " key))))