git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] diff: "lisp" userdiff_driver
@ 2025-11-15 10:17 Scott L. Burson via GitGitGadget
  2025-11-15 17:06 ` Johannes Sixt
  2025-11-27  2:38 ` [PATCH v2 0/2] userdiff: extend Scheme support to cover other Lisp dialects Scott L. Burson via GitGitGadget
  0 siblings, 2 replies; 15+ messages in thread
From: Scott L. Burson via GitGitGadget @ 2025-11-15 10:17 UTC (permalink / raw)
  To: git
  Cc: Junio C Hamano, Johannes Sixt,
	Ævar Arnfjörð Bjarmason, Jaydeep P Das,
	Scott L. Burson, Scott L. Burson

From: "Scott L. Burson" <Scott@sympoiesis.com>

The "scheme" driver doesn't quite work for Common Lisp.  This driver
is very generic and should work for almost any dialect of Lisp,
including Common Lisp.

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).*)$",
+	 /* Common Lisp symbol syntax allows arbitrary strings between vertical bars */
+	 "\\|([^\\\\]|\\\\\\\\|\\\\\\|)*\\|"
+	 /* All other words are delimited by spaces or parentheses/brackets/braces */
+	 "|([^][(){} \t])+"),
 PATTERNS("markdown",
 	 "^ {0,3}#{1,6}[ \t].*",
 	 /* -- */

base-commit: fd372d9b1a69a01a676398882bbe3840bf51fe72
-- 
gitgitgadget

^ permalink raw reply related	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2025-12-02 10:27 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
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

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).