+++ /dev/null
-(defun diff-buffer-against-file (context)
- "diff the current (edited) buffer against the file of the same name"
- (interactive "P")
- (let (($file (concat "\"" buffer-file-name "\""))
- ($temp_buffer "emacs.diff")
- ($temp_file "/tmp/emacs.diff"))
-
- (delete-other-windows)
- (push-mark (point) t)
- (generate-new-buffer $temp_file)
- (copy-to-buffer $temp_buffer (point-min) (point-max))
- (set-buffer $temp_buffer)
- (write-file $temp_file)
- (shell-command (concat (if context "diff -c " "diff ") $file " " $temp_file))
- (kill-buffer $temp_file)
- (pop-mark)
- )
- )