summaryrefslogtreecommitdiff
path: root/lisp/diff-mode.el
diff options
context:
space:
mode:
authorJuri Linkov <juri@jurta.org>2006-05-09 23:06:14 +0000
committerJuri Linkov <juri@jurta.org>2006-05-09 23:06:14 +0000
commit824565a6a674f7910107c39716b9105317c0fda7 (patch)
tree346f37606798dbbead35325e17d175f702e8e9fb /lisp/diff-mode.el
parentebb99c2aaadd8d87c19af3b060ac1e2cd518a0af (diff)
downloademacs-824565a6a674f7910107c39716b9105317c0fda7.tar.gz
(diff-context->unified): Use `region-beginning' and `region-end'
instead of `mark' and `point'. (diff-unified->context, diff-reverse-direction, diff-fixup-modifs): Operate on region in Transient Mark mode when the mark is active. Use `region-beginning' and `region-end' instead of `mark' and `point'. (diff-hunk-text, diff-goto-source): Doc fix.
Diffstat (limited to 'lisp/diff-mode.el')
-rw-r--r--lisp/diff-mode.el18
1 files changed, 9 insertions, 9 deletions
diff --git a/lisp/diff-mode.el b/lisp/diff-mode.el
index cc89aad6ca3..1a8402e06c4 100644
--- a/lisp/diff-mode.el
+++ b/lisp/diff-mode.el
@@ -633,8 +633,8 @@ Non-nil OLD means that we want the old file."
"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."
- (interactive (if current-prefix-arg
- (list (mark) (point))
+ (interactive (if (or current-prefix-arg (and transient-mark-mode mark-active))
+ (list (region-beginning) (region-end))
(list (point-min) (point-max))))
(unless (markerp end) (setq end (copy-marker end)))
(let (;;(diff-inhibit-after-change t)
@@ -722,7 +722,7 @@ START and END are either taken from the region
\(when it is highlighted) or else cover the whole buffer.
With a prefix argument, convert unified format to context format."
(interactive (if (and transient-mark-mode mark-active)
- (list (mark) (point) current-prefix-arg)
+ (list (region-beginning) (region-end) current-prefix-arg)
(list (point-min) (point-max) current-prefix-arg)))
(if to-context
(diff-unified->context start end)
@@ -795,8 +795,8 @@ With a prefix argument, convert unified format to context format."
"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."
- (interactive (if current-prefix-arg
- (list (mark) (point))
+ (interactive (if (or current-prefix-arg (and transient-mark-mode mark-active))
+ (list (region-beginning) (region-end))
(list (point-min) (point-max))))
(unless (markerp end) (setq end (copy-marker end)))
(let (;;(diff-inhibit-after-change t)
@@ -857,8 +857,8 @@ else cover the whole bufer."
"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."
- (interactive (if current-prefix-arg
- (list (mark) (point))
+ (interactive (if (or current-prefix-arg (and transient-mark-mode mark-active))
+ (list (region-beginning) (region-end))
(list (point-min) (point-max))))
(let ((inhibit-read-only t))
(save-excursion
@@ -1069,7 +1069,7 @@ Only works for unified diffs."
(defun diff-hunk-text (hunk destp char-offset)
"Return the literal source text from HUNK as (TEXT . OFFSET).
-if DESTP is nil TEXT is the source, otherwise the destination text.
+If DESTP is nil, TEXT is the source, otherwise the destination text.
CHAR-OFFSET is a char-offset in HUNK, and OFFSET is the corresponding
char-offset in TEXT."
(with-temp-buffer
@@ -1302,7 +1302,7 @@ With a prefix argument, try to REVERSE the hunk."
`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."
+then `diff-jump-to-old-file' is also set, for the next invocations."
(interactive (list current-prefix-arg last-input-event))
;; When pointing at a removal line, we probably want to jump to
;; the old location, and else to the new (i.e. as if reverting).