From: D. Ben Knoble Date: Thu, 20 Nov 2025 16:47:02 GMT Subject: Re: [PATCH] diff: "lisp" userdiff_driver Message-ID: In-Reply-To: On Sat, Nov 15, 2025 at 6:33 PM Scott L. Burson wrote: > > > > > > Signed-off-by: Scott L. Burson > > > --- > > > diff: "lisp" userdiff_driver > > > > > > Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-2000%2Fslburson%2Flisp-userdiff_driver-v1 > > > Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-2000/slburson/lisp-userdiff_driver-v1 > > > Pull-Request: https://github.com/gitgitgadget/git/pull/2000 > > > > > > userdiff.c | 8 ++++++++ > > > 1 file changed, 8 insertions(+) > > > > > > diff --git a/userdiff.c b/userdiff.c > > > index fe710a68bf..e127b4a1f1 100644 > > > --- a/userdiff.c > > > +++ b/userdiff.c > > > @@ -249,6 +249,14 @@ PATTERNS("kotlin", > > > "|[.][0-9][0-9_]*([Ee][-+]?[0-9]+)?[fFlLuU]?" > > > /* unary and binary operators */ > > > "|[-+*/<>%&^|=!]==?|--|\\+\\+|<<=|>>=|&&|\\|\\||->|\\.\\*|!!|[?:.][.:]"), > > > +PATTERNS("lisp", > > > + /* Either an unindented left paren, or a slightly indented line > > > + * starting with "(def" */ > > > + "^((\\(|:space:{1,2}\\(def).*)$", > > > > Compared to the Scheme driver, this regular expression is > > > > - more restrictive because it does not permit arbitrary indentation; > > > > - less restrictive because it permits everything that begins with "(def". > > > > What would happen if this regular expression were added to the Scheme > > driver? Would it pick up additional and unwanted hunk headers is typical > > Scheme code? > > That is a good question. I don't think so, but I don't work in Scheme. > I see that you have CC'ed Atharva Raykar; let's see whether he would > have any objection. > > I would point out that Scheme is a dialect of Lisp, not the other way > around. (Lisp is unusual in being a family of languages, rather than a > single language.) And having a separate "lisp" driver might aid > discoverability. Without "going there," I think there are enough differences to warrant a different driver. (OTOH, I have sometimes wanted to teach the Scheme driver that most "def" things are probably definitions.) Our indentation is less rigid in that indented forms may be more deeply nested than only one or two spaces (and we of course have more definition forms than "only things starting with def"), and I don't understand the downthread desire to not permit tabs. As for Scheme community, I'll suggest asking on the Racket channels (Discourse is probably best if you want a mailing-list-like discussion?) -- D. Ben Knoble