]> git.ipfire.org Git - thirdparty/git.git/commit
userdiff: extend Scheme support to cover other Lisp dialects
authorScott L. Burson <Scott@sympoiesis.com>
Wed, 15 Apr 2026 02:27:43 +0000 (02:27 +0000)
committerJunio C Hamano <gitster@pobox.com>
Wed, 15 Apr 2026 15:43:33 +0000 (08:43 -0700)
commitb79f7a3ad3ffde16b2cbc2457561669f4833f861
treebcab5c7ad371c95cb835a22d62cf77e8504403eb
parent955c88fbc5ac916f8dababa458a963ebbeba9b41
userdiff: extend Scheme support to cover other Lisp dialects

Common Lisp has top-level forms, such as 'defun' and 'defmacro', that
are not matched by the current Scheme pattern.  Also, it is more
common in CL, when defining user macros intended as top-level forms,
to prefix their names with "def" instead of "define"; such forms are
also not matched.  And some top-level 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.

Signed-off-by: Scott L. Burson <Scott@sympoiesis.com>
Acked-by: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Documentation/gitattributes.adoc
t/t4018/scheme-lisp-defun-a [new file with mode: 0644]
t/t4018/scheme-lisp-defun-b [new file with mode: 0644]
t/t4018/scheme-lisp-eval-when [new file with mode: 0644]
t/t4018/scheme-module-a [moved from t/t4018/scheme-module with 100% similarity]
t/t4018/scheme-module-b [new file with mode: 0644]
t/t4034/scheme/expect
t/t4034/scheme/post
t/t4034/scheme/pre
userdiff.c