]> git.eshelyaron.com Git - emacs.git/commitdiff
(eshell/diff): Fixed problems that were occurring with Emacs 21's
authorJohn Wiegley <johnw@newartisans.com>
Tue, 24 Apr 2001 06:31:46 +0000 (06:31 +0000)
committerJohn Wiegley <johnw@newartisans.com>
Tue, 24 Apr 2001 06:31:46 +0000 (06:31 +0000)
diff.el/compile.el interaction layer.

lisp/eshell/em-unix.el

index 726fd0eeaf65f8b008fe2da6ed2d7f971f3e88ad..1dfec1e70218616ebbb457e06503bac9c9c4b1cd 100644 (file)
@@ -947,14 +947,20 @@ Show wall-clock time elapsed during execution of COMMAND.")
               (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."