;ELC ;;; Compiled by rms@ethanol.gnu.ai.mit.edu on Tue Aug 27 10:42:31 1996 ;;; from file /home/fsf/rms/e19/lisp/ediff-ptch.el ;;; in Emacs version 19.33.4 ;;; with bytecomp version 2.12 ;;; with all optimizations. ;;; This file uses opcodes which do not exist in Emacs 18. (if (and (boundp 'emacs-version) (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")) (require (quote ediff-init)) #@60 Last directory used by an Ediff command for file to patch. (defvar ediff-last-dir-patch nil (#$ . 514)) #@49 Default backup extension for the patch program. (defvar ediff-backup-extension (byte-code ">‡Ç" [system-type (vax-vms axp-vms emx ms-dos windows-nt windows-95) "_orig" ".orig"] 2) (#$ . 624)) #@41 *Default directory to look for patches. (defvar ediff-patch-default-directory nil (#$ . -829)) #@71 *Regexp matching filename 2-liners at the start of each context diff. (defvar ediff-context-diff-label-regexp (concat "\\(" "^\\*\\*\\* \\([^ ]+\\)[^*]+[ ]*\n--- \\([^ ]+\\)" "\\|" "^--- \\([^ ]+\\)[^-]+[ ]*\n\\+\\+\\+ \\([^ ]+\\)" "\\)") (#$ . -930)) #@44 *Name of the program that applies patches. (defvar ediff-patch-program "patch" (#$ . -1194)) #@42 *Options to pass to ediff-patch-program. (defvar ediff-patch-options "" (#$ . -1293)) #@2  (defvar ediff-patchbufer nil (#$ . 1384)) (byte-code "!#" [make-variable-buffer-local ediff-patchbufer put permanent-local t] 4) #@2  (defvar ediff-patch-diagnostics nil (#$ . 1527)) (byte-code "!#" [make-variable-buffer-local ediff-patch-diagnostics put permanent-local t] 4) #@2  (defvar ediff-patch-map nil (#$ . 1684)) (byte-code "!#" [make-variable-buffer-local ediff-patch-map put permanent-local t] 4) (defalias 'ediff-file-name-sans-prefix #[(filename prefix) " Ž P\"ǕOP*" [match-data match-data ((store-match-data match-data)) string-match "^" prefix filename 0 nil "/null/"] 3]) (put (quote ediff-file-name-sans-prefix) (quote byte-optimizer) (quote byte-compile-inline-expand)) (defalias 'ediff-count-matches #[(regexp buf) "p O !O !!OĎ qebmH`\n#H`U@u#T#)+Z =Z!)" [StartBuffer buf get-buffer buffer-name ((set-buffer StartBuffer)) 0 nil opoint count re-search-forward regexp t 1 this-command ediff-quit error ediff-KILLED-VITAL-BUFFER] 4]) (defalias 'ediff-map-patch-buffer #[(buf) "p  ! !!Ď q eǓelj \n \f eb` m# `Ueu ŔǓŕڔڕ\f۔ ە \f\f{    {B#ŔǓ#ŔǓbE\nB\n` TK) E\nB\n\".#=&!)" [StartBuffer buf get-buffer buffer-name ((set-buffer StartBuffer)) 0 make-marker nil ("/dev/null" . "/dev/null") opoint patch-map end2 end1 beg2 beg1 filenames mark2 mark2-end possible-file-names mark1-end mark1 count re-search-forward ediff-context-diff-label-regexp t 1 2 3 "/dev/null" re-search-backward "^Index:" noerror "^Prereq:" point-max-marker ediff-patch-map this-command ediff-quit error ediff-KILLED-VITAL-BUFFER] 14]) (defalias 'ediff-fixup-patch-map #[(filename) " ! ! ! ! @@@! @@A! \" !A A @ ! !B \" \"+" [expand-file-name filename file-directory-p file-name-as-directory file-name-directory ediff-patch-map base-dir2 base-dir1 actual-dir mapcar #[(triple) "@@-@@@\n ǎ P\f\"'\fʕO*\fP,@AZ@@A  ǎ P\f\"U\fʕOX\fP," [triple "/dev/null" base-dir1 prefix filename match-data match-data ((store-match-data match-data)) string-match "^" 0 nil "/null/" base-dir2] 4] "/dev/null" file-name-nondirectory #[(triple) "\n@@\"d\n@A\"d \n@@O\n@AO#!\n  \\$\n\n!Iȉ / \n\"!-\n\nB*\n@\n@@P!\n@\n@AP!" [string-match "^/null/" triple ediff-msg-buffer princ format "\nThe patch file contains a context diff for\n %s\n %s\n\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 user-file directory read-file-name "Please enter file name: " actual-dir file-directory-p beep message "%s is a directory" sit-for 2 expand-file-name] 9] #[(triple) "@@@A !\n!\nG GW\" \"\n G\nGW4\f4 \fH H \nH \fq q \n %!\n\"!l\nm {\n\f  \n#!$!Ή \"!*," [triple file1 file2 file-exists-p f1-exists f2-exists ediff-msg-buffer princ format "\nEdiff has inferred that\n %s\n %s\nare 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 inferred that \n %s\n %s\nare possible alternative targets for this patch.\n\nHowever, these files do not exist.\n\nPlease enter an alternative patch target ... \n" t nil target directory read-file-name "Please enter a patch target: " actual-dir file-directory-p beep message "%s is a directory" sit-for 2] 9]] 4]) (defalias 'ediff-show-patch-diagnostics #[nil " ! \"\f!\f \" \"" [window-live-p ediff-window-A set-window-buffer ediff-patch-diagnostics ediff-window-B display-buffer not-this-window] 3 nil nil]) #@106 Obtain patch buffer. If patch is already in a buffer---use it. Else, read patch file into a new buffer. (defalias 'ediff-get-patch-buffer #[nil " \f\n !\"p#!*\"!p [ ![ !![Ҏ qeb !W \" !)g=g!) ! *" [ediff-patch-default-directory ediff-use-last-dir ediff-last-dir-patch default-directory nil patch-buf dir y-or-n-p "Is the patch already in a buffer? " get-buffer read-buffer "Which buffer contains the patch? " must-match find-file-noselect read-file-name "Which file contains the patch? " StartBuffer buffer-name ((set-buffer StartBuffer)) ediff-get-visible-buffer-window pop-to-buffer other-window select-window previous-window this-command ediff-quit error ediff-KILLED-VITAL-BUFFER ediff-map-patch-buffer] 5 (#$ . 5564)]) (defalias 'ediff-dispatch-file-patching-job #[(patch-buf filename &optional startup-hooks) "p T !T !!TĎ q!GWK @@\"C@@GVC@@E #P  \")_=_!)" [StartBuffer patch-buf get-buffer buffer-name ((set-buffer StartBuffer)) ediff-fixup-patch-map filename ediff-patch-map 2 ediff-patch-file-internal string-match "^/dev/null" 1 startup-hooks ediff-multi-patch-internal this-command ediff-quit error ediff-KILLED-VITAL-BUFFER] 5]) (defalias 'ediff-patch-buffer-internal #[(patch-buf buf-to-patch-name &optional startup-hooks) " ! \n!\n!p5!5!!5ʎq )@\f=@!)GV\fY\fb!p\n\n!\n!!׎\nq\n!! !! )\f=!) #\f?pz!z!!zq#!!$!!p# #! #!! #q! !!),\f=,!)p$k$!k$!!k$qW! P\"!!)v\f=v!*\f=!)." [get-buffer buf-to-patch-name buf-to-patch buffer-file-name file-name-ok buffer-modified-p buf-mod-status StartBuffer patch-buf buffer-name ((set-buffer StartBuffer)) ediff-patch-map this-command ediff-quit error ediff-KILLED-VITAL-BUFFER 1 multifile-patch-p nil default-dir file-name ctl-buf "Can't apply multi-file patches to buffers that visit no files" ((set-buffer StartBuffer)) default-directory ediff-make-temp-file set-visited-file-name buffer-auto-save-file-name rename-buffer set-buffer-modified-p set-visited-file-modtime ediff-dispatch-file-patching-job startup-hooks ((set-buffer StartBuffer)) delete-file ediff-buffer-A ediff-buffer-B ((set-buffer StartBuffer)) ((set-buffer StartBuffer)) ediff-unique-buffer-name "_patched" "" t] 5]) (defalias 'ediff-patch-file-internal #[(patch-buf source-filename &optional startup-hooks) " !\n\n\"ŕ\n\"ŕO !\f  ՘K\n\"V!$ ! !?!!v!p!\f\f!\f!!\fq&!!!\"ed/\n !%$\")1=3!)!!\f!! P!!1p!!!!!!!q P!!)-1=-3!)g !<>!B>