comparison lisp/diff-mode.el @ 35526:b40a6cecc4d5

(diff-mode): Disable preliminary support for `compile'.
author Stefan Monnier <monnier@iro.umontreal.ca>
date Wed, 24 Jan 2001 23:26:40 +0000
parents 352cb95d9f27
children e71362bfa695
comparison
equal deleted inserted replaced
35525:95c2eedea354 35526:b40a6cecc4d5
2 2
3 ;; Copyright (C) 1998, 1999, 2000 Free Software Foundation, Inc. 3 ;; Copyright (C) 1998, 1999, 2000 Free Software Foundation, Inc.
4 4
5 ;; Author: Stefan Monnier <monnier@cs.yale.edu> 5 ;; Author: Stefan Monnier <monnier@cs.yale.edu>
6 ;; Keywords: patch diff 6 ;; Keywords: patch diff
7 ;; Revision: $Id: diff-mode.el,v 1.34 2000/11/12 16:59:52 monnier Exp $ 7 ;; Revision: $Id: diff-mode.el,v 1.35 2000/11/14 18:09:21 fx Exp $
8 8
9 ;; This file is part of GNU Emacs. 9 ;; This file is part of GNU Emacs.
10 10
11 ;; GNU Emacs is free software; you can redistribute it and/or modify 11 ;; GNU Emacs is free software; you can redistribute it and/or modify
12 ;; it under the terms of the GNU General Public License as published by 12 ;; it under the terms of the GNU General Public License as published by
23 ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330, 23 ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
24 ;; Boston, MA 02111-1307, USA. 24 ;; Boston, MA 02111-1307, USA.
25 25
26 ;;; Commentary: 26 ;;; Commentary:
27 27
28 ;; Provides support for font-lock patterns, outline-regexps, navigation 28 ;; Provides support for font-lock, outline, navigation
29 ;; commands, editing and various conversions as well as jumping 29 ;; commands, editing and various conversions as well as jumping
30 ;; to the corresponding source file. 30 ;; to the corresponding source file.
31 31
32 ;; inspired by Pavel Machek's patch-mode.el (<pavel@atrey.karlin.mff.cuni.cz>) 32 ;; inspired by Pavel Machek's patch-mode.el (<pavel@atrey.karlin.mff.cuni.cz>)
33 ;; some efforts were spent to have it somewhat compatible with XEmacs' 33 ;; some efforts were spent to have it somewhat compatible with XEmacs'
43 ;; - Reverse doesn't work with normal diffs. 43 ;; - Reverse doesn't work with normal diffs.
44 44
45 ;; Todo: 45 ;; Todo:
46 46
47 ;; - Improve narrowed-view support. 47 ;; - Improve narrowed-view support.
48 ;; - Improve the `compile' support (?). 48 ;; - re-enable (conditionally) the `compile' support after improving it to use
49 ;; the same code as diff-goto-source.
49 ;; - Support for # comments in context->unified. 50 ;; - Support for # comments in context->unified.
50 ;; - Do a fuzzy search in diff-goto-source. 51 ;; - Do a fuzzy search in diff-goto-source.
51 ;; - Allow diff.el to use diff-mode. 52 ;; - Allow diff.el to use diff-mode.
52 ;; This mostly means ability to jump from half-hunk to half-hunk 53 ;; This mostly means ability to jump from half-hunk to half-hunk
53 ;; in context (and normal) diffs and to jump to the corresponding 54 ;; in context (and normal) diffs and to jump to the corresponding
872 ;; "\\|--- [^\t]+\t")) ; context or unidiff file 873 ;; "\\|--- [^\t]+\t")) ; context or unidiff file
873 ;; ; start (first or second line) 874 ;; ; start (first or second line)
874 ;; (set (make-local-variable 'paragraph-separate) paragraph-start) 875 ;; (set (make-local-variable 'paragraph-separate) paragraph-start)
875 ;; (set (make-local-variable 'page-delimiter) "--- [^\t]+\t") 876 ;; (set (make-local-variable 'page-delimiter) "--- [^\t]+\t")
876 ;; compile support 877 ;; compile support
877 (set (make-local-variable 'compilation-file-regexp-alist) 878
878 diff-file-regexp-alist) 879 ;;;; compile support is not good enough yet. Also it can be annoying
879 (set (make-local-variable 'compilation-error-regexp-alist) 880 ;; and should thus only be enabled conditionally.
880 diff-error-regexp-alist) 881 ;; (set (make-local-variable 'compilation-file-regexp-alist)
881 (when (string-match "\\.rej\\'" (or buffer-file-name "")) 882 ;; diff-file-regexp-alist)
882 (set (make-local-variable 'compilation-current-file) 883 ;; (set (make-local-variable 'compilation-error-regexp-alist)
883 (substring buffer-file-name 0 (match-beginning 0)))) 884 ;; diff-error-regexp-alist)
884 (compilation-shell-minor-mode 1) 885 ;; (when (string-match "\\.rej\\'" (or buffer-file-name ""))
886 ;; (set (make-local-variable 'compilation-current-file)
887 ;; (substring buffer-file-name 0 (match-beginning 0))))
888 ;; (compilation-shell-minor-mode 1)
889
885 ;; setup change hooks 890 ;; setup change hooks
886 (toggle-read-only t) 891 (toggle-read-only t)
887 (if (not diff-update-on-the-fly-flag) 892 (if (not diff-update-on-the-fly-flag)
888 (add-hook 'write-contents-hooks 'diff-write-contents-hooks) 893 (add-hook 'write-contents-hooks 'diff-write-contents-hooks)
889 (make-local-variable 'diff-unhandled-changes) 894 (make-local-variable 'diff-unhandled-changes)
1084 (diff-find-source-location nil reverse) 1089 (diff-find-source-location nil reverse)
1085 (cond 1090 (cond
1086 ((null line-offset) 1091 ((null line-offset)
1087 (error "Can't find the text to patch")) 1092 (error "Can't find the text to patch"))
1088 ((and switched 1093 ((and switched
1089 ;; A reversed patch was detected, perhaps apply it in reverse 1094 ;; A reversed patch was detected, perhaps apply it in reverse.
1090 (not (save-window-excursion 1095 (not (save-window-excursion
1091 (pop-to-buffer buf) 1096 (pop-to-buffer buf)
1092 (goto-char (+ pos (cdr old))) 1097 (goto-char (+ pos (cdr old)))
1093 (y-or-n-p 1098 (y-or-n-p
1094 (if reverse 1099 (if reverse