Commit 28408bfd authored by Richard M. Stallman's avatar Richard M. Stallman
Browse files

(diff-mode-shared-map): Don't bind M-W, M-U, M-C,

M-r, M-R, M-A, M-SPC or M-DEL.
(diff-mode-map): diff-refine-hunk now on C-c C-w
(diff-mode-map): Bind C-c C-e, C-c C-n, C-c C-r, C-c C-u.
parent d0789de9
......@@ -118,7 +118,8 @@ when editing big diffs)."
("\C-m" . diff-goto-source)
([mouse-2] . diff-goto-source)
;; From XEmacs' diff-mode.
("W" . widen)
;; Standard M-w is useful, so don't change M-W.
;; ("W" . widen)
;;("." . diff-goto-source) ;display-buffer
;;("f" . diff-goto-source) ;find-file
("o" . diff-goto-source) ;other-window
......@@ -127,14 +128,14 @@ when editing big diffs)."
;;("h" . diff-show-header)
;;("j" . diff-show-difference) ;jump to Nth diff
;;("q" . diff-quit)
(" " . scroll-up)
("\177" . scroll-down)
;; Our very own bindings.
("A" . diff-ediff-patch)
("r" . diff-restrict-view)
("R" . diff-reverse-direction)
("U" . diff-context->unified)
("C" . diff-unified->context)
;; Not useful if you have to metafy them.
;; (" " . scroll-up)
;; ("\177" . scroll-down)
;; Standard M-a is useful, so don't change M-A.
;; ("A" . diff-ediff-patch)
;; Standard M-r is useful, so don't change M-r or M-R.
;; ("r" . diff-restrict-view)
;; ("R" . diff-reverse-direction)
("q" . quit-window))
"Basic keymap for `diff-mode', bound to various prefix keys.")
......@@ -143,10 +144,14 @@ when editing big diffs)."
;; From compilation-minor-mode.
("\C-c\C-c" . diff-goto-source)
;; Misc operations.
("\C-c\C-r" . diff-refine-hunk)
("\C-c\C-s" . diff-split-hunk)
("\C-c\C-a" . diff-apply-hunk)
("\C-c\C-e" . diff-ediff-patch)
("\C-c\C-n" . diff-restrict-view)
("\C-c\C-r" . diff-reverse-direction)
("\C-c\C-s" . diff-split-hunk)
("\C-c\C-t" . diff-test-hunk)
("\C-c\C-u" . diff-context->unified)
("\C-c\C-w" . diff-refine-hunk)
("\C-c\C-f" . next-error-follow-minor-mode))
"Keymap for `diff-mode'. See also `diff-mode-shared-map'.")
......@@ -711,15 +716,18 @@ else cover the whole bufer."
(delete-region last-pt (point))
(setq delete nil)))))))))))))))
(defun diff-context->unified (start end)
(defun diff-context->unified (start end &optional to-context)
"Convert context diffs to unified 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))
(list (point-min) (point-max))))
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 (point-min) (point-max) current-prefix-arg)))
(if to-context
(diff-unified->context start end)
(unless (markerp end) (setq end (copy-marker end)))
(let (;;(diff-inhibit-after-change t)
(let ( ;;(diff-inhibit-after-change t)
(inhibit-read-only t))
(save-excursion
(goto-char start)
......@@ -781,7 +789,7 @@ else cover the whole bufer."
" +" line2s ","
(number-to-string (- (string-to-number line2e)
(string-to-number line2s)
-1)) " @@"))))))))))
-1)) " @@")))))))))))
(defun diff-reverse-direction (start end)
"Reverse the direction of the diffs.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment