;ELC ;;; Compiled by pot@pot.cnuce.cnr.it on Tue Mar 18 15:37:48 2003 ;;; from file /home/pot/gnu/emacs-pretest.new/lisp/diff-mode.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 "`diff-mode.el' was compiled for Emacs 19.29 or later")) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (custom-declare-group 'diff-mode nil "Major mode for viewing/editing diffs" :version "21.1" :group 'tools :group 'diff) #@61 If non-nil, `diff-mode' buffers default to being read-only. (custom-declare-variable 'diff-default-read-only 't '(#$ . 740) :type 'boolean :group 'diff-mode) #@90 *Non-nil means `diff-goto-source' jumps to the old file. Else, it jumps to the new file. (custom-declare-variable 'diff-jump-to-old-file 'nil '(#$ . -904) :group 'diff-mode :type '(boolean)) #@341 *Non-nil means hunk headers are kept up-to-date on-the-fly. When editing a diff file, the line numbers in the hunk headers need to be kept consistent with the actual diff. This can either be done on the fly (but this sometimes interacts poorly with the undo mechanism) or whenever the file is written (can be slow when editing big diffs). (custom-declare-variable 'diff-update-on-the-fly 't '(#$ . -1102) :group 'diff-mode :type '(boolean)) #@77 *Non-nil means `diff-apply-hunk' will move to the next hunk after applying. (custom-declare-variable 'diff-advance-after-apply-hunk 't '(#$ . -1550) :group 'diff-mode :type 'boolean) #@50 Run after setting up the `diff-mode' major mode. (defvar diff-mode-hook nil (#$ . 1739)) (byte-code "\301B\302\301!\204\f\303\301\207" [current-load-list diff-outline-regexp boundp "\\([*+][*+][*+] [^0-9]\\|@@ ...\\|\\*\\*\\* [0-9].\\|--- [0-9]..\\)"] 2) #@61 Basic keymap for `diff-mode', bound to various prefix keys. (defconst diff-mode-shared-map (byte-code "\301\302\303\304\300!\205\n\303$\207" [diff-mode-shared-map easy-mmode-define-keymap (("n" . diff-hunk-next) ("N" . diff-file-next) ("p" . diff-hunk-prev) ("P" . diff-file-prev) ("k" . diff-hunk-kill) ("K" . diff-file-kill) ("}" . diff-file-next) ("{" . diff-file-prev) (" " . diff-goto-source) ([mouse-2] . diff-mouse-goto-source) ("W" . widen) ("o" . diff-goto-source) (" " . scroll-up) ("" . scroll-down) ("A" . diff-ediff-patch) ("r" . diff-restrict-view) ("R" . diff-reverse-direction) ("U" . diff-context->unified) ("C" . diff-unified->context)) nil boundp] 5) (#$ . 2004)) #@59 Keymap for `diff-mode'. See also `diff-mode-shared-map'. (defconst diff-mode-map (byte-code "\302\303B\304B\305\306\301!\205 \305$\207" [diff-mode-shared-map diff-mode-map easy-mmode-define-keymap "" (("" . diff-goto-source) ("" . diff-split-hunk) ("" . diff-apply-hunk) ("" . diff-test-hunk)) nil boundp] 5) (#$ . 2696)) #@23 Menu for `diff-mode'. (defvar diff-mode-menu nil (#$ . 3037)) (easy-menu-do-define 'diff-mode-menu diff-mode-map "Menu for `diff-mode'." '("Diff" ["Jump to Source" diff-goto-source t] ["Apply hunk" diff-apply-hunk t] ["Apply diff with Ediff" diff-ediff-patch t] ["-----" nil nil] ["Reverse direction" diff-reverse-direction t] ["Context -> Unified" diff-context->unified t] ["Unified -> Context" diff-unified->context t])) #@44 Prefix key for `diff-minor-mode' commands. (custom-declare-variable 'diff-minor-mode-prefix '"=" '(#$ . 3466) :group 'diff-mode :type '(choice (string "") (string "C-c=") string)) #@65 Keymap for `diff-minor-mode'. See also `diff-mode-shared-map'. (defconst diff-minor-mode-map (byte-code "\303 BC\304\305\302!\205 \n\304$\207" [diff-minor-mode-prefix diff-mode-shared-map diff-minor-mode-map easy-mmode-define-keymap nil boundp] 5) (#$ . 3654)) (byte-code "\306\301\307\310\311\312%\210\301B\313\301!\204\301\306\302\314\315\311\312%\210\302B\313\302!\204(\302\306\303\316\317\311\312%\210\303B\313\303!\204<\303\306\304\320\321\311\312%\210\304B\313\304!\204P\304\306\305\322\323\311\312%\210\305B\313\305!\204d\305\306\324\325\326\311\312%\210\324B\313\324!\204y\324\306\327\330\331\311\312%\210\327B\313\327!\204\216\327\306\332\333\334\311\312%\210\332B\313\332!\204\243\332\306\335\336\337\311\312%\210\335B\313\335!\204\270\335\306\340\341\342\311\312%\210\340B\313\340!\204\315\340 \343B\313\343!\204\332\344#\345B\346%\347B\313\347!\204\356\350'\351B\313\351!\204\373\352)\353B\313\353!\204\354+\355B\356-\357B\360-\361\362OP/\363B\313\363!\204)\3623\362\207" [current-load-list diff-header-face diff-file-header-face diff-index-face diff-hunk-header-face diff-removed-face custom-declare-face ((((type tty pc) (class color) (background light)) (:foreground "blue1" :bold t)) (((type tty pc) (class color) (background dark)) (:foreground "green" :bold t)) (((class color) (background light)) (:background "grey85")) (((class color) (background dark)) (:background "grey45")) (t (:bold t))) "`diff-mode' face inherited by hunk and index header faces." :group diff-mode boundp ((((type tty pc) (class color) (background light)) (:foreground "yellow" :bold t)) (((type tty pc) (class color) (background dark)) (:foreground "cyan" :bold t)) (((class color) (background light)) (:background "grey70" :bold t)) (((class color) (background dark)) (:background "grey60" :bold t)) (t (:bold t))) "`diff-mode' face used to highlight file header lines." ((t (:inherit diff-file-header-face))) "`diff-mode' face used to highlight index header lines." ((t (:inherit diff-header-face))) "`diff-mode' face used to highlight hunk header lines." ((t (:inherit diff-changed-face))) "`diff-mode' face used to highlight removed lines." diff-added-face ((t (:inherit diff-changed-face))) "`diff-mode' face used to highlight added lines." diff-changed-face ((((type tty pc) (class color) (background light)) (:foreground "magenta" :bold t :italic t)) (((type tty pc) (class color) (background dark)) (:foreground "yellow" :bold t :italic t)) (t nil)) "`diff-mode' face used to highlight changed lines." diff-function-face ((t (:inherit diff-context-face))) "`diff-mode' face used to highlight function names produced by \"diff -p\"." diff-context-face ((((class color) (background light)) (:foreground "grey50")) (((class color) (background dark)) (:foreground "grey70")) (t)) "`diff-mode' face used to highlight context and other side-information." diff-nonexistent-face ((t (:inherit diff-file-header-face))) "`diff-mode' face used to highlight nonexistent files in recursive diffs." diff-font-lock-keywords (("^\\(@@ -[0-9,]+ \\+[0-9,]+ @@\\)\\(.*\\)$" (1 diff-hunk-header-face) (2 diff-function-face)) ("^--- .+ ----$" . diff-hunk-header-face) ("^\\(\\*\\{15\\}\\)\\(.*\\)$" (1 diff-hunk-header-face) (2 diff-function-face)) ("^\\*\\*\\* .+ \\*\\*\\*\\*" . diff-hunk-header-face) ("^\\(---\\|\\+\\+\\+\\|\\*\\*\\*\\) \\(\\S-+\\)\\(.*[^*-]\\)?\n" (0 diff-header-face) (2 diff-file-header-face prepend)) ("^[0-9,]+[acd][0-9,]+$" . diff-hunk-header-face) ("^!.*\n" . diff-changed-face) ("^[+>].*\n" . diff-added-face) ("^[-<].*\n" . diff-removed-face) ("^Index: \\(.+\\).*\n" (0 diff-header-face) (1 diff-index-face prepend)) ("^Only in .*\n" . diff-nonexistent-face) ("^#.*" . font-lock-string-face) ("^[^-=+*!<>].*\n" . diff-context-face)) diff-font-lock-defaults (diff-font-lock-keywords t nil nil nil (font-lock-multiline)) diff-imenu-generic-expression ((nil "\\+\\+\\+\\ \\([^ \n]+\\)[ \n]" 1) (nil "^--- \\([^ \n]+\\) .*\n\\*" 1)) diff-file-regexp-alist (("Index: \\(.+\\)" 1)) diff-error-regexp-alist (("@@ -\\([0-9]+\\),[0-9]+ \\+\\([0-9]+\\),[0-9]+ @@" nil 2) ("--- \\([0-9]+\\),[0-9]+ ----" nil 1) ("\\([0-9]+\\)\\(,[0-9]+\\)?[adc]\\([0-9]+\\)" nil 3)) diff-hunk-header-re "^\\(@@ -[0-9,]+ \\+[0-9,]+ @@.*\\|\\*\\{15\\}.*\n\\*\\*\\* .+ \\*\\*\\*\\*\\|[0-9]+\\(,[0-9]+\\)?[acd][0-9]+\\(,[0-9]+\\)?\\)$" diff-file-header-re "^\\(--- .+\n\\+\\+\\+\\|\\*\\*\\* .+\n---\\|[^-+!<>0-9@* ]\\).+\n" 1 nil diff-narrowed-to] 6) (defalias 'diff-end-of-hunk #[(&optional style) "\304!\203\n\305\225b\210\306 \307=\203\310\nP\202, \311=\203!\312\202, \313=\203+\314\202,\315\316\317#\2054\305\224\211\206:db)\207" [diff-hunk-header-re style diff-file-header-re end looking-at 0 re-search-forward unified "^[^-+# \\]\\|" context "^[^-+#! \\]" normal "^[^<>#\\]" "^[^-+#!<> \\]" nil t] 5]) (defalias 'diff-beginning-of-hunk #[nil "\301 \210\302!?\205\303y\210\304\305\306\217\207" [diff-hunk-header-re beginning-of-line looking-at 1 nil (re-search-backward diff-hunk-header-re) ((error (error "Can't find the beginning of the hunk")))] 3]) (defalias 'diff-beginning-of-file #[nil "\301 \210\302!?\205\303y\210\304\305\306\217\207" [diff-file-header-re beginning-of-line looking-at 2 nil (re-search-backward diff-file-header-re) ((error (error "Can't find the beginning of the file")))] 3]) (defalias 'diff-end-of-file #[nil "\300\301\302\303#\210\300\304\302\305#\210\306 \207" [re-search-forward "^[-+#!<>0-9@* \\]" nil t "^[^-+#!<>0-9@* \\]" move beginning-of-line] 4]) (add-to-list 'debug-ignored-errors "^No \\(previous\\|next\\) hunk") #@31 Go to the next COUNT'th hunk. (defalias 'diff-hunk-next #[(&optional count) "\204\303\304W\203\305[!\207\306 !\203T\307 \310\311$\2045\306 !\2031\312 \206/db\207\313\314!\207\304\224b\210p\315\316 !=\205\\t\205\\\212\312 )\206Nd\317\n\310\311#?\205[\320\321!)\207" [count diff-hunk-header-re endpt 1 0 diff-hunk-prev looking-at re-search-forward nil t diff-end-of-hunk error "No next hunk" window-buffer selected-window pos-visible-in-window-p recenter (0)] 5 (#$ . 9296) nil]) #@34 Go to the previous COUNT'th hunk (defalias 'diff-hunk-prev #[(&optional count) "\204\302\303W\203\304[!\207\305 \306\307$?\205\310\311!\207" [count diff-hunk-header-re 1 0 diff-hunk-next re-search-backward nil t error "No previous hunk"] 5 (#$ . 9801) nil]) (add-to-list 'debug-ignored-errors "^No \\(previous\\|next\\) file") #@31 Go to the next COUNT'th file. (defalias 'diff-file-next #[(&optional count) "\204\303\304W\203\305[!\207\306 !\203T\307 \310\311$\2045\306 !\2031\312 \206/db\207\313\314!\207\304\224b\210p\315\316 !=\205\\t\205\\\212\312 )\206Nd\317\n\310\311#?\205[\320\321!)\207" [count diff-file-header-re endpt 1 0 diff-file-prev looking-at re-search-forward nil t diff-end-of-hunk error "No next file" window-buffer selected-window pos-visible-in-window-p recenter (0)] 5 (#$ . 10145) nil]) #@34 Go to the previous COUNT'th file (defalias 'diff-file-prev #[(&optional count) "\204\302\303W\203\304[!\207\305 \306\307$?\205\310\311!\207" [count diff-file-header-re 1 0 diff-file-next re-search-backward nil t error "No previous file"] 5 (#$ . 10651) nil]) #@115 Restrict the view to the current hunk. If the prefix ARG is given, restrict the view to the current file instead. (defalias 'diff-restrict-view #[(&optional arg) "\212\203 \301 \210\202\302 \210`\203\303 \210\202\304 \210`}\210\305\306!\203*\307\202+\310L)\207" [arg diff-beginning-of-file diff-beginning-of-hunk diff-end-of-file diff-end-of-hunk make-local-variable diff-narrowed-to file hunk] 2 (#$ . 10928) "P"]) #@20 Kill current hunk. (defalias 'diff-hunk-kill #[nil "\304 \210`\212\305\306\307\217)\212\310\311\312\217)\212\313\314\315\217)\n\2037\n U\2037 \2032\2037 V\2037\316 \202>\317 \210\320 `\",\207" [nextfile nexthunk firsthunk start diff-beginning-of-hunk #1=#:G97269 (byte-code "\300 \210\301 \210`\207" [diff-beginning-of-file diff-hunk-next] 1) ((error)) #2=#:G97270 (byte-code "\300 \210`\207" [diff-hunk-next] 1) ((error)) #3=#:G97271 (byte-code "\300 \210`\207" [diff-file-next] 1) ((error)) diff-file-kill diff-end-of-hunk kill-region] 6 (#$ . 11362) nil]) #@28 Kill current file's hunks. (defalias 'diff-file-kill #[nil "\303 \210`\212\304\305\306\217)\212\307\310 \311#)\211\203\n\312 \210\313`\"+\207" [start prevhunk index diff-beginning-of-file #1=#:G97272 (byte-code "\300 \210`\207" [diff-hunk-prev] 1) ((error)) re-search-backward "^Index: " t diff-end-of-file kill-region] 5 (#$ . 11939) nil]) #@28 Kill spurious empty diffs. (defalias 'diff-kill-junk #[nil "\212\302eb\210\303\304\305\306 \307\260\310\302#\205*\311\225\203\312\224\202 \313\225\314\224|\210\315 \210\202*\207" [inhibit-read-only diff-file-header-re t re-search-forward "^\\(Index: .*\n\\)" "\\([^-+!* <>].*\n\\)*?" "\\(\\(Index:\\) \\|" "\\)" nil 4 0 1 3 beginning-of-line] 6 (#$ . 12293) nil]) (defalias 'diff-count-matches #[(re start end) "\212\304 b\210\305\n \306#\203T\202*\207" [n start re end 0 re-search-forward t] 4]) #@64 Split the current (unified diff) hunk at point into two hunks. (defalias 'diff-split-hunk #[nil "\306 \210`\307 \210`\310\311!\204\312\313!\210\314y\210\315\316\314!!\315\316\317!!\n\320\321` #\\ \320\322` #\\ b\210\323\324\f!\325\324 !\326\261\210\327 \".\207" [start pos start1 start2 newstart1 newstart2 beginning-of-line diff-beginning-of-hunk looking-at "@@ -\\([0-9]+\\),[0-9]+ \\+\\([0-9]+\\),[0-9]+ @@" error "diff-split-hunk only works on unified context diffs" 1 string-to-number match-string 2 diff-count-matches "^[- ]" "^[+ ]" "@@ -" number-to-string ",1 +" ",1 @@\n" diff-fixup-modifs] 5 (#$ . 12812) nil]) (byte-code "\301B\302\301!\204\f\303\303\207" [current-load-list diff-remembered-files-alist boundp nil] 2) (defalias 'diff-filename-drop-dir #[(file) "\301\302\"\205\f\303\225\304O\207" [file string-match "/" 0 nil] 3]) #@355 Merge the diff between ANCESTOR and FROM into TO. Returns the merged string if successful or nil otherwise. The strings are assumed not to contain any "\n" (i.e. end of line). If ANCESTOR = FROM, returns TO. If ANCESTOR = TO, returns FROM. The heuristic is simplistic and only really works for cases like (diff-merge-strings "b/foo" "b/bar" "/a/c/foo"). (defalias 'diff-merge-strings #[(ancestor from to) "\304 \304\n\260\305\306 \"\205)\n\307\310 \"\232\205) \310\224\311\224O\307\312 \" \311\225\310\225OQ)\207" [ancestor from to str "\n" string-match "\\`\\(.*?\\)\\(.*\\)\\(.*\\)\n\\1\\(.*\\)\\3\n\\(.*\\(\\2\\).*\\)\\'" match-string 5 6 4] 5 (#$ . 13681)]) #@98 Return the file corresponding to the current patch. Non-nil OLD means that we want the old file. (defalias 'diff-find-file-name #[(&optional old) "\212\306!\204\307\310\311\217\204\312\313\314#\210\212\313\315\316\217)\306\317!\203?\n\203+\320\321!\202.\320\322!\n\2038\320\322!\202;\320\321!D\202C\321y\210\313\323\212\324\325 \314#)\205S\320\321!C \324\326\313\314#\205w\n\203f\320\327!\202i\320\330!\n\203s\320\330!\202v\320\327!D#\331\313\f\"\332\f \"A\206\333\334\215\206\f(\313)(\203\320(\211(@\211)\203\267\335)!\204\267(A\211(@\211)\204\243)*\211)\204\320\331\313\336\337(\"\"(\313)\202\222)*\206\340\341*\206\336\342\"\203\367*\343\211\224O)\335)!\205\363))\206\344\345\346\f@\206\342\"\313\f@\314\f@%)\347\305!\f)B BL\210))-\207" [diff-file-header-re limit old header-files fs diff-remembered-files-alist looking-at #1=#:G97274 (diff-beginning-of-file) ((error)) re-search-forward nil t (byte-code "\300 \210`\207" [diff-hunk-prev] 1) ((error (point-min))) "[-*][-*][-*] \\(\\S-+\\)\\(\\s-.*\\)?\n[-+][-+][-+] \\(\\S-+\\)" match-string 1 3 append re-search-backward "^Index: \\(.+\\)" "^diff \\(-\\S-+ +\\)*\\(\\S-+\\)\\( +\\(\\S-+\\)\\)?" 2 4 delq assoc --cl-block-nil-- (byte-code "\306\211\203/\n@\307 \211@@)\f@ A#\211\203'\310 !\203'\311\312 \"\210)\nA\211\204*\306\207" [diff-remembered-files-alist rf #2=#:--dolist-temp--97273 x fs newfile nil diff-merge-strings file-exists-p throw --cl-block-nil--] 5) file-exists-p mapcar diff-filename-drop-dir string-match "\\.rej\\'" "" 0 read-file-name format "Use file %s: " make-local-variable files file buffer-file-name] 7 (#$ . 14354)]) #@55 Run `diff-goto-source' for the diff at a mouse click. (defalias 'diff-mouse-goto-source #[(event) "\212\301!\210\302 )\207" [event mouse-set-point diff-goto-source] 2 (#$ . 16036) "e"]) #@48 Call `ediff-patch-file' on the current buffer. (defalias 'diff-ediff-patch #[nil "\300\301\302\217\207" [err (byte-code "\300\301p\"\207" [ediff-patch-file nil] 3) ((wrong-number-of-arguments (ediff-patch-file)))] 3 (#$ . 16229) nil]) #@146 Convert unified diffs to context diffs. START and END are either taken from the region (if a prefix arg is given) or else cover the whole bufer. (defalias 'diff-unified->context #[(start end) "\306!\204\n\307!\310\212\nb\210\311\312\313\310#\205\274`W\205\274\314\216\310\315\224\203:\316\317\310\211\313\320%\210\316\321\310\211\313\315%\210\202\270\322\323!\322\324!\322\325!\322\326!./\316\327/\330\331\332/!\332.!\\\333\\!\334\260!\210\335y\210\214`\336\337!\210`}\210\340 0eb\210\212\311\341\313\310#)\204\207`d|\210\202db\210\313\21112`1\333y\342U\203\313f\343=\203\255\344c\210\3132\333u\210\202\220\313f\345=\203\277`1|\210\3102\202\220\313f\346=\203\3412\204\324\335u\210\344c\210\202\333\347\335!\210\350c\210\351u\210\202\220\313f\352=\203\377\212\333y\210\313f\345U)\203\220`1|\210\3102\202\220\3132\202\220*db\210\212\353 \330\331\332 !\332\f!\\\333\\!\3540\261\210)\335y\210\212\311\355\313\310#)\2043`d|\210\202\266\313\21132m\204\265\313f\343=\203P\344c\210\3132\333u\210\202\236\313f\346=\203`\3103\3102\202\236\313f\345=\203\2022\204u\335u\210\344c\210\202|\347\335!\210\350c\210\351u\210\202\236\313f\352=\203\233\212\335y\210m)\204\236\3103\3102\202\236\3132`1\335y\2103\203\2611`|\210\3133)\2029*.*\202*\207" [end inhibit-read-only start combine-after-change-calls lines2 line2 markerp copy-marker t re-search-forward "^\\(\\(---\\) .+\n\\(\\+\\+\\+\\) .+\\|@@ -\\([0-9]+\\),\\([0-9]+\\) \\+\\([0-9]+\\),\\([0-9]+\\) @@.*\\)$" nil ((combine-after-change-execute)) 2 replace-match "---" 3 "***" match-string 4 5 6 7 "***************\n*** " "," number-to-string string-to-number -1 " ****" 1 diff-end-of-hunk unified buffer-string "^-" 0 32 " " 43 45 delete-char "! " -2 92 "--- " " ----\n" "^+" lines1 line1 hunk last-pt modif delete] 8 (#$ . 16471) (byte-code "\203 \301 `D\207edD\207" [current-prefix-arg mark] 2)]) #@146 Convert context diffs to unified diffs. START and END are either taken from the region (if a prefix arg is given) or else cover the whole bufer. (defalias 'diff-context->unified #[(start end) "\306!\204\n\307!\310\212\nb\210\311\312\313\310#\205I`W\205I\314\216\310\315\224\203:\316\317\310\211\313\320%\210\316\321\310\211\313\315%\210\202E\322\323!\322\324!\325\224.\316\326!\210\311\327\313\310#\204V\330\331!\210\322\332!\322\315!\333 \210`\332y\210`|\210\334 /01\fb\210\332y\210`/W\203\366\313f\335>\203\217\336\315!\210\337c\210\332y\210\202t\313f\340=\203\360\212/b\210\332y\210`)2/f\2113\341>\203\301\342/\315\\2{/2|\210\261\210\202\3543\340=\203\330/2|\210\336\332!\210\332y\210\202\3543\343=\203\345\332y\210\202\354\336\332!\210\332y\210*\202t\332y\210\202t\344\345!\203\313f\346U\204 \332u\210\202\336\332!\210\342c\210\336\332!\210\332y\210\202\366\212\fb\210\347.\350\351\352 !\352.!Z\353Z!\3541\350\351\3520!\3521!Z\353Z!\355\261 \210.*\202*\207" [end inhibit-read-only start combine-after-change-calls pt1 line1e markerp copy-marker t re-search-forward "^\\(\\(\\*\\*\\*\\) .+\n\\(---\\) .+\\|\\*\\{15\\}.*\n\\*\\*\\* \\([0-9]+\\),\\(-?[0-9]+\\) \\*\\*\\*\\*\\)$" nil ((combine-after-change-execute)) 2 replace-match "+++" 3 "---" match-string 4 5 0 "" "^--- \\([0-9]+\\),\\(-?[0-9]+\\) ----$" error "Can't find matching `--- n1,n2 ----' line" 1 beginning-of-line point-marker (33 45) delete-char "-" 32 (33 43) "+" 92 looking-at "[+! ] " 33 "@@ -" "," number-to-string string-to-number -1 " +" " @@" line1s pt2 line2e line2s endline2 c] 12 (#$ . 18399) (byte-code "\203 \301 `D\207edD\207" [current-prefix-arg mark] 2)]) #@142 Reverse the direction of the diffs. START and END are either taken from the region (if a prefix arg is given) or else cover the whole bufer. (defalias 'diff-reverse-direction #[(start end) "\306!\204\n\307!\310\212\nb\210\311\312\313\310#\205a`W\205a\314\216\310\315\224\203/\316\317\313\"\210\202]\320\224\203\314\320\224\321\320!\316\322\313\211\211\320%\210\323y\210`$\324\325!\203c\313f\326U\203]\327\323!\210\330c\210\323y\210\202I\331$`\"%\324\332!\204x%c\210\333\334!\210\321\323!&\316\f\313\211\211\323%\210\323y\210`'\324\335!\203\245\313f\336U\203\237\327\323!\210\337c\210\323y\210\202\213\331'`\"(%\206\262\322c\210$b\210(\206\276\322c\210* b\210&c\210-\202]\340\224\203]\316\341\313\"\210\323y\210\313f\313\211)*+\313f\211+\211,\326=\203*\206\366`*\327\323!\210\330c\210\310\202R,\336=\203)\206`)\327\323!\210\337c\210\310\202R,\342>\203(\310\202R*\203H)\203H*)W\203H\212\331*)\")\211-c\210)\313*\313)+\343\232)\203\\\323y\210\202\343+*\202*\207" [end inhibit-read-only start combine-after-change-calls lines1 pt-lines1 markerp copy-marker t re-search-forward "^\\(\\([-*][-*][-*] \\)\\(.+\\)\n\\([-+][-+][-+] \\)\\(.+\\)\\|\\*\\{15\\}.*\n\\*\\*\\* \\(.+\\) \\*\\*\\*\\*\\|@@ -\\([0-9,]+\\) \\+\\([0-9,]+\\) @@.*\\)$" nil ((combine-after-change-execute)) 2 replace-match "\\2\\5\n\\4\\3" 6 match-string "" 1 looking-at "[-! \\][ ]\\|#" 45 delete-char "+" delete-and-extract-region "^--- \\([0-9]+,-?[0-9]+\\) ----$" error "Can't find matching `--- n1,n2 ----' line" "[!+ \\][ ]\\|#" 43 "-" 7 "@@ -\\8 +\\7 @@" (92 35) 32 half1s half1 str1 half2s half2 last first c #1=#:G97275 str] 7 (#$ . 20104) (byte-code "\203 \301 `D\207edD\207" [current-prefix-arg mark] 2)]) #@164 Fixup the hunk headers (in case the buffer was modified). START and END are either taken from the region (if a prefix arg is given) or else cover the whole bufer. (defalias 'diff-fixup-modifs #[(start end) "\306\212 b\210\307 \210\310\211\211\211\311y\310U\2055`X\2055\312\313!\204k\314f\315=\2032 T\202\314f\316=\203? T\202\314f\317=\203L\fT\202\314f\320=\203Y\nT\202\314f\321>\204\310\310\310\310\202\312\322!\203\256\323\324!\323\325! \326 \f\\!!\326 \\!\211\" \230\204\231\327\"\306\211\314\325%\210!\230\204\252\327!\306\211\314\324%\210,\202*\312\330!\203\354 \n\\ \\\310V\203*\323\324!\323\325! \326 \n\\ \\\331!\\\311\\!\211# \230\204\350\327#\306\211\314\325%\210+\202*\312\332!\203* \n\\\f\\\310V\203*\323\324!$\333\334\326$G!\335Q \n\\\f\\\331$!\\\311\\\"\211#$\230\204)\327#\306\211\314\325%\210*\310\310\310\310\202.\207" [inhibit-read-only end bang space minus plus t diff-end-of-hunk 0 -1 looking-at "\\(@@ -[0-9,]+ \\+[0-9,]+ @@.*\\|[-*][-*][-*] .+ [-*][-*][-*][-*]\\)$" nil 32 43 45 33 (92 35) "@@ -[0-9]+,\\([0-9]*\\) \\+[0-9]+,\\([0-9]*\\) @@.*$" match-string 1 2 number-to-string replace-match "--- \\([0-9]+\\),\\([0-9]*\\) ----$" string-to-number "\\*\\*\\* \\([0-9]+\\),\\(-?[0-9]*\\) \\*\\*\\*\\*$" format "%0" "d" start old1 old2 new1 new2 new old] 7 (#$ . 21869) (byte-code "\203 \301 `D\207edD\207" [current-prefix-arg mark] 2)]) #@34 Fixup hunk headers if necessary. (defalias 'diff-write-contents-hooks #[nil "\300 \203\n\301ed\"\210\302\207" [buffer-modified-p diff-fixup-modifs nil] 3 (#$ . 23312)]) (byte-code "\301B\302\301!\204\f\303\303\207" [current-load-list diff-unhandled-changes boundp nil] 2) #@102 Remember to fixup the hunk header. See `after-change-functions' for the meaning of BEG, END and LEN. (defalias 'diff-after-change-function #[(beg end len) "?\205 ?\205\n\203 \n@^ \nA]B\211\207 \fB\211\207" [undo-in-progress inhibit-read-only diff-unhandled-changes beg end] 3 (#$ . 23596)]) #@34 Fixup hunk headers if necessary. (defalias 'diff-post-command-hook #[nil ":\205 \301\302\303\217\210\304\211\207" [diff-unhandled-changes #1=#:G97276 (byte-code "\212@b\210\302\303\304\217\204@b\210\305 A\"\210\306 \210\307`A\"\210)\302\207" [diff-unhandled-changes diff-hunk-header-re #2=#:G97277 (byte-code "\301 \210\212\302 \210`@V)\207" [diff-unhandled-changes diff-beginning-of-hunk diff-end-of-hunk] 2) ((error)) re-search-forward diff-beginning-of-hunk diff-fixup-modifs] 3) ((error)) nil] 3 (#$ . 23902)]) (byte-code "\301B\303\301!\204 \304 \302B\303\302!\204\305\306\307\"\310B\311\310\307\"\210\312\313\314\315#\207" [current-load-list diff-mode-map diff-mode-syntax-table boundp make-sparse-keymap make-char-table syntax-table nil diff-mode-abbrev-table define-abbrev-table put diff-mode derived-mode-parent fundamental-mode] 4) #@293 Major mode for viewing/editing context diffs. Supports unified and context diffs as well as (to a lesser extent) normal diffs. When the buffer is read-only, the ESC prefix is not necessary. This mode runs the hook `diff-mode-hook', as the final step during initialization. \{diff-mode-map} (defalias 'diff-mode #[nil "\306 \210\306\307N\203\310\311\307\312#\210\311\313\314\n!\204\315\n\316 \"\210\317 !\211\203.\f\320 =\2034\321 \322 \"\210) \203>\323\324 \"\210\325\n!\210\326 !\210.\327\330!/L\210\327\331!0L\210\327\332!1L\210deV\203m2\203m\333\312!\2103\204z\334\335\336\"\210\202\214\327\337!\210\334\340\341\342\312$\210\334\343\344\342\312$\210\345\327\346!\3474B\"\210\327\350!\351L\210\327\352!\353L\210\354\355!\207" [major-mode mode-name diff-mode-map diff-mode-syntax-table parent local-abbrev-table fundamental-mode special put diff-mode t "Diff" keymap-parent set-keymap-parent current-local-map char-table-parent standard-syntax-table set-char-table-parent syntax-table mapatoms #[(symbol) "\302\303! \"\206\304 \303!JK$\207" [symbol diff-mode-abbrev-table intern-soft symbol-name define-abbrev] 5] use-local-map set-syntax-table make-local-variable font-lock-defaults outline-regexp imenu-generic-expression toggle-read-only add-hook write-contents-hooks diff-write-contents-hooks diff-unhandled-changes after-change-functions diff-after-change-function nil post-command-hook diff-post-command-hook add-to-list minor-mode-overriding-map-alist buffer-read-only add-log-current-defun-function diff-current-defun add-log-buffer-file-name-function diff-find-file-name run-hooks diff-mode-hook diff-mode-abbrev-table diff-font-lock-defaults diff-outline-regexp diff-imenu-generic-expression diff-default-read-only diff-update-on-the-fly diff-mode-shared-map] 6 (#$ . 24772) nil]) #@99 Non-nil if Diff minor mode is enabled. Use the command `diff-minor-mode' to change this variable. (defvar diff-minor-mode nil (#$ . 26600)) (make-variable-buffer-local 'diff-minor-mode) #@70 Minor mode for viewing/editing context diffs. \{diff-minor-mode-map} (defalias 'diff-minor-mode #[(&optional arg) "\203\f\303!\304V\202 ?\n\204\305\306\307\"\210\202-\310\311!\210\305\312\313\314\315$\210\305\316\317\314\315$\210\320\321 \2037\322\2028\323\"\210t\203K\324\325 \203H\326\202I\327\"\210\330 \210 \207" [arg diff-minor-mode diff-update-on-the-fly prefix-numeric-value 0 add-hook write-contents-hooks diff-write-contents-hooks make-local-variable diff-unhandled-changes after-change-functions diff-after-change-function nil t post-command-hook diff-post-command-hook run-hooks diff-minor-mode-hook diff-minor-mode-on-hook diff-minor-mode-off-hook message "Diff minor mode %sabled" "en" "dis" force-mode-line-update] 5 (#$ . 26792) nil]) #@52 Hook run at the end of function `diff-minor-mode'. (custom-declare-variable 'diff-minor-mode-hook 'nil '(#$ . 27562) :group 'diff-minor :type 'hook) (byte-code "\300\301\302\303\304!\205 \304J#\207" [add-minor-mode diff-minor-mode #(" Diff" 0 5 (local-map (keymap (header-line keymap (down-mouse-3 . mode-line-mode-menu-1)) (mode-line keymap (down-mouse-3 . mode-line-mode-menu-1))) help-echo "mouse-3: minor mode menu")) boundp diff-minor-mode-map] 5) #@133 Jump to the next "complex" hunk. "Complex" is approximated by "the hunk changes the number of lines". Only works for unified diffs. (defalias 'diff-next-complex-hunk #[nil "\300\301\302\303#\205\304\305!\304\306!\232\205\202\207" [re-search-forward "^@@ [-0-9]+,\\([0-9]+\\) [+0-9]+,\\([0-9]+\\) @@" nil t match-string 1 2] 4 (#$ . 28023) nil]) #@318 Return the literal source text from HUNK. if DESTP is nil return the source, otherwise the destination text. If CHAR-OFFSET is non-nil, it should be a char-offset in HUNK, and instead of a string, a cons cell is returned whose car is the appropriate text, and whose cdr is the corresponding char-offset in that text. (defalias 'diff-hunk-text #[(hunk destp &optional char-offset) "\306\307\310!!\311\216rq\210 c\210eb\210\312\211\211\313\314\315!\203,\316\316y\210``\202\210\314\317!\203J\313y\210`\320\321\312\322#\210\323y\210`\316y\210`\202\210\314\324!\203X\316y\210`\202\210\314\325!\203f\316y\210`\202\210\314\326!\203\204\316y\210`\320\327\312\322#\210\323y\210`\316y\210`\202\210\330\331!\210 \203\222\f?\202\224 ?\203\244!\203\240\332\202+\333\202+ \232\203\257\f\202\267\fd\232\203\267 !\203\302e!\\b\210\212 \203\314\f\202\315 \" \203\336 \"V\203\336 d|\210e\"|\210) \203\355\334\202\356\335#eb\210m\204\312f#=\203 `\316y\210`|\210\202\363\336\n!\210\316y\210\202\363*\337ed\"$!\203($`eZB\202*$).\207" [#1=#:temp-buffer hunk num-pfx-chars divider-pos dst-pos src-pos get-buffer-create generate-new-buffer-name " *temp*" ((byte-code "\301!\203\n\302!\210\301\207" [#1# buffer-name kill-buffer] 2)) nil 2 looking-at "^@@" 1 "^\\*\\*" re-search-forward "^--- " t 0 "^[0-9]+a[0-9,]+$" "^[0-9,]+d[0-9]+$" "^[0-9,]+c[0-9,]+$" "^---$" error "Unknown diff hunk type" ("" . 0) "" 45 43 delete-char buffer-substring-no-properties destp char-offset keep kill-char text] 4 (#$ . 28381)]) #@101 Return the buffer position of the nearest occurrence of TEXT. If TEXT isn't found, nil is returned. (defalias 'diff-find-text #[(text) "`\304 \305\306#\205\f\307\224 G\\b\205\310 \305\306#\205\307\224\n\203: \203:\nZ ZV\2036 \202?\n\202? \206?\n+\207" [orig text forw back search-forward nil t 0 search-backward] 4 (#$ . 29947)]) (defalias 'diff-xor #[(a b) "\203 ?\207 \207" [a b] 1]) (put 'diff-xor 'byte-optimizer 'byte-compile-inline-expand) #@50 Find out (BUF LINE-OFFSET POS SRC DST SWITCHED). (defalias 'diff-find-source-location #[(&optional other-file reverse) "\212 \211\203\n?\202\n*`\306 \210`Z`\212\307 \210`){\310 # \310? #!\311\312!\204A\313\314!\202e\f\203K\315\316!\202e\317\225\203V\315\317!\202e\320\321\322\323#\204b\313\324!\210\315\316!\"\325\f!\206p\313\326!#\327#!$\330!\331V\203\202\fr$q\210\332\333\"!!\210`%\334 @!&\322'&\204\252\334!@!&\323'$C&\203\276\335%&\"&D\202\302\322%D\244'\203\321! \323E\202\326 !D\244. \207" [other-file diff-jump-to-old-file b a other char-offset diff-beginning-of-hunk diff-end-of-hunk diff-hunk-text looking-at "\\(?:\\*\\{15\\}.*\n\\)?[-@* ]*\\([0-9,]+\\)\\([ acd+]+\\([0-9,]+\\)\\)?" error "Can't find the hunk header" match-string 1 3 re-search-forward "^--- \\([0-9,]+\\)" nil t "Can't find the hunk separator" diff-find-file-name "Can't find the file" find-file-noselect prefix-numeric-value 8 goto-line string-to-number diff-find-text count-lines hunk reverse old new line file buf orig-pos pos switched] 5 (#$ . 30419)]) (defalias 'diff-hunk-status-msg #[(line-offset reversed dry-run) "\203 \203\f\304\202\305\202 \203\306\202\307\310 \204#\311\2028 \312U\203-\313\2028 \314U\2037\315\2028\316\n #)\207" [dry-run reversed msg line-offset "already applied" "not yet applied" "undone" "applied" message "Hunk text not found" 0 "Hunk %s" 1 "Hunk %s at offset %d line" "Hunk %s at offset %d lines"] 4]) #@375 Apply the current hunk to the source file and go to the next. By default, the new source file is patched, but if the variable `diff-jump-to-old-file' is non-nil, then the old source file is patched instead (some commands, such as `diff-goto-source' can change the value of this variable when given an appropriate prefix argument). With a prefix argument, REVERSE the hunk. (defalias 'diff-apply-hunk #[(&optional reverse) "\306\307\"\211AAAA\203 \211A@\202\310\311\307 GD\" \211A@ \211A@ \211A@ \211A@ \211A@ \203K\310\311\307 G\312\\D\"\210 \204U\313\314!\202\243\203e\315\213\204e\316\317!\202\243r\nq\210\fb\210\320 @G!\210@c\210)\321\322\n!\fA\\\"\210\323 \211\203\226?\202\230*\307#\210\205\243\324 .\207" [reverse #1=#:--rest--97278 buf line-offset pos old diff-find-source-location nil signal wrong-number-of-arguments 6 error "Can't find the text to patch" ((byte-code "\304!\210 \nA\\b\210\305 \203\306\202\307!\207" [buf pos old reverse pop-to-buffer y-or-n-p "Hunk hasn't been applied yet; apply it now? " "Hunk has already been applied; undo it? "] 2)) message "(Nothing done)" delete-char set-window-point display-buffer diff-hunk-status-msg diff-hunk-next new switched b a diff-advance-after-apply-hunk] 6 (#$ . 31921) "P"]) #@103 See whether it's possible to apply the current hunk. With a prefix argument, try to REVERSE the hunk. (defalias 'diff-test-hunk #[(&optional reverse) "\306\307\"\211AAAA\203 \211A@\202\310\311\307 GD\" \211A@ \211A@ \211A@ \211A@ \211A@ \203K\310\311\307 G\312\\D\"\210\313\314\n!\f A\\\"\210\315 \211\203h?\202j*\316#.\207" [reverse #1=#:--rest--97279 buf line-offset pos src diff-find-source-location nil signal wrong-number-of-arguments 6 set-window-point display-buffer diff-hunk-status-msg t dst switched b a] 6 (#$ . 33222) "P"]) #@343 Jump to the corresponding source line. `diff-jump-to-old-file' (or its opposite if the OTHER-FILE prefix arg is given) determines whether to jump to the old or the new file. If the prefix arg is bigger than 8 (for example with \[universal-argument] \[universal-argument]) then `diff-jump-to-old-file' is also set, for the next invocations. (defalias 'diff-goto-source #[(&optional other-file) "\212\306 \210\307\310!)?\311 \"\211AAAA\203\n\211A@\202&\312\313\314\nGD\"\n\211A@\n\211A@\n\211A@\n\211A@\n\211A@\n\203V\312\313\314\nG\315\\D\"\210\316 !\210 A\\b\210\317\f\211\203t?\202v*\320#.\207" [rev other-file #1=#:--rest--97280 buf line-offset pos beginning-of-line looking-at "[-<]" diff-find-source-location signal wrong-number-of-arguments nil 6 pop-to-buffer diff-hunk-status-msg t src dst switched b a] 6 (#$ . 33800) "P"]) #@82 Find the name of function at point. For use in `add-log-current-defun-function'. (defalias 'diff-current-defun #[nil "\306 \211AAAA\203\211A@\202\307\310\311GD\"\211A@\211A@\211A@\211A@\211A@\203H\307\310\311G\312\\D\"\210\212\313 \210\311f\314>\203\206\203\\ \202]\f\315\316\317!!\320\216rq\210@c\210Ab\210r q\210) \210\321 ,\206\223r q\210 \fA\\b\210\321 ).\207" [#1=#:--rest--97281 buf line-offset pos src dst diff-find-source-location signal wrong-number-of-arguments nil 6 beginning-of-line (60 45) get-buffer-create generate-new-buffer-name " *temp*" ((byte-code "\301!\203\n\302!\210\301\207" [#2=#:temp-buffer buffer-name kill-buffer] 2)) add-log-current-defun switched old #2# major-mode] 6 (#$ . 34678)]) (provide 'diff-mode)