summaryrefslogtreecommitdiff
path: root/lisp/diff-mode.el
diff options
context:
space:
mode:
authorMiles Bader <miles@gnu.org>2000-09-12 11:24:28 +0000
committerMiles Bader <miles@gnu.org>2000-09-12 11:24:28 +0000
commit3017133f17acb9be3fd8c644feae4c5794abee06 (patch)
tree2748888387136f2107a1d5e87c21ab30541ea73a /lisp/diff-mode.el
parent6ab70e9a61140b8e020905863a3834713677e4d6 (diff)
downloademacs-3017133f17acb9be3fd8c644feae4c5794abee06.tar.gz
(diff-hunk-text): Use `with-temp-buffer'.
(diff-mode-map): Bind `diff-test-hunk'. (diff-apply-hunk): Use `select-window' instead of `pop-to-buffer'.
Diffstat (limited to 'lisp/diff-mode.el')
-rw-r--r--lisp/diff-mode.el16
1 files changed, 8 insertions, 8 deletions
diff --git a/lisp/diff-mode.el b/lisp/diff-mode.el
index 5e5d4d7e625..f0d52b679a1 100644
--- a/lisp/diff-mode.el
+++ b/lisp/diff-mode.el
@@ -4,7 +4,7 @@
;; Author: Stefan Monnier <monnier@cs.yale.edu>
;; Keywords: patch diff
-;; Revision: $Id: diff-mode.el,v 1.11 2000/09/07 20:14:27 fx Exp $
+;; Revision: $Id: diff-mode.el,v 1.12 2000/09/11 13:49:38 miles Exp $
;; This file is part of GNU Emacs.
@@ -133,7 +133,8 @@ when editing big diffs)."
;; From compilation-minor-mode.
("\C-c\C-c" . diff-goto-source)
;; Misc operations.
- ("\C-cda" . diff-apply-hunk))
+ ("\C-cda" . diff-apply-hunk)
+ ("\C-cdt" . diff-test-hunk))
"Keymap for `diff-mode'. See also `diff-mode-shared-map'.")
(easy-menu-define diff-mode-menu diff-mode-map
@@ -883,7 +884,7 @@ Only works for unified diffs."
(defun diff-hunk-text (hunk dest)
"Returns the literal source text from HUNK, if DEST is nil, otherwise
the destination text."
- (with-current-buffer "foo"
+ (with-temp-buffer
(erase-buffer)
(insert hunk)
(goto-char (point-min))
@@ -1068,11 +1069,10 @@ was non-nil."
(- real-line patch-line)))))
;; Display BUF in a window, and maybe select it
- (cond ((eq popup 'select)
- (pop-to-buffer buf)
- (goto-char pos))
- (t
- (set-window-point (display-buffer buf) pos))))
+ (let ((win (display-buffer buf)))
+ (set-window-point win pos)
+ (when (eq popup 'select)
+ (select-window win))))
;; Return an appropriate indicator of success
(if reversed 'reversed t)))))