comparison lisp/packages/diff.el @ 104:cf808b4c4290 r20-1b4

Import from CVS: tag r20-1b4
author cvs
date Mon, 13 Aug 2007 09:16:51 +0200
parents 4be1180a9e89
children fe104dbd9147
comparison
equal deleted inserted replaced
103:30eda07fe280 104:cf808b4c4290
1 ;; -*-Emacs-Lisp-*- 1 ;; -*-Emacs-Lisp-*-
2 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 2 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
3 ;; 3 ;;
4 ;; File: diff.el 4 ;; File: diff.el
5 ;; Version: $Revision: 1.2 $ 5 ;; Version: $Revision: 1.3 $
6 ;; Author: This file is based on diff.el by 6 ;; Author: This file is based on diff.el by
7 ;; sunpitt!wpmstr!fbresz@Sun.COM 1/27/89. 7 ;; sunpitt!wpmstr!fbresz@Sun.COM 1/27/89.
8 ;; It has been completely rewritten in July 1994 by 8 ;; It has been completely rewritten in July 1994 by
9 ;; Sandy Rutherford <sandy@ibm550.sissa.it> 9 ;; Sandy Rutherford <sandy@ibm550.sissa.it>
10 ;; RCS: 10 ;; RCS:
38 (provide 'diff) 38 (provide 'diff)
39 39
40 ;;; User Variables 40 ;;; User Variables
41 41
42 ;; should be in to loaddefs.el now. 42 ;; should be in to loaddefs.el now.
43 ;;;###autoload
43 (defvar diff-switches nil 44 (defvar diff-switches nil
44 "*A list of switches (strings) to pass to the diff program.") 45 "*A list of switches (strings) to pass to the diff program.")
45 46
46 (defvar diff-do-narrow nil 47 (defvar diff-do-narrow nil
47 "*If non-nil diff buffers are initialized narrowed to each difference.") 48 "*If non-nil diff buffers are initialized narrowed to each difference.")
477 (end-of-buffer n) 478 (end-of-buffer n)
478 (diff-update-modeline)) 479 (diff-update-modeline))
479 480
480 ;;; The main command. 481 ;;; The main command.
481 482
483 ;;;###autoload
482 (defun diff (old new &optional switches) 484 (defun diff (old new &optional switches)
483 "Find and display the differences between OLD and NEW files. 485 "Find and display the differences between OLD and NEW files.
484 Interactively you are prompted with the current buffer's file name for NEW 486 Interactively you are prompted with the current buffer's file name for NEW
485 and what appears to be its backup for OLD." 487 and what appears to be its backup for OLD."
486 ;; Support for diffing directories is rather limited. It needs work. 488 ;; Support for diffing directories is rather limited. It needs work.
568 (condition-case nil 570 (condition-case nil
569 (delete-file new-temp) 571 (delete-file new-temp)
570 (error nil)) 572 (error nil))
571 (set-buffer curr-buff)))) 573 (set-buffer curr-buff))))
572 574
575 ;;;###autoload
573 (defun diff-backup (file &optional switches) 576 (defun diff-backup (file &optional switches)
574 "Diff this file with its backup file or vice versa. 577 "Diff this file with its backup file or vice versa.
575 Uses the latest backup, if there are several numerical backups. 578 Uses the latest backup, if there are several numerical backups.
576 If this file is a backup, diff it with its original. 579 If this file is a backup, diff it with its original.
577 The backup file is the first file given to `diff'." 580 The backup file is the first file given to `diff'."