From e4b06e5c07d61d63c529b45bcf33a4323cf5bc50 Mon Sep 17 00:00:00 2001 From: TEC Date: Sun, 2 Oct 2022 16:17:19 +0800 Subject: [PATCH] Improve survey Emacs version validation --- config/survey.jl | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/config/survey.jl b/config/survey.jl index fd6c141..dcb3725 100644 --- a/config/survey.jl +++ b/config/survey.jl @@ -24,8 +24,12 @@ the questions you see now will not neccesarily be in the final survey.", "Which version of Emacs do you use?", ["29 (master/HEAD)" => "29.0", "28.2", "28.1", "27.2", "27.1", "26.3", :other], - validators = v -> if isnothing(match(r"^\d+\.\d+$")) + validators = v -> if isnothing(match(r"^\d+\.\d+$", v)) "Please give the MAJOR.MINOR version number as your response" + elseif parse(VersionNumber, v) < v"18" + "Ok, this is pushing the bounds of believability a bit much..." + elseif parse(VersionNumber, v) > v"29.0" + "You should have mentioned that you're a time traveler!" end), MultiSelect(:emacs_motivations_current, "Which features keep you using Emacs?",