Mercurial > emacs
comparison lisp/diff-mode.el @ 90140:02f1dbc4a199
Revision: miles@gnu.org--gnu-2005/emacs--unicode--0--patch-35
Merge from emacs--cvs-trunk--0
Patches applied:
* emacs--cvs-trunk--0 (patch 228-240)
- Update from CVS
- Merge from gnus--rel--5.10
* gnus--rel--5.10 (patch 53-58)
- Merge from emacs--cvs-trunk--0
- Update from CVS
- Collapse feature addition/removal within single ChangeLog entry
author | Miles Bader <miles@gnu.org> |
---|---|
date | Sat, 09 Apr 2005 02:16:29 +0000 |
parents | ff0e824afa37 5d2796fc9f80 |
children | f042e7c0fe20 |
comparison
equal
deleted
inserted
replaced
90139:e0d294b9b23e | 90140:02f1dbc4a199 |
---|---|
1 ;;; diff-mode.el --- a mode for viewing/editing context diffs | 1 ;;; diff-mode.el --- a mode for viewing/editing context diffs |
2 | 2 |
3 ;; Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004 | 3 ;; Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 |
4 ;; Free Software Foundation, Inc. | 4 ;; Free Software Foundation, Inc. |
5 | 5 |
6 ;; Author: Stefan Monnier <monnier@cs.yale.edu> | 6 ;; Author: Stefan Monnier <monnier@cs.yale.edu> |
7 ;; Keywords: convenience patch diff | 7 ;; Keywords: convenience patch diff |
8 | 8 |
9 ;; This file is part of GNU Emacs. | 9 ;; This file is part of GNU Emacs. |
261 "^[!+- ][ \t]" "^[<>][ \t]") | 261 "^[!+- ][ \t]" "^[<>][ \t]") |
262 "^[ <>!+-]")))) | 262 "^[ <>!+-]")))) |
263 (save-excursion | 263 (save-excursion |
264 (while (re-search-backward re start t) | 264 (while (re-search-backward re start t) |
265 (replace-match "" t t))))))) | 265 (replace-match "" t t))))))) |
266 | 266 |
267 | 267 |
268 (defvar diff-font-lock-keywords | 268 (defvar diff-font-lock-keywords |
269 `(("^\\(@@ -[0-9,]+ \\+[0-9,]+ @@\\)\\(.*\\)$" ;unified | 269 `(("^\\(@@ -[0-9,]+ \\+[0-9,]+ @@\\)\\(.*\\)$" ;unified |
270 (1 diff-hunk-header-face) | 270 (1 diff-hunk-header-face) |
271 (2 diff-function-face)) | 271 (2 diff-function-face)) |
482 (list old (read-file-name (format "File for %s: " (car fs)) | 482 (list old (read-file-name (format "File for %s: " (car fs)) |
483 nil (diff-find-file-name old) t)))) | 483 nil (diff-find-file-name old) t)))) |
484 (let ((fs (diff-hunk-file-names old))) | 484 (let ((fs (diff-hunk-file-names old))) |
485 (unless fs (error "No file name to look for")) | 485 (unless fs (error "No file name to look for")) |
486 (push (cons fs name) diff-remembered-files-alist))) | 486 (push (cons fs name) diff-remembered-files-alist))) |
487 | 487 |
488 (defun diff-hunk-file-names (&optional old) | 488 (defun diff-hunk-file-names (&optional old) |
489 "Give the list of file names textually mentioned for the current hunk." | 489 "Give the list of file names textually mentioned for the current hunk." |
490 (save-excursion | 490 (save-excursion |
491 (unless (looking-at diff-file-header-re) | 491 (unless (looking-at diff-file-header-re) |
492 (or (ignore-errors (diff-beginning-of-file)) | 492 (or (ignore-errors (diff-beginning-of-file)) |
950 | 950 |
951 ;;;###autoload | 951 ;;;###autoload |
952 (define-minor-mode diff-minor-mode | 952 (define-minor-mode diff-minor-mode |
953 "Minor mode for viewing/editing context diffs. | 953 "Minor mode for viewing/editing context diffs. |
954 \\{diff-minor-mode-map}" | 954 \\{diff-minor-mode-map}" |
955 nil " Diff" nil | 955 :group 'diff-mode :lighter " Diff" |
956 ;; FIXME: setup font-lock | 956 ;; FIXME: setup font-lock |
957 ;; setup change hooks | 957 ;; setup change hooks |
958 (if (not diff-update-on-the-fly) | 958 (if (not diff-update-on-the-fly) |
959 (add-hook 'write-contents-functions 'diff-write-contents-hooks nil t) | 959 (add-hook 'write-contents-functions 'diff-write-contents-hooks nil t) |
960 (make-local-variable 'diff-unhandled-changes) | 960 (make-local-variable 'diff-unhandled-changes) |