diff lisp/ediff-util.el @ 44615:a1448e19a9f8

* viper-ex.el: Patch by Samuel Padgett. Copyright papers received. (viper-ex-print-buf-name): New variable. (viper-ex-print-buf): New variable. (ex-token-alist): Invoke ex-print on ":print" Ex commands. (ex-g-marks): New variable. (ex-print): New function. (ex-print-display-lines): New function. * viper.el (viper-set-hooks): add window-setup-hook, which sets the cursor color. * ediff-util.el (ediff-cleanup-mess): delete ctl window on exit when the window is not in its own frame. (ediff-clone-buffer-for-region-comparison): more robust window arrangement while prompting for regions to compare. (ediff-make-cloned-buffer): use generate-new-buffer-name. (ediff-inferior-compare-regions): deleted unused vars ctl-buf and quit-now.
author Michael Kifer <kifer@cs.stonybrook.edu>
date Tue, 16 Apr 2002 05:49:11 +0000
parents 182881d68883
children 341d8797885c
line wrap: on
line diff
--- a/lisp/ediff-util.el	Tue Apr 16 00:02:55 2002 +0000
+++ b/lisp/ediff-util.el	Tue Apr 16 05:49:11 2002 +0000
@@ -42,6 +42,10 @@
 
 (defvar ediff-after-quit-hook-internal nil)
 
+(and noninteractive
+     (eval-when-compile
+	 (load "reporter" 'noerror)))
+
 (eval-when-compile
   (let ((load-path (cons (expand-file-name ".") load-path)))
     (or (featurep 'ediff-init)
@@ -2554,6 +2558,7 @@
 	 (buff-B ediff-buffer-B)
 	 (buff-C ediff-buffer-C)
 	 (ctl-buf  ediff-control-buffer)
+	 (ctl-wind  (ediff-get-visible-buffer-window ctl-buf))
 	 (ctl-frame ediff-control-frame)
 	 (three-way-job ediff-3way-job)
 	 (main-frame (cond ((window-live-p ediff-window-A) 
@@ -2571,8 +2576,12 @@
     (if (boundp 'ediff-patch-diagnostics)
 	(ediff-kill-buffer-carefully ediff-patch-diagnostics))
 
-    (if (and (ediff-window-display-p) (frame-live-p ctl-frame))
-	(delete-frame ctl-frame))
+    ;; delete control frame or window
+    (cond ((and (ediff-window-display-p) (frame-live-p ctl-frame))
+	   (delete-frame ctl-frame))
+	  ((window-live-p ctl-wind)
+	   (delete-window ctl-wind)))
+
     ;; Hide bottom toolbar.  --marcpa
     (if (not (ediff-multiframe-setup-p))
 	(ediff-kill-bottom-toolbar))
@@ -2603,9 +2612,9 @@
 			       (ediff-get-visible-buffer-window buff-B))
 			   (ediff-buffer-live-p buff-C))
 		      (funcall ediff-split-window-function))
-		  (switch-to-buffer buff-C)
-		  (balance-windows)))
+		  (switch-to-buffer buff-C)))
 	  (error)))
+    (balance-windows)
     (message "")
     ))
 
@@ -3308,28 +3317,32 @@
 ;; idea suggested by Hannu Koivisto <azure@iki.fi>
 (defun ediff-clone-buffer-for-region-comparison (buff region-name)
   (let ((cloned-buff (ediff-make-cloned-buffer buff region-name))
-	(wind (ediff-get-visible-buffer-window buff))
 	(pop-up-windows t)
+	wind
 	other-wind
 	msg-buf)
     (ediff-with-current-buffer cloned-buff
       (setq ediff-temp-indirect-buffer t))
-    (if (window-live-p wind)
-	(set-window-buffer wind cloned-buff))
     (pop-to-buffer cloned-buff)
+    (setq wind (ediff-get-visible-buffer-window cloned-buff))
+    (select-window wind)
+    (delete-other-windows)
+    (split-window-vertically)
+    (ediff-select-lowest-window)
+    (setq other-wind (selected-window))
     (with-temp-buffer
       (erase-buffer)
       (insert
        (format "\n   *******  Mark a region in buffer %s  *******\n"
 	       (buffer-name cloned-buff)))
       (insert
-       (format "\n\t      When done, type %s       Use %s to abort\n    "
-	       (ediff-format-bindings-of 'exit-recursive-edit)
-	       (ediff-format-bindings-of 'abort-recursive-edit)))
+       (ediff-with-current-buffer buff
+	 (format "\n\t      When done, type %s       Use %s to abort\n    "
+		 (ediff-format-bindings-of 'exit-recursive-edit)
+		 (ediff-format-bindings-of 'abort-recursive-edit))))
       (goto-char (point-min))
       (setq msg-buf (current-buffer))
-      (other-window 1)
-      (set-window-buffer (selected-window) msg-buf)
+      (set-window-buffer other-wind msg-buf)
       (shrink-window-if-larger-than-buffer)
       (if (window-live-p wind)
 	  (select-window wind))
@@ -3363,9 +3376,9 @@
 
 (defun ediff-make-cloned-buffer (buff region-name)
   (ediff-make-indirect-buffer
-   buff (concat
-	 (if (stringp buff) buff (buffer-name buff))
-	 region-name (symbol-name (gensym)))))
+   buff (generate-new-buffer-name
+         (concat (if (stringp buff) buff (buffer-name buff)) region-name))
+   ))
 
 
 (defun ediff-make-indirect-buffer (base-buf indirect-buf-name)
@@ -3444,8 +3457,6 @@
   (let ((answer "")
 	(possibilities (list ?A ?B ?C))
 	(zmacs-regions t)
-	(ctl-buf (current-buffer))
-	quit-now
 	use-current-diff-p
 	begA begB endA endB bufA bufB)