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

[PATCH v3 0/2] userdiff: extend Scheme support to cover other Lisp dialects

From
Scott L. Burson via GitGitGadget <gitgitgadget@gmail.com>
Date
Jan 15, 2026, 23:18 UTC
Message-ID
<pull.2000.v3.git.1768519120.gitgitgadget@gmail.com>
In-Reply-To
<pull.2000.v2.git.1764211096.gitgitgadget@gmail.com>

Common Lisp, Emacs Lisp, and other dialects have some top-level forms, most importantly 'defun', that are not matched by the current Scheme pattern. Also, it is common in these dialects, when defining user macros intended as top-level forms, to prefix their names with "def" instead of "define"; such forms are also not currently matched. Some such forms don't even begin with "def".

On the other hand, it is an established formatting convention in the Lisp community that only top-level forms start at the left margin. So matching any unindented line starting with an open parenthesis is an acceptable heuristic; false positives will be rare.

However, there are also cases where notionally top-level forms are grouped together within some containing form. At least in the Common Lisp community, it is conventional to indent these by two spaces, or sometimes one. But matching just an open parenthesis indented by two spaces would be too broad; so the pattern added by this commit requires an indented form to start with "(def". It is believed that this strikes a good balance between potential false positives and false negatives.

This commit disjoins a regexp employing these heuristics to the existing Scheme regexp, so it will still match everything that it did previously.

Johannes Sixt (1):
  userdiff: tighten word-diff test case of the scheme driver
Scott L. Burson (1):
  userdiff: extend Scheme support to cover other Lisp dialects
 Documentation/gitattributes.adoc           |  1 +
 t/t4018/scheme-lisp-defun-a                |  4 ++++
 t/t4018/scheme-lisp-defun-b                |  4 ++++
 t/t4018/scheme-lisp-eval-when              |  4 ++++
 t/t4018/{scheme-module => scheme-module-a} |  0
 t/t4018/scheme-module-b                    |  6 ++++++
 t/t4034/scheme/expect                      |  5 +++--
 t/t4034/scheme/post                        |  3 ++-
 t/t4034/scheme/pre                         |  3 ++-
 userdiff.c                                 | 22 ++++++++++++++++------
 10 files changed, 42 insertions(+), 10 deletions(-)
 create mode 100644 t/t4018/scheme-lisp-defun-a
 create mode 100644 t/t4018/scheme-lisp-defun-b
 create mode 100644 t/t4018/scheme-lisp-eval-when
 rename t/t4018/{scheme-module => scheme-module-a} (100%)
 create mode 100644 t/t4018/scheme-module-b
base-commit: 8745eae506f700657882b9e32b2aa00f234a6fb6
Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-2000%2Fslburson%2Flisp-userdiff_driver-v3
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-2000/slburson/lisp-userdiff_driver-v3
Pull-Request: https://github.com/gitgitgadget/git/pull/2000
Range-diff vs v2:
 1:  da99bb0bcd < -:  ---------- diff: "lisp" userdiff_driver
 2:  86315aa3e3 < -:  ---------- merge with Scheme regexp; fix bugs
 -:  ---------- > 1:  e20ac5b6a6 userdiff: tighten word-diff test case of the scheme driver
 -:  ---------- > 2:  fb4c8dc5d4 userdiff: extend Scheme support to cover other Lisp dialects
-- 
gitgitgadget
Previous: Johannes SixtNext: Johannes Sixt via GitGitGadget
Message 18 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.