Re: Carbon: display-buffer can leave wrong frame with input focus

2006-02-09 Thread David Reitter

On 9 Feb 2006, at 08:04, YAMAMOTO Mitsuharu wrote:


 Could you try the following patch that prevents raise-frame from
giving focus to a raised frame that is already visible?  Note that a
newly created or previously iconified frame still gets focus when the
frame is popped up by display-buffer, but this behavior is also
observed with some X11 window managers.


Works as intended. The fact that newly opened frames get the focus  
seems  inconsistent, however. From a user's perspective, the same  
sequence of inputs will not lead to the same results, depending on  
whether the other frame happens to get focus or not. I think it'd be  
better if the newly opened frame never gets focus - even if the  
window manager initially gives it focus. That would implement the  
documentation of display-buffer more closely:  Make buffer appear in  
some window but don't select it.





___
emacs-pretest-bug mailing list
emacs-pretest-bug@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-pretest-bug


Re: Carbon: display-buffer can leave wrong frame with input focus

2006-02-09 Thread YAMAMOTO Mitsuharu
 On Thu, 9 Feb 2006 08:58:10 +, David Reitter [EMAIL PROTECTED] said:

 Works as intended. The fact that newly opened frames get the focus
 seems inconsistent, however. From a user's perspective, the same
 sequence of inputs will not lead to the same results, depending on
 whether the other frame happens to get focus or not. I think it'd be
 better if the newly opened frame never gets focus - even if the
 window manager initially gives it focus. That would implement the
 documentation of display-buffer more closely: Make buffer appear in
 some window but don't select it.

Anyway, that's no longer a Carbon-specific issue.  All X11 window
managers that I regularly use behave like this (i.e., a new frame
created by make-frame will get focus).

At least, you can customize the behavior so as not to change the
focus like this:

  (defun my-special-display-popup-frame (buffer optional args)
(let ((orig-frame (selected-frame)))
  (special-display-popup-frame buffer args)
  (x-focus-frame orig-frame)))

  (setq special-display-function 'my-special-display-popup-frame)

 YAMAMOTO Mitsuharu
[EMAIL PROTECTED]


___
emacs-pretest-bug mailing list
emacs-pretest-bug@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-pretest-bug


Carbon: display-buffer can leave wrong frame with input focus

2006-02-08 Thread David Reitter
The below issue is reproducible in a plain GNU Emacs (Carbon). Note  
that the X11 version is reported to work fine, but not Carbon Emacs.
This might not be considered a bug by some of you (for example  
because the window manager selects the new frame), but I still think  
synchronizing the behavior of the X11 version and the Carbon  
implementation could be advantageous.



Begin forwarded message:


From: Mark Russell [EMAIL PROTECTED]
Date: 9 December 2005 18:48:52 GMT
To: [EMAIL PROTECTED]
Subject: [Aquamacs-bugs] display-buffer can leave wrong frame with  
input focus


display-buffer leaves the wrong frame selected in the following  
situation:


- You have a frame selected

- You call display-buffer on a buffer which is listed in  
special-display-buffer-names

  (and not displayed in the frame you currently have selected)

This creates a new frame to display the buffer (if it is not  
displayed already)
and leaves that frame selected.  Any subsequent input goes to the  
buffer in that frame, but the documentation for display-buffer says  
that it does not select the buffer.


To reproduce the bug, load the following code:

(setq special-display-buffer-names '(*test-buffer*))

(defun test-display-buffer ()
  Test frame focus by visiting a buffer in an unsplittable  
window

  (interactive)
  (display-buffer (get-buffer-create *test-buffer*)))

In one frame say M-x test-display-buffer.  A new frame will appear  
displaying *test-buffer* and the input focus will be left there.   
This also happens in Carbon emacs, but under X11 emacs the new  
frame is created, but the input focus remains in the original  
frame, which I believe is the correct behavior).


I tripped over this using the compile library, where the call of  
display-buffer in compilation-goto-locus causes the input focus to  
alternate between the compilation error messages window and the  
source file window each time you use next-error (I have  
*compilation* listed in special-display-buffer-names).  This  
makes stepping through a stack trace almost unusable for me.  As a  
workaround I replaced the display-buffer call in compilation-goto- 
locus with get-buffer-window, but I think the display-buffer  
behavior is the actual bug.


Mark Russell

In GNU Emacs 22.0.50.1 (powerpc-apple-darwin7.9.0)
 of 2005-12-02 on rodrigues.inf.ed.ac.uk - Aquamacs Distribution 0.9.7
Distributor `Apple Computers', version 10.4.3
configured using `configure '--without-x' '--prefix=/usr/local''

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: nil
  locale-coding-system: iso-latin-1
  default-enable-multibyte-characters: t

Major mode: CPerl

Minor modes in effect:
  smart-frame-positioning-mode: t
  recentf-mode: t
  encoded-kbd-mode: t
  osx-key-mode: t
  show-paren-mode: t
  delete-selection-mode: t
  pc-selection-mode: t
  cua-mode: t
  tooltip-mode: t
  auto-compression-mode: t
  mouse-wheel-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  blink-cursor-mode: t
  unify-8859-on-encoding-mode: t
  utf-translate-cjk-mode: t
  column-number-mode: t
  line-number-mode: t
  transient-mark-mode: t


Recent messages:
Auto-saving...
Mark saved where search started
Quit [2 times]
ad-Orig-error: Moved back before first error
Undo...
Undo!
Undo...
Undo!
Loading browse-url...done
Auto-saving...








___
emacs-pretest-bug mailing list
emacs-pretest-bug@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-pretest-bug