;ELC   
;;; Compiled by pot@pot.cnuce.cnr.it on Tue Mar 18 15:38:21 2003
;;; from file /home/pot/gnu/emacs-pretest.new/lisp/ediff-ptch.el
;;; in Emacs version 21.3
;;; with bytecomp version 2.85.4.1
;;; 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 "`ediff-ptch.el' was compiled for Emacs 19.29 or later"))

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;


(byte-code "\301\302!\210\303\302\304\305\306\307\310\311\312\313&	\210\314B\315B\316B\317B\320B\321\322!\207" [current-load-list provide ediff-ptch custom-declare-group nil "Ediff patch support" :tag "Patch" :prefix "ediff-" :group ediff ediff-window-A ediff-window-B ediff-window-C ediff-use-last-dir ediff-shell require ediff-init] 10)
#@94 *Name of the program that applies patches.
It is recommended to use GNU-compatible versions.
(custom-declare-variable 'ediff-patch-program '"patch" '(#$ . -971) :type 'string :group 'ediff-ptch)
#@328 *Options to pass to ediff-patch-program.

Note: the `-b' option should be specified in `ediff-backup-specs'.

It is recommended to pass the `-f' option to the patch program, so it won't ask
questions.  However, some implementations don't accept this option, in which
case the default value for this variable should be changed.
(custom-declare-variable 'ediff-patch-options '"-f" '(#$ . -1173) :type 'string :group 'ediff-ptch)
#@60 Last directory used by an Ediff command for file to patch.
(defvar ediff-last-dir-patch nil (#$ . 1606))
(byte-code "\302B	\303>\203 \304\202 \305\302\207" [current-load-list system-type ediff-default-backup-extension (vax-vms axp-vms emx ms-dos) "_orig" ".orig"] 2)
#@76 Backup extension used by the patch program.
See also `ediff-backup-specs'.
(custom-declare-variable 'ediff-backup-extension 'ediff-default-backup-extension '(#$ . 1884) :type 'string :group 'ediff-ptch)
(defalias 'ediff-test-patch-utility #[nil "\301\302\303\211\211\304\305&!\203 \306\207\301\302\303\211\211\305%!\203 \307\207\310\207" [ediff-patch-program zerop call-process nil "-z." "-b" gnu posix traditional] 8])
#@1122 *Backup directives to pass to the patch program.
Ediff requires that the old version of the file (before applying the patch)
be saved in a file named `the-patch-file.extension'.  Usually `extension' is
`.orig', but this can be changed by the user and may depend on the system.
Therefore, Ediff needs to know the backup extension used by the patch program.

Some versions of the patch program let you specify `-b backup-extension'.
Other versions only permit `-b', which assumes the extension `.orig'
(in which case ediff-backup-extension MUST be also `.orig').  The latest
versions of GNU patch require `-b -z backup-extension'.

Note that both `ediff-backup-extension' and `ediff-backup-specs'
must be set properly.  If your patch program takes the option `-b',
but not `-b extension', the variable `ediff-backup-extension' must
still be set so Ediff will know which extension to use.

Ediff tries to guess the appropriate value for this variables.  It is believed
to be working for `traditional' patch, all versions of GNU patch, and for POSIX
patch.  So, don't change these variables, unless the default doesn't work.
(custom-declare-variable 'ediff-backup-specs '(let ((type (ediff-test-patch-utility))) (cond ((eq type 'gnu) (format "-z%s -b" ediff-backup-extension)) ((eq type 'posix) (setq ediff-backup-extension ediff-default-backup-extension) "-b") (t (format "-b %s" ediff-backup-extension)))) '(#$ . -2317) :type 'string :group 'ediff-ptch)
#@41 *Default directory to look for patches.
(custom-declare-variable 'ediff-patch-default-directory 'nil '(#$ . -3775) :type '(choice (const nil) string) :group 'ediff-ptch)
#@158 *Regexp matching filename 2-liners at the start of each context diff.
You probably don't want to change that, unless you are using an obscure patch
program.
(custom-declare-variable 'ediff-context-diff-label-regexp '(concat "\\(" "^\\*\\*\\* \\([^ 	]+\\)[^*]+[	 ]*\n--- \\([^ 	]+\\)" "\\|" "^--- \\([^ 	]+\\)[	 ]+.*\n\\+\\+\\+ \\([^ 	]+\\)" "\\)") '(#$ . -3952) :type 'regexp :group 'ediff-ptch)
#@2 
(defvar ediff-patchbufer nil (#$ . 4353))
(byte-code "\300\301!\210\302\301\303\304#\207" [make-variable-buffer-local ediff-patchbufer put permanent-local t] 4)
#@2 
(defvar ediff-patch-diagnostics nil (#$ . 4520))
(byte-code "\300\301!\210\302\301\303\304#\207" [make-variable-buffer-local ediff-patch-diagnostics put permanent-local t] 4)
#@2 
(defvar ediff-patch-map nil (#$ . 4701))
(byte-code "\300\301!\210\302\301\303\304#\207" [make-variable-buffer-local ediff-patch-map put permanent-local t] 4)
(defalias 'ediff-file-name-sans-prefix #[(filename prefix) "\303 \304\216\305\306	P\n\"\203 \n\307\225\310O\202 \311\nP*\207" [save-match-data-internal prefix filename match-data ((set-match-data save-match-data-internal)) string-match "^" 0 nil "/null/"] 3])
(put 'ediff-file-name-sans-prefix 'byte-optimizer 'byte-compile-inline-expand)
(defalias 'ediff-count-matches #[(regexp buf) "\203B \306!\203B \307\306!!\203B rq\210\310\311\212eb\210m\204> `\312\311\313#\203> 	`U\2038 \314u\210\202 \nT\202 )\n+\207\f\315=\206K \316!\207" [buf opoint count regexp this-command ediff-KILLED-VITAL-BUFFER get-buffer buffer-name 0 nil re-search-forward t 1 ediff-quit error] 4])
(defalias 'ediff-map-patch-buffer #[(buf) "\203\f\306!\203\f\307\306!!\203\frq\210\310\311 e\312\223e\313\312\211\211\211\211\211\211\211\211 !\"\212eb\210`m\204\364 \314#\312\315#\203\364 	`U\203[ \316u\210\202\352 \311 \310\224\312\223\310\225\317\224\206n \320\224\317\225\206w \320\225\321\224\206 \322\224\321\225\206\207 \322\225\203\230 \f\203\230 \f{\202\231 \323\203\247 \203\247 {\202\250 \323B\324\325 \326#\203\273 \310\224\312\223\210\324\327 \326#\203\313 \310\224\312\223\210b\210\203\336 !E\nB! `\"T\"\202B )\330 !E\nB\211\237$\".\207%\331=\206\332&!\207" [buf opoint patch-map end2 end1 beg2 get-buffer buffer-name 0 make-marker nil ("/dev/null" . "/dev/null") re-search-forward t 1 2 4 3 5 "/dev/null" re-search-backward "^Index:" noerror "^Prereq:" point-max-marker ediff-quit error beg1 filenames mark2 mark2-end possible-file-names mark1-end mark1 count ediff-context-diff-label-regexp ediff-patch-map this-command ediff-KILLED-VITAL-BUFFER] 14])
(defalias 'ediff-fixup-patch-map #[(filename) "\305!\306!\203 \307!\202 \310!\310	@@@!\310	@@A!\311\312	\"\210\306!\204> \313\230\204> 	@\314!\314!B\240\210\311\315	\"\210\311\316	\"+\207" [filename ediff-patch-map base-dir2 base-dir1 actual-dir expand-file-name file-directory-p file-name-as-directory file-name-directory mapcar #[(triple) "@@\306\230\204, @@@	\307 \310\216\311\312\nP\"\203& \313\225\314O\202) \315P,\240\210@A\306\230\206W @@A\307 \310\216\311\312\nP\"\203R \313\225\314O\202U \315P,\241\207" [triple base-dir1 prefix filename save-match-data-internal base-dir2 "/dev/null" match-data ((set-match-data save-match-data-internal)) string-match "^" 0 nil "/null/"] 4] "/dev/null" file-name-nondirectory #[(triple) "\306\307@@\"\203\206 \306\307@A\"\203\206 	\220\n\2031 \310\n!\2031 \311\310\n!!\2031 r\nq\210\312 \210)\202; \313=\204; \314\f!\210\315\316\317@@\320\321O@A\320\321O#!\221\210\322\321\203 \323\324\211\322$\325!\204m \321\211\202U \322\326 \210\327\330\"\210\331\332!\210\202S \211B\240*\207@\333@@P!\240\210@\333@AP!\241\207" [triple ediff-msg-buffer standard-output this-command ediff-KILLED-VITAL-BUFFER user-file string-match "^/null/" get-buffer buffer-name fundamental-mode ediff-quit error princ format "\nThe patch file contains a context diff for\n	%s\n	%s\nHowever, Ediff cannot infer the name of the actual file\nto be patched on your system.  If you know the correct file name,\nplease enter it now.\n\nIf you don't know and still would like to apply patches to\nother files, enter /dev/null\n" 6 nil t read-file-name "Please enter file name: " file-directory-p beep message "%s is a directory" sit-for 2 expand-file-name directory actual-dir] 9] #[(triple) "@@@A\306	!\306\n!\nG	GW\203\" \f\203\" \n\240\2028	G\nGW\2034 \2034 	\240\2028\203H \f\203H 	\n\230\203H 	\240\2028\203\235 \f\203\235 \220\203s \307!\203s \310\307!!\203s rq\210\311 \210)\202  \312=\204 \313!!\210\314\315\316	\n\211	%!\221\210\317\315\320\n\"!\203\230 \n\202\231 	\240\2028\f\203\247 \n\240\2028\203\261 	\240\2028\220\203\324 \307!\203\324 \310\307!!\203\324 rq\210\311 \210)\202\340  \312=\204\340 \313!!\210\314\321!\210	\n\230\203\364 \314\315\322	\"!\210\202\374 \314\315\323	\n#!\210\314\324!\221\210\325\326\"##\2033\327\330$\211\325$\"\331\"!\204#\326\211#\202	\332 \210\333\334\"\"\210\335\336!\210\202\"\240*,\207" [triple file1 file2 f1-exists f2-exists ediff-msg-buffer file-exists-p get-buffer buffer-name fundamental-mode ediff-quit error princ format "\nEdiff has inferred that\n	%s\n	%s\nare two possible targets for applying the patch.\nBoth files seem to be plausible alternatives.\n\nPlease advice:\n    Type `y' to use %s as the target;\n    Type `n' to use %s as the target.\n" y-or-n-p "Use %s ? " "\nEdiff has inferred that" "\n	%s\nis the target for this patch.  However, this file does not exist." "\n	%s\n	%s\nare two possible targets for this patch.  However, these files do not exist." "\n\nPlease enter an alternative patch target ...\n" t nil read-file-name "Please enter a patch target: " file-directory-p beep message "%s is a directory" sit-for 2 standard-output this-command ediff-KILLED-VITAL-BUFFER target directory actual-dir] 9]] 4])
(defalias 'ediff-show-patch-diagnostics #[nil "\303!\203 \304	\"\207\303\n!\203 \304\n	\"\207\305	\306\"\207" [ediff-window-A ediff-patch-diagnostics ediff-window-B window-live-p set-window-buffer display-buffer not-this-window] 3 nil nil])
(defalias 'ediff-prompt-for-patch-file #[nil "\206 	\203\f \n\202 \f\306\307\310\311\2030 \312!\313!\232\2030 \314\315!\316Q\2021 \317\"\320$!*\207" [ediff-patch-default-directory ediff-use-last-dir ediff-last-dir-patch default-directory ediff-coding-system-for-read coding-system-for-read find-file-noselect read-file-name format "Patch is in file:%s " expand-file-name file-name-directory " (default " file-name-nondirectory ")" "" must-match dir buffer-file-name] 7])
(defalias 'ediff-prompt-for-patch-buffer #[nil "\301\302\303\212eb\210\304\305\306#)\203 p\202! \307\213\206! \310\213\206! \311p!\312#!\207" [ediff-context-diff-label-regexp get-buffer read-buffer "Buffer that holds the patch: " re-search-forward nil t ((byte-code "\301\302!\210\212eb\210\303\304\305#\205 p)\207" [ediff-context-diff-label-regexp other-window 1 re-search-forward nil t] 4)) ((byte-code "\301\302!\210\212eb\210\303\304\305#\205 p)\207" [ediff-context-diff-label-regexp other-window -1 re-search-forward nil t] 4)) ediff-other-buffer must-match] 7])
#@170 Obtain patch buffer.  If patch is already in a buffer---use it.
Else, read patch file into a new buffer. If patch buffer is passed as an
optional argument, then use it.
(defalias 'ediff-get-patch-buffer #[(&optional arg patch-buf) "\306\307\n\203 \310\n!\203 \311\310\n!!\204L \250\203* \312\313\"\314=\203* \315 \202L \250\203> \312\313\"\316=\203> \317 \202L \320\321!\203I \315 \202K \317 \n\203y \310\n!\203y \311\310\n!!\203y r\nq\210eb\210\322\n!\204u \323\n\324\"\210\325\326 !\210)\202\203 \f\327=\204\203 \330!\210\331\n!\210\n*\207" [last-command-event last-nonmenu-event patch-buf arg this-command ediff-KILLED-VITAL-BUFFER t nil get-buffer buffer-name mod 2 0 ediff-prompt-for-patch-buffer 1 ediff-prompt-for-patch-file y-or-n-p "Is the patch already in a buffer? " ediff-get-visible-buffer-window pop-to-buffer other-window select-window previous-window ediff-quit error ediff-map-patch-buffer] 3 (#$ . 11238)])
(defalias 'ediff-dispatch-file-patching-job #[(patch-buf filename &optional startup-hooks) "\203K \306!\203K \307\306!!\203K rq\210\310	!\210\nG\311W\203E \312\n\203? \313\314\n@@\"\204? \n@@G\315V\203? \n@@\202@ 	#\202I \316\")\207\f\317=\206T \320!\207" [patch-buf filename ediff-patch-map startup-hooks this-command ediff-KILLED-VITAL-BUFFER get-buffer buffer-name ediff-fixup-patch-map 2 ediff-patch-file-internal string-match "^/dev/null" 1 ediff-multi-patch-internal ediff-quit error] 5])
(defalias 'ediff-patch-buffer-internal #[(patch-buf buf-to-patch-name &optional startup-hooks) "\306!\211\205 \307	!\310	!\f\203+ \306\f!\203+ \311\306\f!!\203+ r\fq\210)\2026 \312=\2066 \313!G\314V\315\315\315\203M \313\316!\210	\203\213 \306	!\203\213 \311\306	!!\203\213 r	q\210 \317	!\320!\210\n\204x \315!\321!\210\322\315!\210\323 \210 )\202\227 \312=\204\227 \313!\210\324\f\"#\211\203O\306!\203O\311\306!!\203Orq\210\325\307#!!\210\325\307$!!\210#\203\372 \306#!\203\372 \311\306#!!\203\372 r#q\210\203\352  \320\n!\210\321!\210\322!\210)\202\312=\204\313!\210$\203@\306$!\203@\311\306$!!\203@r$q\210\315!\203, \320\315!\210\321\326\327P\330\"!\210\322\331!)\202K\312=\206K\313!)\202Z\312=\206Z\313!.\207" [buf-to-patch-name buf-to-patch visited-file buf-mod-status patch-buf ediff-patch-map get-buffer buffer-file-name buffer-modified-p buffer-name ediff-quit error 1 nil "To apply multi-file patches, please use `ediff-patch-file'" ediff-make-temp-file set-visited-file-name rename-buffer set-buffer-modified-p set-visited-file-modtime ediff-dispatch-file-patching-job delete-file ediff-unique-buffer-name "_patched" "" t this-command ediff-KILLED-VITAL-BUFFER multifile-patch-p default-dir file-name ctl-buf default-directory buffer-auto-save-file-name startup-hooks ediff-buffer-A ediff-buffer-B] 5])
(defalias 'ediff-patch-return-code-ok #[(code) "\301=\207" [code 0] 2])
(defalias 'ediff-patch-file-internal #[(patch-buf source-filename &optional startup-hooks) "\306!	\307\310!\311\312!\205 \n>\313?\313\313@\313A\313B\313C\313D\314\315E\"\2039 \316\317!\210\320\304\321\322\323$\210\324\f!\324!\232?@\325!\210\203\233 \326!\203\233 \327\326!!\203\233 rq\210\330F!\210\331\332!\210\333\334!C\335\334\313\"\210\336ed\n\337\211\313G\340\341HEI\306\f!%&A\335\334C\"\210)\202\247 J\342=\204\247 \316K!\210\331\343!\210\331\344!\210\345!\210\346\347!\210\350A!\203\307 \351\fLP!\204&M\220N\203\353 \326N!\203\353 \327\326N!!\203\353 rNq\210\352 \210)\202\367 J\342=\204\367 \316K!\210\353\340\354H\211ELI&!\221\210\355\356!\210\357M!\211D\203\360D!\210db\210\361!\210\316\362!\210@\204c\203T\326!\203T\327\326!!\203Trq\210\363LP!\210\364\313!\210)\202\202J\342=\204\202\316K!\210\202\202\365\324!!\203o\f\202p\366P\367\f\337#\210\367\fLP\f\337#\210\370B\371!?\372?\313\373%\211B\203\275\326B!\203\275\327\326B!!\203\275rBq\210FOP)\202\311J\342=\204\311\316K!\210\374!\210\331\375!\210B.\f\207" [source-filename ediff-shell shell-file-name patch-diagnostics true-source-filename target-filename expand-file-name get-buffer-create "*ediff patch diagnostics*" boundp buffer-file-coding-system nil string-match "V" error "Ediff doesn't take the -V option in `ediff-patch-options'--sorry" ediff-find-file buf-to-patch ediff-last-dir-patch startup-hooks file-truename ediff-maybe-checkout get-buffer buffer-name insert-buffer message "Applying patch ... " getenv "VERSION_CONTROL" setenv call-process-region t format "%s %s %s %s" ediff-quit "Applying patch ... done" "" switch-to-buffer sit-for 0 ediff-patch-return-code-ok file-exists-p fundamental-mode princ "Patch program has failed due to a bad patch file,\nit couldn't apply all hunks, OR\nit couldn't create the backup for the file being patched.\n\nThe former could be caused by a corrupt patch file or because the %S\nprogram doesn't understand the format of the patch file in use.\n\nThe second problem might be due to an incompatibility among these settings:\n    ediff-patch-program    = %S             ediff-patch-options    = %S\n    ediff-backup-extension = %S             ediff-backup-specs     = %S\n\nSee Ediff on-line manual for more details on these variables.\nIn particular, check the documentation for `ediff-backup-specs'. \n\nIn any of the above cases, Ediff doesn't compare files automatically.\nHowever, if the patch was applied partially and the backup file was created,\nyou can still examine the changes via M-x ediff-files" beep 1 get-buffer-window select-window switch-to-buffer-other-window "Patch appears to have failed" set-visited-file-name set-buffer-modified-p ediff-file-remote-p "_patched" rename-file ediff-set-read-only-in-buf-A find-file-noselect ediff-buffers-internal epatch bury-buffer "Type `P', if you need to see patch diagnostics" coding-system-for-write target-buf file-name-magic-p patch-return-code ctl-buf backup-style aux-wind ediff-patch-options patch-buf shell-command-switch ediff-patch-program ediff-backup-specs this-command ediff-KILLED-VITAL-BUFFER ediff-backup-extension ediff-msg-buffer standard-output ediff-patchbufer ediff-patch-diagnostics] 16])
(defalias 'ediff-multi-patch-internal #[(patch-buf &optional startup-hooks) "\306\307	B\310\311\n\203* \312\n!\203* \313\312\n!!\203* r\nq\210\306\314\315\n\"D)B\2023 \f\316=\2063 \317!\320\321\322	&\323!)\207" [meta-buf startup-hooks patch-buf ediff-patch-map this-command ediff-KILLED-VITAL-BUFFER nil (lambda nil (setq ediff-session-action-function 'ediff-patch-file-form-meta ediff-meta-patchbufer patch-buf)) ediff-prepare-meta-buffer ediff-filegroup-action get-buffer buffer-name format "%S" ediff-quit error "*Ediff Session Group Panel" ediff-redraw-directory-group-buffer ediff-multifile-patch ediff-show-meta-buffer] 7])
