summary refs log tree commit diff stats
path: root/user
diff options
context:
space:
mode:
authorAlan Pearce2024-04-14 14:42:24 +0200
committerAlan Pearce2024-04-14 14:42:24 +0200
commitc881813d45bf239676ea0acf7aee399ebbcbf893 (patch)
tree9d53efacf2e862ef9a94370358b8c0115e9d227f /user
parentbb8f0906552591d789b20897d53fe4e845dd801f (diff)
downloadnixfiles-c881813d45bf239676ea0acf7aee399ebbcbf893.tar.lz
nixfiles-c881813d45bf239676ea0acf7aee399ebbcbf893.tar.zst
nixfiles-c881813d45bf239676ea0acf7aee399ebbcbf893.zip
Improve diffing for Common and Emacs Lisps
Diffstat (limited to 'user')
-rw-r--r--user/settings/development/lisp.nix7
-rw-r--r--user/settings/emacs.nix7
2 files changed, 14 insertions, 0 deletions
diff --git a/user/settings/development/lisp.nix b/user/settings/development/lisp.nix
index 9ad918d2..ba1bd048 100644
--- a/user/settings/development/lisp.nix
+++ b/user/settings/development/lisp.nix
@@ -9,4 +9,11 @@
     asdf
     cl-launch
   ];
+
+  programs.git.attributes = [
+    "*.lisp diff=common-lisp"
+  ];
+  programs.git.extraConfig."diff.common-lisp" = {
+    xfuncname = "^\\((def\\S+\\s+\\S+)";
+  };
 }
diff --git a/user/settings/emacs.nix b/user/settings/emacs.nix
index 2871173c..92ba39e2 100644
--- a/user/settings/emacs.nix
+++ b/user/settings/emacs.nix
@@ -27,6 +27,13 @@ in
     ../modules/eshell.nix
   ];
 
+  programs.git.attributes = [
+    "*.el diff=elisp"
+  ];
+  programs.git.extraConfig."diff.elisp" = {
+    xfuncname = "^\\((((def\\S+)|use-package)\\s+\\S+)";
+  };
+
   programs.emacs = {
     enable = true;
     package = lib.mkDefault (pkgs.emacs29.override { withGTK3 = true; });