emacs-diffs
[Top][All Lists]
Advanced

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

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


From: Colin Walters
Subject: [Emacs-diffs] Changes to emacs/lisp/ibuf-ext.el
Date: Sat, 07 Sep 2002 17:30:55 -0400

Index: emacs/lisp/ibuf-ext.el
diff -c emacs/lisp/ibuf-ext.el:1.25 emacs/lisp/ibuf-ext.el:1.26
*** emacs/lisp/ibuf-ext.el:1.25 Sun Aug 18 17:17:42 2002
--- emacs/lisp/ibuf-ext.el      Sat Sep  7 17:30:55 2002
***************
*** 1221,1260 ****
    "View the differences between this buffer and its associated file.
  This requires the external program \"diff\" to be in your `exec-path'."
    (interactive)
!   (let* ((buf (ibuffer-current-buffer))
!        (buf-filename (with-current-buffer buf
!                        buffer-file-name)))
      (unless (buffer-live-p buf)
        (error "Buffer %s has been killed" buf))
!     (unless buf-filename
!       (error "Buffer %s has no associated file" buf))
!     (let ((diff-buf (get-buffer-create "*Ibuffer-diff*")))
!       (with-current-buffer diff-buf
!       (setq buffer-read-only nil)
!       (erase-buffer))
!       (let ((tempfile (make-temp-file "ibuffer-diff-")))
!       (unwind-protect
!           (progn
!             (with-current-buffer buf
!               (write-region (point-min) (point-max) tempfile nil 'nomessage))
!             (if (zerop
!                  (apply #'call-process "diff" nil diff-buf nil
!                         (append
!                          (when (and (boundp 'ediff-custom-diff-options)
!                                     (stringp ediff-custom-diff-options))
!                            (list ediff-custom-diff-options))
!                          (list buf-filename tempfile))))
!                 (message "No differences found")
!               (progn
!                 (with-current-buffer diff-buf
!                   (goto-char (point-min))
!                   (if (fboundp 'diff-mode)
!                       (diff-mode)
!                     (fundamental-mode)))
!                 (display-buffer diff-buf))))
!         (when (file-exists-p tempfile)
!           (delete-file tempfile)))))
!       nil))
  
  ;;;###autoload
  (defun ibuffer-copy-filename-as-kill (&optional arg)
--- 1221,1230 ----
    "View the differences between this buffer and its associated file.
  This requires the external program \"diff\" to be in your `exec-path'."
    (interactive)
!   (let ((buf (ibuffer-current-buffer)))
      (unless (buffer-live-p buf)
        (error "Buffer %s has been killed" buf))
!     (diff-buffer-with-file buf)))
  
  ;;;###autoload
  (defun ibuffer-copy-filename-as-kill (&optional arg)




reply via email to

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