;ELC ;;; Compiled by cyd@localhost on Mon Apr 23 22:20:37 2007 ;;; from file /home/cyd/emacs/lisp/diff.el ;;; in Emacs version 22.0.99 ;;; with all optimizations. ;;; This file uses dynamic docstrings, first added in Emacs 19.29. (if (and (boundp 'emacs-version) (< (aref emacs-version (1- (length emacs-version))) ?A) (or (and (boundp 'epoch::version) epoch::version) (string-lessp emacs-version "19.29"))) (error "`diff.el' was compiled for Emacs 19.29 or later")) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (custom-declare-group 'diff nil "Comparing files with `diff'." :group 'tools) #@72 *A string or list of strings specifying switches to be passed to diff. (custom-declare-variable 'diff-switches '"-c" '(#$ . -633) :type '(choice string (repeat string)) :group 'diff) #@34 *The command to use to run diff. (custom-declare-variable 'diff-command '"diff" '(#$ . -822) :type 'string :group 'diff) #@68 This is the name of a temp file to be deleted after diff finishes. (defvar diff-old-temp-file nil (#$ . 949)) #@68 This is the name of a temp file to be deleted after diff finishes. (defvar diff-new-temp-file nil (#$ . 1065)) (defalias 'diff-switches #[nil "\205\302\303 ;\203 \202\304\305 \306#\"\207" [current-prefix-arg diff-switches read-string "Diff switches: " mapconcat identity " "] 6]) #@118 Code run when the diff process exits. CODE is the exit code of the process. It should be 0 iff no diffs were found. (defalias 'diff-sentinel #[(code) "\203\304!\210 \203\304 !\210\212db\210\305\306\307 \310\232\203\"\311\202#\312\313 #c*\207" [diff-old-temp-file diff-new-temp-file inhibit-read-only code delete-file t format "\nDiff finished%s. %s\n" 0 " (no differences)" "" current-time-string] 4 (#$ . 1359)]) #@271 Find and display the differences between OLD and NEW files. Interactively the current buffer's file name is the default for NEW and a backup file for NEW is the default for OLD. If NO-ASYNC is non-nil, call diff synchronously. With prefix arg, prompt for diff switches. (defalias 'diff #[(old new &optional switches no-async) "\306!\306 !\n\204 \307 !\307!\310\311)\312\n<\203$\n\202&\nC\f\204. \2053\313 \313F\314\f\2069 !\314 \206@!D#B\315#*\316\317!+,-\320.\212\321+!\210+q\210\320/\322p!\210\3230\324 \210)\325p!\210\326 \210\327\330!\210\331\332\333\334 D\334D\334\nD\3341D\257E\327\335!\210\f\327\336!\210 -,\3230*\337\261\210)1\204\317\340\341!\203\317\341\342+23*%.\343.\344\"\210\345.\346\"\210\202\343\3230\347\3502\320+\3203*&!\210))+.\207" [new old switches diff-switches old-alt new-alt expand-file-name file-local-copy mapconcat identity append "-L" shell-quote-argument " " get-buffer-create "*Diff*" nil display-buffer buffer-disable-undo t erase-buffer buffer-enable-undo diff-mode make-local-variable revert-buffer-function lambda (ignore-auto noconfirm) diff quote diff-old-temp-file diff-new-temp-file "\n" fboundp start-process "Diff" set-process-filter diff-process-filter set-process-sentinel #[(proc msg) "r\301!q\210\302\303!!)\207" [proc process-buffer diff-sentinel process-exit-status] 3] diff-sentinel call-process diff-command command buf default-directory thisdir proc buffer-read-only inhibit-read-only no-async shell-file-name shell-command-switch] 9 (#$ . 1791) (let (oldf newf) (setq newf (buffer-file-name) newf (if (and newf (file-exists-p newf)) (read-file-name (concat "Diff new file (default " (file-name-nondirectory newf) "): ") nil newf t) (read-file-name "Diff new file: " nil nil t))) (setq oldf (file-newest-backup newf) oldf (if (and oldf (file-exists-p oldf)) (read-file-name (concat "Diff original file (default " (file-name-nondirectory oldf) "): ") (file-name-directory oldf) oldf t) (read-file-name "Diff original file: " (file-name-directory newf) nil t))) (list oldf newf (diff-switches)))]) (defalias 'diff-process-filter #[(proc string) "r\304!q\210`\305!U\212\305!b\210\306 c\210)\305!`\307\223\210) \205(\305!b*\207" [proc moving inhibit-read-only string process-buffer process-mark t nil] 3]) #@263 Diff this file with its backup file or vice versa. Uses the latest backup, if there are several numerical backups. If this file is a backup, diff it with its original. The backup file is the first file given to `diff'. With prefix arg, prompt for diff switches. (defalias 'diff-backup #[(file &optional switches) "\304\211\305\n!\203\n\306\n!\202 \307\n!\206\310\311\n\"\n\312  #*\207" [ori bak file switches nil backup-file-name-p file-name-sans-versions diff-latest-backup-file error "No backup found for %s" diff] 4 (#$ . 4120) (list (read-file-name "Diff (file with backup): ") (diff-switches))]) #@52 Return the latest existing backup of FILE, or nil. (defalias 'diff-latest-backup-file #[(fn) "\302\303\"\211\203 \303\"\202\304!)\207" [fn handler find-file-name-handler diff-latest-backup-file file-newest-backup] 4 (#$ . 4739)]) (provide 'diff)