aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Monnier2001-05-21 18:45:05 +0000
committerStefan Monnier2001-05-21 18:45:05 +0000
commite8a1ed310de6f0d7ad270c4a805d1b4f66dfa6ef (patch)
treed5478e2865d3cdfc9c23adb38c7d29cb7aacbc32
parentcb1fa3f52cd352571de47de705ec790e8775880a (diff)
downloademacs-e8a1ed310de6f0d7ad270c4a805d1b4f66dfa6ef.tar.gz
emacs-e8a1ed310de6f0d7ad270c4a805d1b4f66dfa6ef.zip
(diff-jump-to-old-file, diff-update-on-the-fly):
Renamed by removing the silly `-flag' suffix. (diff-mode, diff-minor-mode, diff-find-source-location): Update.
-rw-r--r--lisp/ChangeLog6
-rw-r--r--lisp/diff-mode.el18
2 files changed, 15 insertions, 9 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 8704b779e19..b4bfda9da26 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,9 @@
12001-05-21 Stefan Monnier <monnier@cs.yale.edu>
2
3 * diff-mode.el (diff-jump-to-old-file, diff-update-on-the-fly):
4 Renamed by removing the silly `-flag' suffix.
5 (diff-mode, diff-minor-mode, diff-find-source-location): Update.
6
12001-05-20 Stefan Monnier <monnier@cs.yale.edu> 72001-05-20 Stefan Monnier <monnier@cs.yale.edu>
2 8
3 * replace.el (keep-lines-read-args): Use `copy-marker'. 9 * replace.el (keep-lines-read-args): Use `copy-marker'.
diff --git a/lisp/diff-mode.el b/lisp/diff-mode.el
index f83b5f78d46..f2498532ba6 100644
--- a/lisp/diff-mode.el
+++ b/lisp/diff-mode.el
@@ -69,13 +69,13 @@
69 :group 'tools 69 :group 'tools
70 :group 'diff) 70 :group 'diff)
71 71
72(defcustom diff-jump-to-old-file-flag nil 72(defcustom diff-jump-to-old-file nil
73 "*Non-nil means `diff-goto-source' jumps to the old file. 73 "*Non-nil means `diff-goto-source' jumps to the old file.
74Else, it jumps to the new file." 74Else, it jumps to the new file."
75 :group 'diff-mode 75 :group 'diff-mode
76 :type '(boolean)) 76 :type '(boolean))
77 77
78(defcustom diff-update-on-the-fly-flag t 78(defcustom diff-update-on-the-fly t
79 "*Non-nil means hunk headers are kept up-to-date on-the-fly. 79 "*Non-nil means hunk headers are kept up-to-date on-the-fly.
80When editing a diff file, the line numbers in the hunk headers 80When editing a diff file, the line numbers in the hunk headers
81need to be kept consistent with the actual diff. This can 81need to be kept consistent with the actual diff. This can
@@ -894,7 +894,7 @@ This mode runs `diff-mode-hook'.
894 894
895 ;; setup change hooks 895 ;; setup change hooks
896 (toggle-read-only t) 896 (toggle-read-only t)
897 (if (not diff-update-on-the-fly-flag) 897 (if (not diff-update-on-the-fly)
898 (add-hook 'write-contents-hooks 'diff-write-contents-hooks) 898 (add-hook 'write-contents-hooks 'diff-write-contents-hooks)
899 (make-local-variable 'diff-unhandled-changes) 899 (make-local-variable 'diff-unhandled-changes)
900 (add-hook 'after-change-functions 'diff-after-change-function nil t) 900 (add-hook 'after-change-functions 'diff-after-change-function nil t)
@@ -915,7 +915,7 @@ This mode runs `diff-mode-hook'.
915 nil " Diff" nil 915 nil " Diff" nil
916 ;; FIXME: setup font-lock 916 ;; FIXME: setup font-lock
917 ;; setup change hooks 917 ;; setup change hooks
918 (if (not diff-update-on-the-fly-flag) 918 (if (not diff-update-on-the-fly)
919 (add-hook 'write-contents-hooks 'diff-write-contents-hooks) 919 (add-hook 'write-contents-hooks 'diff-write-contents-hooks)
920 (make-local-variable 'diff-unhandled-changes) 920 (make-local-variable 'diff-unhandled-changes)
921 (add-hook 'after-change-functions 'diff-after-change-function nil t) 921 (add-hook 'after-change-functions 'diff-after-change-function nil t)
@@ -1038,7 +1038,7 @@ If TEXT isn't found, nil is returned."
1038(defun diff-find-source-location (&optional other-file reverse) 1038(defun diff-find-source-location (&optional other-file reverse)
1039 "Find out (BUF LINE-OFFSET POS SRC DST SWITCHED)." 1039 "Find out (BUF LINE-OFFSET POS SRC DST SWITCHED)."
1040 (save-excursion 1040 (save-excursion
1041 (let* ((other (diff-xor other-file diff-jump-to-old-file-flag)) 1041 (let* ((other (diff-xor other-file diff-jump-to-old-file))
1042 (char-offset (- (point) (progn (diff-beginning-of-hunk) (point)))) 1042 (char-offset (- (point) (progn (diff-beginning-of-hunk) (point))))
1043 (hunk (buffer-substring (point) 1043 (hunk (buffer-substring (point)
1044 (save-excursion (diff-end-of-hunk) (point)))) 1044 (save-excursion (diff-end-of-hunk) (point))))
@@ -1056,7 +1056,7 @@ If TEXT isn't found, nil is returned."
1056 (buf (find-file-noselect file))) 1056 (buf (find-file-noselect file)))
1057 ;; Update the user preference if he so wished. 1057 ;; Update the user preference if he so wished.
1058 (when (> (prefix-numeric-value other-file) 8) 1058 (when (> (prefix-numeric-value other-file) 8)
1059 (setq diff-jump-to-old-file-flag other)) 1059 (setq diff-jump-to-old-file other))
1060 (with-current-buffer buf 1060 (with-current-buffer buf
1061 (goto-line (string-to-number line)) 1061 (goto-line (string-to-number line))
1062 (let* ((orig-pos (point)) 1062 (let* ((orig-pos (point))
@@ -1084,7 +1084,7 @@ If TEXT isn't found, nil is returned."
1084(defun diff-apply-hunk (&optional reverse) 1084(defun diff-apply-hunk (&optional reverse)
1085 "Apply the current hunk to the source file and go to the next. 1085 "Apply the current hunk to the source file and go to the next.
1086By default, the new source file is patched, but if the variable 1086By default, the new source file is patched, but if the variable
1087`diff-jump-to-old-file-flag' is non-nil, then the old source file is 1087`diff-jump-to-old-file' is non-nil, then the old source file is
1088patched instead (some commands, such as `diff-goto-source' can change 1088patched instead (some commands, such as `diff-goto-source' can change
1089the value of this variable when given an appropriate prefix argument). 1089the value of this variable when given an appropriate prefix argument).
1090 1090
@@ -1130,10 +1130,10 @@ With a prefix argument, try to REVERSE the hunk."
1130 1130
1131(defun diff-goto-source (&optional other-file) 1131(defun diff-goto-source (&optional other-file)
1132 "Jump to the corresponding source line. 1132 "Jump to the corresponding source line.
1133`diff-jump-to-old-file-flag' (or its opposite if the OTHER-FILE prefix arg 1133`diff-jump-to-old-file' (or its opposite if the OTHER-FILE prefix arg
1134is given) determines whether to jump to the old or the new file. 1134is given) determines whether to jump to the old or the new file.
1135If the prefix arg is bigger than 8 (for example with \\[universal-argument] \\[universal-argument]) 1135If the prefix arg is bigger than 8 (for example with \\[universal-argument] \\[universal-argument])
1136 then `diff-jump-to-old-file-flag' is also set, for the next invocations." 1136 then `diff-jump-to-old-file' is also set, for the next invocations."
1137 (interactive "P") 1137 (interactive "P")
1138 ;; When pointing at a removal line, we probably want to jump to 1138 ;; When pointing at a removal line, we probably want to jump to
1139 ;; the old location, and else to the new (i.e. as if reverting). 1139 ;; the old location, and else to the new (i.e. as if reverting).