changeset 47846:8e6ed5c1f142

2002-10-12 Michael Kifer <kifer@cs.stonybrook.edu> * ediff-init.el (ediff-frame-char-height): use frame-selected-window. * ediff-util.el (ediff-file-checked-in-p): changed progn with and * ediff-wind.el (ediff-skip-unsuitable-frames): distinguish selected frame from frame of selected window (ediff-frame-has-dedicated-windows): don't select any frames to avoid changing selected windows (ediff-setup-control-frame): make sure auto-rase is properly set for the control frame
author Michael Kifer <kifer@cs.stonybrook.edu>
date Sat, 12 Oct 2002 07:13:59 +0000
parents d29cf71f0e89
children dd601595b35d
files lisp/ChangeLog lisp/ediff-init.el lisp/ediff-util.el lisp/ediff-wind.el
diffstat 4 files changed, 42 insertions(+), 31 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/ChangeLog	Fri Oct 11 17:17:10 2002 +0000
+++ b/lisp/ChangeLog	Sat Oct 12 07:13:59 2002 +0000
@@ -1,3 +1,16 @@
+2002-10-12  Michael Kifer  <kifer@cs.stonybrook.edu>
+	
+	* ediff-init.el (ediff-frame-char-height): use frame-selected-window.
+	
+	* ediff-util.el (ediff-file-checked-in-p): changed progn with and
+	
+	* ediff-wind.el (ediff-skip-unsuitable-frames): distinguish selected
+	frame from frame of selected window
+	(ediff-frame-has-dedicated-windows): don't select any frames to avoid
+	changing selected windows
+	(ediff-setup-control-frame): make sure auto-rase is properly set for
+	the control frame
+	
 2002-10-10  Simon Josefsson  <jas@extundo.com>
 
 	* browse-url.el (browse-url-mozilla): Doc fix.
--- a/lisp/ediff-init.el	Fri Oct 11 17:17:10 2002 +0000
+++ b/lisp/ediff-init.el	Sat Oct 12 07:13:59 2002 +0000
@@ -1550,7 +1550,7 @@
 
 (defsubst ediff-frame-char-height (frame)
   (ediff-cond-compile-for-xemacs-or-emacs 
-   (glyph-height ediff-H-glyph (selected-window frame)) ; xemacs cse
+   (glyph-height ediff-H-glyph (frame-selected-window frame)) ; xemacs case
    (frame-char-height frame) ; emacs case
    )
   )
--- a/lisp/ediff-util.el	Fri Oct 11 17:17:10 2002 +0000
+++ b/lisp/ediff-util.el	Sat Oct 12 07:13:59 2002 +0000
@@ -1137,9 +1137,9 @@
        ;; CVS files are considered not checked in
        (not (memq (vc-backend file) '(nil CVS)))
        (if (fboundp 'vc-state)
-	   (progn
-	     (not (memq (vc-state file) '(edited needs-merge)))
-	     (not (stringp (vc-state file))))
+	   (and
+	    (not (memq (vc-state file) '(edited needs-merge)))
+	    (not (stringp (vc-state file))))
 	 ;; XEmacs has no vc-state
 	 (not (vc-locking-user file)))
        ))
--- a/lisp/ediff-wind.el	Fri Oct 11 17:17:10 2002 +0000
+++ b/lisp/ediff-wind.el	Sat Oct 12 07:13:59 2002 +0000
@@ -157,7 +157,7 @@
    '(scrollbar-width . 0)         ; XEmacs only
    '(menu-bar-lines . 0)          ; Emacs only
    '(tool-bar-lines . 0)          ; Emacs 21+ only
-   ;; don't lower and auto-raise
+   ;; don't lower but auto-raise
    '(auto-lower . nil)
    '(auto-raise . t)
    '(visibility . nil)
@@ -821,7 +821,7 @@
       (setq ediff-window-A wind-A
 	    ediff-window-B wind-B
 	    ediff-window-C wind-C)
-      
+
       (setq frame-A (window-frame ediff-window-A)
 	    designated-minibuffer-frame
 	    (window-frame (minibuffer-window frame-A))))
@@ -840,44 +840,38 @@
 ;; create a new splittable frame if none is found
 (defun ediff-skip-unsuitable-frames (&optional ok-unsplittable)
   (if (ediff-window-display-p)
-      ;;(let (last-window)
-      (let (seen-windows)
-	;; (memq ... seen-windows) has quadratic behavior,
-	;; but (eq ... last-window) runs into an emacs bug where next-window
-	;; gets stuck in a loop if the only frame is the minibuffer.
-	;;
-	;;(while (and (not (eq (selected-window) last-window))
+      (let ((wind-frame (window-frame (selected-window)))
+	     seen-windows)
 	(while (and (not (memq (selected-window) seen-windows))
 		    (or
-		     (ediff-frame-has-dedicated-windows (selected-frame))
-		     (ediff-frame-iconified-p (selected-frame))
+		     (ediff-frame-has-dedicated-windows wind-frame)
+		     (ediff-frame-iconified-p wind-frame)
 		     ;; skip small windows
-		     (< (frame-height (selected-frame))
+		     (< (frame-height wind-frame)
 			(* 3 window-min-height))
 		     (if ok-unsplittable
 			 nil
-		       (ediff-frame-unsplittable-p (selected-frame)))))
-	  ;; remember where started
-	  ;;(or last-window (setq last-window (selected-window)))
+		       (ediff-frame-unsplittable-p wind-frame))))
+	  ;; remember history
 	  (setq seen-windows (cons (selected-window) seen-windows))
 	  ;; try new window
-	  (other-window 1 t))
-	;;(if (eq (selected-window) last-window)
+	  (other-window 1 t)
+	  (setq wind-frame (window-frame (selected-window)))
+	  )
 	(if (memq (selected-window) seen-windows)
-	    ;; fed up, no appropriate frame
-	    (progn
-	      (select-frame (make-frame '((unsplittable)))))))))
+	    ;; fed up, no appropriate frames
+	    (setq wind-frame (make-frame '((unsplittable)))))
+
+	(select-frame wind-frame)
+	)))
 
 (defun ediff-frame-has-dedicated-windows (frame)
-  (let ((cur-fr (selected-frame))
-	ans)
-    (select-frame frame)
+  (let (ans)
     (walk-windows 
      (lambda (wind) (if (window-dedicated-p wind)
 			(setq ans t)))
      'ignore-minibuffer
      frame)
-    (select-frame cur-fr)
     ans))
 
 ;; window is ok, if it is only one window on the frame, not counting the
@@ -961,9 +955,13 @@
 	   (cons 'width fwidth)
 	   (cons 'height fheight))
 	  )
-    (if ediff-use-long-help-message
-	(setq adjusted-parameters
-	      (cons '(auto-raise . nil) adjusted-parameters)))
+
+    ;; adjust autoraise
+    (setq adjusted-parameters
+	  (cons (if ediff-use-long-help-message
+		    '(auto-raise . nil)
+		  '(auto-raise . t))
+		adjusted-parameters))
     
     ;; In XEmacs, buffer menubar needs to be killed before frame parameters
     ;; are changed.