From 0ec89a814bd7fbf76d36fa3033ba7a82b10af818 Mon Sep 17 00:00:00 2001 From: Michael Orlitzky Date: Sun, 8 Mar 2026 12:59:29 -0400 Subject: [PATCH] .emacs: replace diff-buffer-against-file Newer versions of emacs essentially have diff-buffer-against-file built in. There's a "diff-buffer-with-file" function, and its default argument is the file name that corresponds to the buffer. So let's just wrap that. --- .emacs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/.emacs b/.emacs index 6f09772..2b4762d 100644 --- a/.emacs +++ b/.emacs @@ -75,8 +75,14 @@ ;; Never ask me anything, emacs. (setq save-abbrevs nil) -(load-library "diff-buffer-against-file") -(global-set-key "\C-cd" 'diff-buffer-against-file) +;; Easily diff the current buffer against the file it arose from. +;; Simply invokes diff-buffer-with-file with the default argument. +(global-set-key "\C-cd" ( + lambda() + (interactive) + (diff-buffer-with-file nil) +)) + (load-library "latex-query-replace-regexp-math") -- 2.51.0