Mercurial > emacs
comparison lisp/diff-mode.el @ 90785:8c2ef9d5d4a8
Merge from emacs--devo--0
Patches applied:
* emacs--devo--0 (patch 662-669)
- Update from CVS
- Fix read-only prompt problem in isearch
- Merge from gnus--rel--5.10
* gnus--rel--5.10 (patch 207-208)
- Merge from emacs--devo--0
- Update from CVS
Revision: emacs@sv.gnu.org/emacs--unicode--0--patch-184
author | Miles Bader <miles@gnu.org> |
---|---|
date | Mon, 12 Mar 2007 00:42:43 +0000 |
parents | 52a7f3f50b89 5e29de959ce6 |
children | ca12f314faac |
comparison
equal
deleted
inserted
replaced
90784:5d47178d1a18 | 90785:8c2ef9d5d4a8 |
---|---|
983 | 983 |
984 ;;;###autoload | 984 ;;;###autoload |
985 (define-derived-mode diff-mode fundamental-mode "Diff" | 985 (define-derived-mode diff-mode fundamental-mode "Diff" |
986 "Major mode for viewing/editing context diffs. | 986 "Major mode for viewing/editing context diffs. |
987 Supports unified and context diffs as well as (to a lesser extent) | 987 Supports unified and context diffs as well as (to a lesser extent) |
988 normal diffs. | 988 normal diffs. If you edit the buffer manually, diff-mode will try |
989 to update the hunk headers for you on-the-fly. | |
990 | |
989 When the buffer is read-only, the ESC prefix is not necessary. | 991 When the buffer is read-only, the ESC prefix is not necessary. |
990 If you edit the buffer manually, diff-mode will try to update the hunk | 992 If you edit the buffer manually, diff-mode will try to update the hunk |
991 headers for you on-the-fly. | 993 headers for you on-the-fly. |
992 | 994 |
993 You can also switch between context diff and unified diff with \\[diff-context->unified], | 995 You can also switch between context diff and unified diff with \\[diff-context->unified], |
994 or vice versa with \\[diff-unified->context] and you can also reverse the direction of | 996 or vice versa with \\[diff-unified->context] and you can also reverse the direction of |
995 a diff with \\[diff-reverse-direction]. | 997 a diff with \\[diff-reverse-direction]. |
996 \\{diff-mode-map}" | 998 |
999 When the buffer is read-only, the Meta- modifier is not necessary | |
1000 to run the Diff mode commands: | |
1001 | |
1002 \\{diff-mode-map}" | |
1003 | |
997 (set (make-local-variable 'font-lock-defaults) diff-font-lock-defaults) | 1004 (set (make-local-variable 'font-lock-defaults) diff-font-lock-defaults) |
998 (set (make-local-variable 'outline-regexp) diff-outline-regexp) | 1005 (set (make-local-variable 'outline-regexp) diff-outline-regexp) |
999 (set (make-local-variable 'imenu-generic-expression) | 1006 (set (make-local-variable 'imenu-generic-expression) |
1000 diff-imenu-generic-expression) | 1007 diff-imenu-generic-expression) |
1001 ;; These are not perfect. They would be better done separately for | 1008 ;; These are not perfect. They would be better done separately for |
1366 (not diff-apply-hunk-to-backup-file) | 1373 (not diff-apply-hunk-to-backup-file) |
1367 (not (set (make-local-variable 'diff-apply-hunk-to-backup-file) | 1374 (not (set (make-local-variable 'diff-apply-hunk-to-backup-file) |
1368 (yes-or-no-p (format "Really apply this hunk to %s? " | 1375 (yes-or-no-p (format "Really apply this hunk to %s? " |
1369 (file-name-nondirectory | 1376 (file-name-nondirectory |
1370 buffer-file-name))))))) | 1377 buffer-file-name))))))) |
1371 (error (substitute-command-keys | 1378 (error "%s" |
1379 (substitute-command-keys | |
1372 (format "Use %s\\[diff-apply-hunk] to apply it to the other file" | 1380 (format "Use %s\\[diff-apply-hunk] to apply it to the other file" |
1373 (if (not reverse) "\\[universal-argument] "))))) | 1381 (if (not reverse) "\\[universal-argument] "))))) |
1374 ((and switched | 1382 ((and switched |
1375 ;; A reversed patch was detected, perhaps apply it in reverse. | 1383 ;; A reversed patch was detected, perhaps apply it in reverse. |
1376 (not (save-window-excursion | 1384 (not (save-window-excursion |