all repos — nixfiles @ c881813d45bf239676ea0acf7aee399ebbcbf893

System and user configuration, managed by nix and home-manager

Improve diffing for Common and Emacs Lisps
Alan Pearce alan@alanpearce.eu
Sun, 14 Apr 2024 14:42:24 +0200
commit

c881813d45bf239676ea0acf7aee399ebbcbf893

parent

bb8f0906552591d789b20897d53fe4e845dd801f

2 files changed, 14 insertions(+), 0 deletions(-)

jump to
M user/settings/development/lisp.nixuser/settings/development/lisp.nix
@@ -9,4 +9,11 @@ lispPackages.quicklisp     asdf
     cl-launch
   ];
+
+  programs.git.attributes = [
+    "*.lisp diff=common-lisp"
+  ];
+  programs.git.extraConfig."diff.common-lisp" = {
+    xfuncname = "^\\((def\\S+\\s+\\S+)";
+  };
 }
M user/settings/emacs.nixuser/settings/emacs.nix
@@ -27,6 +27,13 @@ imports = [     ../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; });