changeset 37441:565e55bc8630

(eshell/diff): Fixed problems that were occurring with Emacs 21's diff.el/compile.el interaction layer.
author John Wiegley <johnw@newartisans.com>
date Tue, 24 Apr 2001 06:31:46 +0000
parents c93600f74ebd
children f4b209194d8c
files lisp/eshell/em-unix.el
diffstat 1 files changed, 14 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/eshell/em-unix.el	Tue Apr 24 03:16:21 2001 +0000
+++ b/lisp/eshell/em-unix.el	Tue Apr 24 06:31:46 2001 +0000
@@ -947,14 +947,20 @@
 	       (throw 'eshell-replace-command
 		      (eshell-parse-command "*diff" orig-args))))
 	  (when (fboundp 'diff-mode)
-	    (diff-mode)
-	    (set (make-local-variable 'eshell-diff-window-config) config)
-	    (local-set-key [?q] 'eshell-diff-quit)
-	    (if (fboundp 'turn-on-font-lock-if-enabled)
-		(turn-on-font-lock-if-enabled))))
-	(other-window 1)
-	(goto-char (point-min))
-	nil))))
+	    (make-local-variable 'compilation-finish-functions)
+	    (add-hook
+	     'compilation-finish-functions
+	     `(lambda (buff msg)
+		(with-current-buffer buff
+		  (diff-mode)
+		  (set (make-local-variable 'eshell-diff-window-config)
+		       ,config)
+		  (local-set-key [?q] 'eshell-diff-quit)
+		  (if (fboundp 'turn-on-font-lock-if-enabled)
+		      (turn-on-font-lock-if-enabled))
+		  (goto-char (point-min))))))
+	  (pop-to-buffer (current-buffer))))))
+  nil)
 
 (defun eshell/locate (&rest args)
   "Alias \"locate\" to call Emacs `locate' function."