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
This commit is contained in:
Michael Kifer 2002-10-12 07:13:59 +00:00
parent d6da15ec7b
commit 2e955a8b51
4 changed files with 42 additions and 31 deletions

View file

@ -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> 2002-10-10 Simon Josefsson <jas@extundo.com>
* browse-url.el (browse-url-mozilla): Doc fix. * browse-url.el (browse-url-mozilla): Doc fix.

View file

@ -1550,7 +1550,7 @@ This default should work without changes."
(defsubst ediff-frame-char-height (frame) (defsubst ediff-frame-char-height (frame)
(ediff-cond-compile-for-xemacs-or-emacs (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 (frame-char-height frame) ; emacs case
) )
) )

View file

@ -1137,7 +1137,7 @@ of the current buffer."
;; CVS files are considered not checked in ;; CVS files are considered not checked in
(not (memq (vc-backend file) '(nil CVS))) (not (memq (vc-backend file) '(nil CVS)))
(if (fboundp 'vc-state) (if (fboundp 'vc-state)
(progn (and
(not (memq (vc-state file) '(edited needs-merge))) (not (memq (vc-state file) '(edited needs-merge)))
(not (stringp (vc-state file)))) (not (stringp (vc-state file))))
;; XEmacs has no vc-state ;; XEmacs has no vc-state

View file

@ -157,7 +157,7 @@ In this case, Ediff will use those frames to display these buffers."
'(scrollbar-width . 0) ; XEmacs only '(scrollbar-width . 0) ; XEmacs only
'(menu-bar-lines . 0) ; Emacs only '(menu-bar-lines . 0) ; Emacs only
'(tool-bar-lines . 0) ; Emacs 21+ only '(tool-bar-lines . 0) ; Emacs 21+ only
;; don't lower and auto-raise ;; don't lower but auto-raise
'(auto-lower . nil) '(auto-lower . nil)
'(auto-raise . t) '(auto-raise . t)
'(visibility . nil) '(visibility . nil)
@ -840,44 +840,38 @@ into icons, regardless of the window manager."
;; create a new splittable frame if none is found ;; create a new splittable frame if none is found
(defun ediff-skip-unsuitable-frames (&optional ok-unsplittable) (defun ediff-skip-unsuitable-frames (&optional ok-unsplittable)
(if (ediff-window-display-p) (if (ediff-window-display-p)
;;(let (last-window) (let ((wind-frame (window-frame (selected-window)))
(let (seen-windows) 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))
(while (and (not (memq (selected-window) seen-windows)) (while (and (not (memq (selected-window) seen-windows))
(or (or
(ediff-frame-has-dedicated-windows (selected-frame)) (ediff-frame-has-dedicated-windows wind-frame)
(ediff-frame-iconified-p (selected-frame)) (ediff-frame-iconified-p wind-frame)
;; skip small windows ;; skip small windows
(< (frame-height (selected-frame)) (< (frame-height wind-frame)
(* 3 window-min-height)) (* 3 window-min-height))
(if ok-unsplittable (if ok-unsplittable
nil nil
(ediff-frame-unsplittable-p (selected-frame))))) (ediff-frame-unsplittable-p wind-frame))))
;; remember where started ;; remember history
;;(or last-window (setq last-window (selected-window)))
(setq seen-windows (cons (selected-window) seen-windows)) (setq seen-windows (cons (selected-window) seen-windows))
;; try new window ;; try new window
(other-window 1 t)) (other-window 1 t)
;;(if (eq (selected-window) last-window) (setq wind-frame (window-frame (selected-window)))
)
(if (memq (selected-window) seen-windows) (if (memq (selected-window) seen-windows)
;; fed up, no appropriate frame ;; fed up, no appropriate frames
(progn (setq wind-frame (make-frame '((unsplittable)))))
(select-frame (make-frame '((unsplittable)))))))))
(select-frame wind-frame)
)))
(defun ediff-frame-has-dedicated-windows (frame) (defun ediff-frame-has-dedicated-windows (frame)
(let ((cur-fr (selected-frame)) (let (ans)
ans)
(select-frame frame)
(walk-windows (walk-windows
(lambda (wind) (if (window-dedicated-p wind) (lambda (wind) (if (window-dedicated-p wind)
(setq ans t))) (setq ans t)))
'ignore-minibuffer 'ignore-minibuffer
frame) frame)
(select-frame cur-fr)
ans)) ans))
;; window is ok, if it is only one window on the frame, not counting the ;; window is ok, if it is only one window on the frame, not counting the
@ -961,9 +955,13 @@ into icons, regardless of the window manager."
(cons 'width fwidth) (cons 'width fwidth)
(cons 'height fheight)) (cons 'height fheight))
) )
(if ediff-use-long-help-message
;; adjust autoraise
(setq adjusted-parameters (setq adjusted-parameters
(cons '(auto-raise . nil) 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 ;; In XEmacs, buffer menubar needs to be killed before frame parameters
;; are changed. ;; are changed.