emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] Changes to emacs/lisp/files.el


From: Richard M. Stallman
Subject: [Emacs-diffs] Changes to emacs/lisp/files.el
Date: Tue, 10 Sep 2002 12:48:52 -0400

Index: emacs/lisp/files.el
diff -c emacs/lisp/files.el:1.611 emacs/lisp/files.el:1.612
*** emacs/lisp/files.el:1.611   Tue Sep 10 04:08:17 2002
--- emacs/lisp/files.el Tue Sep 10 12:48:52 2002
***************
*** 2996,3018 ****
  
  (defun diff-buffer-with-file (&optional buffer)
    "View the differences between BUFFER and its associated file.
! This requires the external program \"diff\" to be in your `exec-path'."
    (interactive "bBuffer: ")
!   (setq buffer (get-buffer (or buffer (current-buffer))))
!   (let ((buf-filename (buffer-file-name buffer)))
!     (unless buf-filename
!       (error "Buffer %s has no associated file" buffer))
!     (let ((tempfile (make-temp-file "buffer-content-")))
!       (unwind-protect
!         (progn
!           (with-current-buffer buffer
!             (save-restriction
!               (widen)
!               (write-region (point-min) (point-max) tempfile nil 'nomessage)))
!           (diff buf-filename tempfile nil t))
!       (when (file-exists-p tempfile)
!         (delete-file tempfile)))
!       nil)))
  
  (defvar save-some-buffers-action-alist
    '((?\C-r
--- 2996,3016 ----
  
  (defun diff-buffer-with-file (&optional buffer)
    "View the differences between BUFFER and its associated file.
! This requires the external program `diff' to be in your `exec-path'."
    (interactive "bBuffer: ")
!   (with-current-buffer (get-buffer (or buffer (current-buffer)))
!     (if (null buffer-file-name)
!       (message "Buffer %s has no associated file" (buffer-name))
!       (let ((tempfile (make-temp-file "buffer-content-")))
!       (unwind-protect
!           (save-restriction
!             (widen)
!             (write-region (point-min) (point-max) tempfile nil 'nomessage)
!             (diff buffer-file-name tempfile nil t)
!             (sit-for 0))
!         (when (file-exists-p tempfile)
!           (delete-file tempfile)))
!       nil))))
  
  (defvar save-some-buffers-action-alist
    '((?\C-r




reply via email to

[Prev in Thread] Current Thread [Next in Thread]