• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /macosx-10.9.5/emacs-92/emacs/lisp/

Lines Matching defs:diff

0 ;;; diff.el --- run `diff' in compilation-mode
29 ;; UNIX command diff(1). The commands are `diff' and `diff-backup'.
30 ;; You can specify options with `diff-switches'.
34 (defgroup diff nil
35 "Comparing files with `diff'."
39 (defcustom diff-switches "-c"
40 "*A string or list of strings specifying switches to be passed to diff."
42 :group 'diff)
45 (defcustom diff-command "diff"
46 "*The command to use to run diff."
48 :group 'diff)
50 (defvar diff-old-temp-file nil
51 "This is the name of a temp file to be deleted after diff finishes.")
52 (defvar diff-new-temp-file nil
53 "This is the name of a temp file to be deleted after diff finishes.")
56 (defun diff-switches ()
59 (if (stringp diff-switches)
60 diff-switches
61 (mapconcat 'identity diff-switches " ")))))
63 (defun diff-sentinel (code)
64 "Code run when the diff process exits.
66 (if diff-old-temp-file (delete-file diff-old-temp-file))
67 (if diff-new-temp-file (delete-file diff-new-temp-file))
76 (defun diff (old new &optional switches no-async)
80 If NO-ASYNC is non-nil, call diff synchronously.
81 With prefix arg, prompt for diff switches."
99 (list oldf newf (diff-switches))))
102 (or switches (setq switches diff-switches)) ; If not specified, use default.
107 `(,diff-command
126 (diff-mode)
129 (diff ',old ',new ',switches ',no-async)))
130 (set (make-local-variable 'diff-old-temp-file) old-alt)
131 (set (make-local-variable 'diff-new-temp-file) new-alt)
139 (set-process-filter proc 'diff-process-filter)
143 (diff-sentinel (process-exit-status proc))))))
146 (diff-sentinel
151 (defun diff-process-filter (proc string)
163 (defun diff-backup (file &optional switches)
166 If this file is a backup, diff it with its original.
167 The backup file is the first file given to `diff'.
168 With prefix arg, prompt for diff switches."
170 (diff-switches)))
175 (setq bak (or (diff-latest-backup-file file)
178 (diff bak ori switches)))
180 (defun diff-latest-backup-file (fn) ; actually belongs into files.el
182 (let ((handler (find-file-name-handler fn 'diff-latest-backup-file)))
184 (funcall handler 'diff-latest-backup-file fn)
187 (provide 'diff)
190 ;;; diff.el ends here