unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* 23.0.60; switch-to-buffer-other-window fails to work
@ 2008-06-08  5:37 Michael Welsh Duggan
  2008-06-08  8:30 ` martin rudalics
  0 siblings, 1 reply; 3+ messages in thread
From: Michael Welsh Duggan @ 2008-06-08  5:37 UTC (permalink / raw)
  To: emacs-pretest-bug

Please describe exactly what actions triggered the bug
and the precise symptoms of the bug:

`switch-to-buffer-other-window' no longer uses the "other" window.

Using a new emacs via "emacs -Q":
`C-h i' - Displays the *info* buffer
`C-x 4 b RET' - Displays the *scratch* buffer in a second window
`C-x 4 b RET' - Fails to replace the *info* buffer with the *Messages*
                buffer.  Replaces the *scratch* buffer instead.

In GNU Emacs 23.0.60.9 (i686-pc-linux-gnu, GTK+ Version 2.12.10)
 of 2008-06-08 on maru
Windowing system distributor `The X.Org Foundation', version 11.0.10400090
configured using `configure  '--without-toolkit-scroll-bars''

Important settings:
  value of $LC_ALL: nil
  value of $LC_COLLATE: nil
  value of $LC_CTYPE: nil
  value of $LC_MESSAGES: nil
  value of $LC_MONETARY: nil
  value of $LC_NUMERIC: nil
  value of $LC_TIME: nil
  value of $LANG: en_US.utf8
  value of $XMODIFIERS: nil
  locale-coding-system: utf-8-unix
  default-enable-multibyte-characters: t

Major mode: Group

Minor modes in effect:
  gnus-topic-mode: t
  gnus-undo-mode: t
  display-time-mode: t
  shell-dirtrack-mode: t
  tooltip-mode: t
  mouse-wheel-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  global-auto-composition-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  line-number-mode: t

Recent input:
SPC SPC SPC SPC SPC SPC SPC SPC SPC SPC SPC SPC SPC 
SPC SPC SPC SPC SPC SPC SPC SPC SPC SPC SPC SPC SPC 
SPC SPC SPC SPC SPC SPC SPC SPC SPC SPC SPC SPC SPC 
SPC SPC SPC SPC SPC SPC SPC SPC SPC SPC SPC SPC SPC 
SPC SPC SPC SPC SPC SPC SPC SPC SPC SPC SPC SPC SPC 
SPC SPC SPC SPC SPC SPC SPC SPC SPC SPC SPC SPC SPC 
SPC SPC SPC SPC SPC SPC SPC SPC SPC SPC SPC SPC SPC 
SPC SPC SPC SPC SPC SPC SPC SPC SPC SPC SPC SPC SPC 
SPC SPC SPC SPC SPC SPC SPC SPC SPC SPC SPC SPC SPC 
SPC SPC SPC SPC SPC SPC SPC SPC SPC SPC SPC SPC SPC 
SPC SPC SPC q C-x 1 M-x g n u s <return> C-n <return> 
C-s w i n d o w C-a SPC C-x o C-x o C-x o C-x b * A 
r <tab> <return> C-x o C-x o N SPC SPC SPC SPC SPC 
SPC SPC SPC n n n n n n n n P C-x 1 C-s C-s C-s C-p 
C-a <escape> < C-s o t h e r C-s C-s C-a C-v Q n p 
<return> C-s m e n u C-a C-n C-p C-p C-p C-p C-p C-p 
C-p d d d d d d d d d d d d d d d d d d d d d d d d 
d d d d d d d d d d d d d d d d d d d d d d d d d d 
d d d d d SPC N N N N N SPC N <help-echo> <help-echo> 
<help-echo> q M-x r e p o r <tab> <return>

Recent messages:
Fetching headers for nnimap+localimap:mail.emacs-diffs...
nnimap: Retrieving headers...done
Fetching headers for nnimap+localimap:mail.emacs-diffs...done
Scoring...done
Sorting articles...done
Generating summary...done
Mark saved where search started
nnimap: Setting marks in mail.emacs-diffs...done
Expiring articles...done
Scanning for dabbrevs...100%

-- 
Michael Welsh Duggan
(md5i@cs.cmu.edu)




^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: 23.0.60; switch-to-buffer-other-window fails to work
  2008-06-08  5:37 23.0.60; switch-to-buffer-other-window fails to work Michael Welsh Duggan
@ 2008-06-08  8:30 ` martin rudalics
  2008-06-08 16:55   ` Michael Welsh Duggan
  0 siblings, 1 reply; 3+ messages in thread
From: martin rudalics @ 2008-06-08  8:30 UTC (permalink / raw)
  To: Michael Welsh Duggan; +Cc: emacs-pretest-bug

[-- Attachment #1: Type: text/plain, Size: 615 bytes --]

 > `switch-to-buffer-other-window' no longer uses the "other" window.
 >
 > Using a new emacs via "emacs -Q":
 > `C-h i' - Displays the *info* buffer
 > `C-x 4 b RET' - Displays the *scratch* buffer in a second window
 > `C-x 4 b RET' - Fails to replace the *info* buffer with the *Messages*
 >                 buffer.  Replaces the *scratch* buffer instead.

Thank you very much for the report.  Can you please try whether the
attached patch fixes it?  It incorporates a number of changes unrelated
to the bug you found.  The change needed to fix the bug you found is the
last one in the patch on lines 1011-1018.

[-- Attachment #2: window.el.patch --]
[-- Type: text/plain, Size: 9219 bytes --]

*** window.el.~1.137.~	Fri Jun  6 10:01:10 2008
--- window.el	Sun Jun  8 10:24:30 2008
***************
*** 741,771 ****
    :group 'windows)
  
  (defcustom split-window-preferred-function nil
!   "How `display-buffer' shall split windows.
! Choices are `Vertically', `Horizontally', and `Sensibly' where
! the latter attempts to split wide windows horizontally, narrow
! ones vertically.  Alternatively, you can set this to a function
! called with a window as single argument to split that window in
! two and return the new window."
!   :type '(choice
! 	  (const :tag "Vertically" nil)
! 	  (const :tag "Horizontally" horizontally)
! 	  (const :tag "Sensibly" sensibly)
! 	  (function :tag "Function"))
    :version "23.1"
    :group 'windows)
  
  (defcustom split-height-threshold 80
!   "Minimum height of window to be split vertically by `display-buffer'.
! If there is only one window, it can be split regardless of this."
    :type 'number
    :version "23.1"
    :group 'windows)
  
  (defcustom split-width-threshold 160
!   "Minimum width of window to be split horizontally by `display-buffer'.
! If there is only one window, it can be split regardless of this."
!   :type 'number
    :version "23.1"
    :group 'windows)
  
--- 741,775 ----
    :group 'windows)
  
  (defcustom split-window-preferred-function nil
!   "Function for `display-buffer' to split windows.
! If non-nil a function called with a window as single argument to
! split that window in two and return the new window.  If nil
! `display-buffer' will split the window according to the values of
! `split-height-threshold' and `split-width-threshold'."
!   :type '(choice (const nil) (function :tag "Function"))
    :version "23.1"
    :group 'windows)
  
  (defcustom split-height-threshold 80
!   "Minimum height of window to be split vertically.
! If the value is a number `display-buffer' can split a window only
! if it has at least as many lines.  If the value is nil
! `display-buffer' cannot split the window vertically.  If the
! window is the only window on its frame it can be split regardless
! of this value."
!   :type '(choice (const :tag "inhibit" nil)
! 		 (number :tag "lines"))
    :type 'number
    :version "23.1"
    :group 'windows)
  
  (defcustom split-width-threshold 160
!   "Minimum width of window to be split horizontally.
! If the value is a number `display-buffer' can split a window only
! if it has at least as many columns.  If the value is nil
! `display-buffer' cannot split the window horizontally."
!   :type '(choice (const :tag "inhibit" nil)
! 		 (number :tag "columns"))
    :version "23.1"
    :group 'windows)
  
***************
*** 780,787 ****
  - `window-size-fixed' is either nil or equals `width' for the buffer of
    WINDOW.
  
! - WINDOW is at least as high as `split-height-threshold' or it is
!   the only window on its frame.
  
  - When WINDOW is split evenly, the emanating windows are at least
    `window-min-height' lines tall and can accomodate at least one
--- 784,790 ----
  - `window-size-fixed' is either nil or equals `width' for the buffer of
    WINDOW.
  
! - WINDOW is at least as high as `split-height-threshold'.
  
  - When WINDOW is split evenly, the emanating windows are at least
    `window-min-height' lines tall and can accomodate at least one
***************
*** 805,861 ****
  	  ;; and at least twice as wide as `window-min-width' and 2 (the
  	  ;; latter value is hardcoded).
  	  (and (memq window-size-fixed '(nil height))
  	       (>= (window-width window)
  		   (max split-width-threshold
  			(* 2 (max window-min-width 2)))))
  	;; A window can be split vertically when its height is not
! 	;; fixed, it is at least `split-height-threshold' lines high or
! 	;; the only window on its frame, and it is at least twice as
! 	;; high as `window-min-height' and 2 if it has a modeline or 1.
  	(and (memq window-size-fixed '(nil width))
  	     (>= (window-height window)
! 		 (max (if (one-window-p 'nomini) 0 split-height-threshold)
  		      (* 2 (max window-min-height
  				(if mode-line-format 2 1))))))))))
  
  (defun window--try-to-split-window (window)
    "Split window WINDOW if it is splittable.
! See `split-window-preferred-function' for how WINDOW shall be
! split.  See `window--splittable-p' for how to determine whether a
! window is splittable.  If WINDOW can be split, return the value
! returned by `split-window' or `split-window-preferred-function'."
    (when (and (window-live-p window)
  	     ;; Testing `window-full-width-p' here hardly makes any
  	     ;; sense nowadays.  This can be done more intuitively by
  	     ;; setting up `split-width-threshold' appropriately.
  	     (not (frame-parameter (window-frame window) 'unsplittable)))
!     (or (and (not split-window-preferred-function)
! 	     (window--splittable-p window)
  	     (split-window window))
! 	(and (eq split-window-preferred-function 'horizontally)
! 	     (window--splittable-p window t)
  	     (split-window window nil t))
! 	(and (eq split-window-preferred-function 'sensibly)
! 	     ;; The following naive aspect-ratio test should become
! 	     ;; more sensible.
! 	     (or (and (> (window-width window) (window-height window))
! 		      (window--splittable-p window t)
! 		      (split-window window nil t))
! 		 (and (window--splittable-p window)
! 		      (split-window window))))
  	(and (functionp split-window-preferred-function)
  	     (funcall split-window-preferred-function window)))))
  
  (defun window--frame-usable-p (frame)
    "Return frame FRAME if it can be used to display another buffer."
!   (let ((window (frame-root-window frame)))
!     ;; `frame-root-window' may be an internal window which is considered
!     ;; "dead" by `window-live-p'.  Hence if `window' is not live we
!     ;; implicitly know that `frame' has a visible window we can use.
!     (when (or (not (window-live-p window))
! 	      (and (not (window-minibuffer-p window))
! 		   (not (window-dedicated-p window))))
!       frame)))
  
  (defcustom even-window-heights t
    "If non-nil `display-buffer' will try to even window heights.
--- 808,861 ----
  	  ;; and at least twice as wide as `window-min-width' and 2 (the
  	  ;; latter value is hardcoded).
  	  (and (memq window-size-fixed '(nil height))
+ 	       (numberp split-width-threshold)
  	       (>= (window-width window)
  		   (max split-width-threshold
  			(* 2 (max window-min-width 2)))))
  	;; A window can be split vertically when its height is not
! 	;; fixed, it is at least `split-height-threshold' lines high,
! 	;; and it is at least twice as high as `window-min-height' and 2
! 	;; if it has a modeline or 1.
  	(and (memq window-size-fixed '(nil width))
+ 	     (numberp split-height-threshold)
  	     (>= (window-height window)
! 		 (max split-height-threshold
  		      (* 2 (max window-min-height
  				(if mode-line-format 2 1))))))))))
  
  (defun window--try-to-split-window (window)
    "Split window WINDOW if it is splittable.
! See `window--splittable-p' for how to determine whether a window
! is splittable.  If WINDOW can be split, return the value returned
! by `split-window' or `split-window-preferred-function'."
    (when (and (window-live-p window)
  	     ;; Testing `window-full-width-p' here hardly makes any
  	     ;; sense nowadays.  This can be done more intuitively by
  	     ;; setting up `split-width-threshold' appropriately.
  	     (not (frame-parameter (window-frame window) 'unsplittable)))
!     (or (and (window--splittable-p window)
  	     (split-window window))
! 	(and (window--splittable-p window t)
  	     (split-window window nil t))
! 	(and (with-selected-window window
! 	       (one-window-p 'nomini))
! 	     (let ((split-height-threshold 0))
! 	       (window--splittable-p window)
! 	       (split-window window)))
  	(and (functionp split-window-preferred-function)
  	     (funcall split-window-preferred-function window)))))
  
  (defun window--frame-usable-p (frame)
    "Return frame FRAME if it can be used to display another buffer."
!   (when (framep frame)
!     (let ((window (frame-root-window frame)))
!       ;; `frame-root-window' may be an internal window which is considered
!       ;; "dead" by `window-live-p'.  Hence if `window' is not live we
!       ;; implicitly know that `frame' has a visible window we can use.
!       (when (or (not (window-live-p window))
! 		(and (not (window-minibuffer-p window))
! 		     (not (window-dedicated-p window))))
! 	frame))))
  
  (defcustom even-window-heights t
    "If non-nil `display-buffer' will try to even window heights.
***************
*** 1011,1017 ****
  	   (window--display-buffer-2 buffer window-to-use)))
       ((setq window-to-use
  	    ;; Reuse an existing window.
! 	    (or (get-buffer-window buffer 'visible)
  		(get-largest-window 'visible nil)
  		(get-buffer-window buffer 0)
  		(get-largest-window 0 nil)
--- 1011,1018 ----
  	   (window--display-buffer-2 buffer window-to-use)))
       ((setq window-to-use
  	    ;; Reuse an existing window.
! 	    (or (get-lru-window frame-to-use)
! 		(get-buffer-window buffer 'visible)
  		(get-largest-window 'visible nil)
  		(get-buffer-window buffer 0)
  		(get-largest-window 0 nil)

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: 23.0.60; switch-to-buffer-other-window fails to work
  2008-06-08  8:30 ` martin rudalics
@ 2008-06-08 16:55   ` Michael Welsh Duggan
  0 siblings, 0 replies; 3+ messages in thread
From: Michael Welsh Duggan @ 2008-06-08 16:55 UTC (permalink / raw)
  To: martin rudalics; +Cc: emacs-pretest-bug

martin rudalics <rudalics@gmx.at> writes:

>> `switch-to-buffer-other-window' no longer uses the "other" window.
>>
>> Using a new emacs via "emacs -Q":
>> `C-h i' - Displays the *info* buffer
>> `C-x 4 b RET' - Displays the *scratch* buffer in a second window
>> `C-x 4 b RET' - Fails to replace the *info* buffer with the *Messages*
>>                 buffer.  Replaces the *scratch* buffer instead.
>
> Thank you very much for the report.  Can you please try whether the
> attached patch fixes it?  It incorporates a number of changes unrelated
> to the bug you found.  The change needed to fix the bug you found is the
> last one in the patch on lines 1011-1018.

I had updated from CVS, and as such the patch did not apply properly.
However, it does appear as if those patches (or similar ones) made it
into window.el 1.140, and they do seem to fix the problem.

-- 
Michael Welsh Duggan
(md5i@cs.cmu.edu)




^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2008-06-08 16:55 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-06-08  5:37 23.0.60; switch-to-buffer-other-window fails to work Michael Welsh Duggan
2008-06-08  8:30 ` martin rudalics
2008-06-08 16:55   ` Michael Welsh Duggan

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).