git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] diff: "lisp" userdiff_driver

From
D. Ben Knoble <ben.knoble@gmail.com>
Date
Nov 20, 2025, 16:47 UTC
Message-ID
<CALnO6CBFKjewrkPeEUh7Q-A2dZ7Fknjy4DszG8xCKu-NvGETfQ@mail.gmail.com>
In-Reply-To
<CAF5LJ4D4q2S2VFhvEgVOe1Ar0e6cu=H3e_o_98VwHN7wYHh+DQ@mail.gmail.com>
On Sat, Nov 15, 2025 at 6:33 PM Scott L. Burson <Scott@sympoiesis.com> wrote:
Show 43 quoted lines
> > >
> > > Signed-off-by: Scott L. Burson <Scott@sympoiesis.com>
> > > ---
> > >     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
Previous: Scott L. BursonNext: Scott L. Burson
Message 4 of 27 in “diff: "lisp" userdiff_driver”
  1. diff: "lisp" userdiff_driverScott L. Burson via GitGitGadget, Nov 15, 2025
  2. Johannes SixtNov 15, 2025
  3. Scott L. BursonNov 15, 2025
  4. D. Ben KnobleNov 20, 2025
  5. Scott L. BursonNov 27, 2025
  6. Junio C HamanoNov 16, 2025
  7. Scott L. BursonNov 17, 2025
  8. Junio C HamanoNov 18, 2025
  9. 0/2 userdiff: extend Scheme support to cover other Lisp dialectsScott L. Burson via GitGitGadget, Nov 27, 2025
  10. 1/2 diff: "lisp" userdiff_driverScott L. Burson via GitGitGadget, Nov 27, 2025
  11. Scott L. BursonNov 27, 2025
  12. Johannes SixtNov 27, 2025
  13. 2/2 merge with Scheme regexp; fix bugsScott L. Burson via GitGitGadget, Nov 27, 2025
  14. Johannes SixtNov 27, 2025
  15. Johannes SixtDec 2, 2025
  16. Scott L. BursonJan 14, 2026
  17. Johannes SixtJan 14, 2026
  18. 0/2 userdiff: extend Scheme support to cover other Lisp dialectsScott L. Burson via GitGitGadget, Jan 15, 2026
  19. 1/2 userdiff: tighten word-diff test case of the scheme driverJohannes Sixt via GitGitGadget, Jan 15, 2026
  20. 2/2 userdiff: extend Scheme support to cover other Lisp dialectsScott L. Burson via GitGitGadget, Jan 15, 2026
  21. Johannes SixtJan 16, 2026
  22. Scott L. BursonJan 17, 2026
  23. Johannes SixtJan 17, 2026
  24. 0/2 userdiff: extend Scheme support to cover other Lisp dialectsScott L. Burson via GitGitGadget, Apr 15, 2026
  25. 1/2 userdiff: tighten word-diff test case of the scheme driverJohannes Sixt via GitGitGadget, Apr 15, 2026
  26. 2/2 userdiff: extend Scheme support to cover other Lisp dialectsScott L. Burson via GitGitGadget, Apr 15, 2026
  27. Johannes SixtApr 15, 2026

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.