From: Junio C Hamano <gitster@pobox.com>
To: Johannes Sixt <j6t@kdbg.org>
Cc: "Scott L. Burson" <Scott@sympoiesis.com>,
"Ævar Arnfjörð Bjarmason" <avarab@gmail.com>,
"Jaydeep P Das" <jaydeepjd.8914@gmail.com>,
"Atharva Raykar" <raykar.ath@gmail.com>,
git@vger.kernel.org,
"Scott L. Burson via GitGitGadget" <gitgitgadget@gmail.com>
Subject: Re: [PATCH] diff: "lisp" userdiff_driver
Date: Sat, 15 Nov 2025 21:30:10 -0800 [thread overview]
Message-ID: <xmqqbjl2ee8t.fsf@gitster.g> (raw)
In-Reply-To: <773d3233-c890-4df9-8f7e-32ff8a48651e@kdbg.org> (Johannes Sixt's message of "Sat, 15 Nov 2025 18:06:44 +0100")
Johannes Sixt <j6t@kdbg.org> writes:
>> + /* 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?
As we generally assume that the file being edited is syntactically
sound, even if one lisp variant understands "(deffoo" and others do
not, it should be generally fine for the pattern to say something
like "at the beginning of the line, optionally following a few
spaces, four-letter sequence '(def' is likely to be the beginning of
a function definition", as long as there is some convention that
user defined functions and macros, unless they are to behave
similarly to "(defun", would not be named so confusingly to start
with d-e-f.
It would be nice if a single set of rules can cover what existing
scheme patterns cover, Emacs lisp, and Common lisp.
next prev parent reply other threads:[~2025-11-16 5:30 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-11-15 10:17 [PATCH] diff: "lisp" userdiff_driver Scott L. Burson via GitGitGadget
2025-11-15 17:06 ` Johannes Sixt
2025-11-15 23:32 ` Scott L. Burson
2025-11-20 16:47 ` D. Ben Knoble
2025-11-27 2:10 ` Scott L. Burson
2025-11-16 5:30 ` Junio C Hamano [this message]
2025-11-17 23:23 ` Scott L. Burson
2025-11-18 4:38 ` Junio C Hamano
2025-11-27 2:38 ` [PATCH v2 0/2] userdiff: extend Scheme support to cover other Lisp dialects Scott L. Burson via GitGitGadget
2025-11-27 2:38 ` [PATCH v2 1/2] diff: "lisp" userdiff_driver Scott L. Burson via GitGitGadget
2025-11-27 10:32 ` Scott L. Burson
2025-11-27 10:51 ` Johannes Sixt
2025-11-27 2:38 ` [PATCH v2 2/2] merge with Scheme regexp; fix bugs Scott L. Burson via GitGitGadget
2025-11-27 16:09 ` Johannes Sixt
2025-12-02 10:27 ` Johannes Sixt
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=xmqqbjl2ee8t.fsf@gitster.g \
--to=gitster@pobox.com \
--cc=Scott@sympoiesis.com \
--cc=avarab@gmail.com \
--cc=git@vger.kernel.org \
--cc=gitgitgadget@gmail.com \
--cc=j6t@kdbg.org \
--cc=jaydeepjd.8914@gmail.com \
--cc=raykar.ath@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).