comparison lisp/ediff-ptch.el @ 18054:0b9d9cbf3cd4

new version
author Michael Kifer <kifer@cs.stonybrook.edu>
date Sat, 31 May 1997 01:10:39 +0000
parents beb94a5271e2
children 1405083241e8
comparison
equal deleted inserted replaced
18053:941f5d1a241e 18054:0b9d9cbf3cd4
1 ;;; ediff-ptch.el --- Ediff's patch support 1 ;;; ediff-ptch.el --- Ediff's patch support
2 2
3 ;; Copyright (C) 1996 Free Software Foundation, Inc. 3 ;; Copyright (C) 1996, 1997 Free Software Foundation, Inc.
4 4
5 ;; Author: Michael Kifer <kifer@cs.sunysb.edu> 5 ;; Author: Michael Kifer <kifer@cs.sunysb.edu>
6 6
7 ;; This file is part of GNU Emacs. 7 ;; This file is part of GNU Emacs.
8 8
21 ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330, 21 ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
22 ;; Boston, MA 02111-1307, USA. 22 ;; Boston, MA 02111-1307, USA.
23 23
24 24
25 ;;; Code: 25 ;;; Code:
26
27 (provide 'ediff-ptch)
28
29 (defgroup ediff-ptch nil
30 "Ediff patch support"
31 :tag "Patch"
32 :prefix "ediff-"
33 :group 'ediff)
34
35 ;; compiler pacifier
36 (defvar ediff-window-A)
37 (defvar ediff-window-B)
38 (defvar ediff-window-C)
39 (defvar ediff-use-last-dir)
40 (defvar ediff-shell)
41
42 (eval-when-compile
43 (let ((load-path (cons (expand-file-name ".") load-path)))
44 (or (featurep 'ediff-init)
45 (load "ediff-init.el" nil nil 'nosuffix))
46 (or (featurep 'ediff)
47 (load "ediff.el" nil nil 'nosuffix))
48 ))
49 ;; end pacifier
26 50
27 (require 'ediff-init) 51 (require 'ediff-init)
28 52
29 (defvar ediff-last-dir-patch nil 53 (defvar ediff-last-dir-patch nil
30 "Last directory used by an Ediff command for file to patch.") 54 "Last directory used by an Ediff command for file to patch.")
33 (if (memq system-type '(vax-vms axp-vms emx ms-dos windows-nt windows-95)) 57 (if (memq system-type '(vax-vms axp-vms emx ms-dos windows-nt windows-95))
34 "_orig" ".orig") 58 "_orig" ".orig")
35 "Backup extension used by the patch program. 59 "Backup extension used by the patch program.
36 See also `ediff-backup-specs'.") 60 See also `ediff-backup-specs'.")
37 61
38 (defvar ediff-backup-specs (format "-b %s" ediff-backup-extension) 62 (defcustom ediff-backup-specs (format "-b %s" ediff-backup-extension)
39 "*Backup directives to pass to the patch program. 63 "*Backup directives to pass to the patch program.
40 Ediff requires that the old version of the file \(before applying the patch\) 64 Ediff requires that the old version of the file \(before applying the patch\)
41 is saved in a file named `the-patch-file.extension'. Usually `extension' is 65 is saved in a file named `the-patch-file.extension'. Usually `extension' is
42 `.orig', but this can be changed by the user and may depend on the system. 66 `.orig', but this can be changed by the user and may depend on the system.
43 Therefore, Ediff needs to know the backup extension used by the patch program. 67 Therefore, Ediff needs to know the backup extension used by the patch program.
47 \(usually `.orig'\). 71 \(usually `.orig'\).
48 72
49 Note that both `ediff-backup-extension' and `ediff-backup-specs' 73 Note that both `ediff-backup-extension' and `ediff-backup-specs'
50 must be properly set. If your patch program takes the option `-b', 74 must be properly set. If your patch program takes the option `-b',
51 but not `-b extension', the variable `ediff-backup-extension' must 75 but not `-b extension', the variable `ediff-backup-extension' must
52 still be set so Ediff will know which extension to use.") 76 still be set so Ediff will know which extension to use."
53 77 :type 'string
54 78 :group 'ediff-ptch)
55 (defvar ediff-patch-default-directory nil 79
56 "*Default directory to look for patches.") 80
57 81 (defcustom ediff-patch-default-directory nil
58 (defvar ediff-context-diff-label-regexp 82 "*Default directory to look for patches."
83 :type '(choice (const nil) string)
84 :group 'ediff-ptch)
85
86 (defcustom ediff-context-diff-label-regexp
59 (concat "\\(" ; context diff 2-liner 87 (concat "\\(" ; context diff 2-liner
60 "^\\*\\*\\* \\([^ \t]+\\)[^*]+[\t ]*\n--- \\([^ \t]+\\)" 88 "^\\*\\*\\* \\([^ \t]+\\)[^*]+[\t ]*\n--- \\([^ \t]+\\)"
61 "\\|" ; GNU unified format diff 2-liner 89 "\\|" ; GNU unified format diff 2-liner
62 "^--- \\([^ \t]+\\)[\t ]+.*\n\\+\\+\\+ \\([^ \t]+\\)" 90 "^--- \\([^ \t]+\\)[\t ]+.*\n\\+\\+\\+ \\([^ \t]+\\)"
63 "\\)") 91 "\\)")
64 "*Regexp matching filename 2-liners at the start of each context diff.") 92 "*Regexp matching filename 2-liners at the start of each context diff."
65 93 :type 'regexp
66 (defvar ediff-patch-program "patch" 94 :group 'ediff-ptch)
95
96 (defcustom ediff-patch-program "patch"
67 "*Name of the program that applies patches. 97 "*Name of the program that applies patches.
68 It is recommended to use GNU-compatible versions.") 98 It is recommended to use GNU-compatible versions."
69 (defvar ediff-patch-options "-f" 99 :type 'string
100 :group 'ediff-ptch)
101 (defcustom ediff-patch-options "-f"
70 "*Options to pass to ediff-patch-program. 102 "*Options to pass to ediff-patch-program.
71 103
72 Note: the `-b' option should be specified in `ediff-backup-specs'. 104 Note: the `-b' option should be specified in `ediff-backup-specs'.
73 105
74 It is recommended to pass the `-f' option to the patch program, so it won't ask 106 It is recommended to pass the `-f' option to the patch program, so it won't ask
75 questions. However, some implementations don't accept this option, in which 107 questions. However, some implementations don't accept this option, in which
76 case the default value for this variable should be changed.") 108 case the default value for this variable should be changed."
109 :type 'string
110 :group 'ediff-ptch)
77 111
78 ;; The buffer of the patch file. Local to control buffer. 112 ;; The buffer of the patch file. Local to control buffer.
79 (ediff-defvar-local ediff-patchbufer nil "") 113 (ediff-defvar-local ediff-patchbufer nil "")
80 114
81 ;; The buffer where patch displays its diagnostics. 115 ;; The buffer where patch displays its diagnostics.
623 ;;; eval: (put 'ediff-defvar-local 'lisp-indent-hook 'defun) 657 ;;; eval: (put 'ediff-defvar-local 'lisp-indent-hook 'defun)
624 ;;; eval: (put 'ediff-eval-in-buffer 'lisp-indent-hook 1) 658 ;;; eval: (put 'ediff-eval-in-buffer 'lisp-indent-hook 1)
625 ;;; eval: (put 'ediff-eval-in-buffer 'edebug-form-spec '(form body)) 659 ;;; eval: (put 'ediff-eval-in-buffer 'edebug-form-spec '(form body))
626 ;;; End: 660 ;;; End:
627 661
628 (provide 'ediff-ptch)
629
630 ;;; ediff-ptch.el ends here 662 ;;; ediff-ptch.el ends here