From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: martin rudalics Newsgroups: gmane.emacs.bugs Subject: bug#745: pop-to-buffer, frames, and input focus Date: Wed, 20 Aug 2008 22:56:58 +0200 Message-ID: <48AC851A.3020906@gmx.at> References: <48AC2F4A.1000507@gmx.at> Reply-To: martin rudalics , 745@emacsbugs.donarmstrong.com NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1219266479 13654 80.91.229.12 (20 Aug 2008 21:07:59 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 20 Aug 2008 21:07:59 +0000 (UTC) Cc: 745@emacsbugs.donarmstrong.com To: Helmut Eller Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Aug 20 23:08:50 2008 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1KVuvA-0004Ye-6s for geb-bug-gnu-emacs@m.gmane.org; Wed, 20 Aug 2008 23:08:49 +0200 Original-Received: from localhost ([127.0.0.1]:38272 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KVuuB-0004xg-Vj for geb-bug-gnu-emacs@m.gmane.org; Wed, 20 Aug 2008 17:07:48 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KVuu0-0004u1-JQ for bug-gnu-emacs@gnu.org; Wed, 20 Aug 2008 17:07:36 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KVuty-0004tN-4a for bug-gnu-emacs@gnu.org; Wed, 20 Aug 2008 17:07:35 -0400 Original-Received: from [199.232.76.173] (port=39763 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KVutx-0004tK-RT for bug-gnu-emacs@gnu.org; Wed, 20 Aug 2008 17:07:33 -0400 Original-Received: from rzlab.ucr.edu ([138.23.92.77]:54820) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1KVutw-0003jt-Mz for bug-gnu-emacs@gnu.org; Wed, 20 Aug 2008 17:07:33 -0400 Original-Received: from rzlab.ucr.edu (rzlab.ucr.edu [127.0.0.1]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id m7KL7R3Y012789; Wed, 20 Aug 2008 14:07:27 -0700 Original-Received: (from debbugs@localhost) by rzlab.ucr.edu (8.13.8/8.13.8/Submit) id m7KL55Xn011595; Wed, 20 Aug 2008 14:05:05 -0700 X-Loop: don@donarmstrong.com Resent-From: martin rudalics Resent-To: bug-submit-list@donarmstrong.com Resent-CC: Emacs Bugs Resent-Date: Wed, 20 Aug 2008 21:05:05 +0000 Resent-Message-ID: Resent-Sender: don@donarmstrong.com X-Emacs-PR-Message: report 745 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: Original-Received: via spool by 745-submit@emacsbugs.donarmstrong.com id=B745.12192659929207 (code B ref 745); Wed, 20 Aug 2008 21:05:05 +0000 Original-Received: (at 745) by emacsbugs.donarmstrong.com; 20 Aug 2008 20:59:52 +0000 Original-Received: from mail.gmx.net (mail.gmx.net [213.165.64.20]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with SMTP id m7KKxmAR009201 for <745@emacsbugs.donarmstrong.com>; Wed, 20 Aug 2008 13:59:49 -0700 Original-Received: (qmail invoked by alias); 20 Aug 2008 20:59:41 -0000 Original-Received: from 62-47-48-127.adsl.highway.telekom.at (EHLO [62.47.48.127]) [62.47.48.127] by mail.gmx.net (mp068) with SMTP; 20 Aug 2008 22:59:41 +0200 X-Authenticated: #14592706 X-Provags-ID: V01U2FsdGVkX19+sCp2gIJ+iOUvmJ05sFoykN5pjODKaDPKBZ6fwG M5CsGT8aY+yAcW User-Agent: Thunderbird 2.0.0.16 (Windows/20080708) In-Reply-To: X-Y-GMX-Trusted: 0 X-FuHaFi: 0.63 X-detected-kernel: by monty-python.gnu.org: Linux 2.6 (newer, 3) Resent-Date: Wed, 20 Aug 2008 17:07:35 -0400 X-BeenThere: bug-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:19574 Archived-At: > Are you saying, that pop-to-buffer can't be used to select the window, > the frame, and input focus at the same time? If so, when should > pop-to-buffer be used? Aren't that unusual situations when > pop-to-buffer should not also select the input focus? With emacs -Q evaluating (let ((pop-up-frames t) (buffer (get-buffer-create "foo"))) (pop-to-buffer buffer)) here gets me a new frame on top of the previously selected one, the window displaying buffer `foo' is the selected window, and when I now start typing, characters get displayed in that window. What did you expect and what did you get? > If you have any hints or guidelines how be a good buffer/window/frame > citizen in different scenarios, that would be much appreciated. I'm slightly confused because in your earlier scenario you bemoaned the fact that the frame _was_ selected. All I wanted to say that raising a frame, giving it input focus, and _not_ selecting it might be difficult. > I'm not using multiple frames myself, but I'm maintaining a package > called SLIME[*] which is used by a number of people who use frames. I'm > not excited at all about rewriting a dozen or so uses of pop-to-buffer > just to support multiple frames. There are some variables like > display-buffer-reuse-frames and special-display-buffer-names and I hoped > that those variables were supposed to make it easy to support multiple > frames without cluttering the source code. > > [*] http://www.common-lisp.net/project/slime/ I moved `pop-to-buffer' to window.el so you can easier try to play around with it and propose a solution that fits your needs ;-) > The docstring of display-buffer reads > "Make buffer BUFFER-OR-NAME appear in some window but don't select it. ..." > I think it be would less surprising if the input focus would not be switched > to the new frame. You have a point here but it's not up to me to decide that. > If I do > > emacs -Q -nw --eval '(save-window-excursion > (let ((pop-up-frames t)) > (display-buffer (get-buffer-create "foo"))))' > > I end up in the "*scratch*" buffer not in "foo". It would be more > consistent if the X11 version and the tty version would restore the > input focus to the same frame. The tty version is the behavior that I > would expect. When I do (save-window-excursion (let ((pop-up-frames t)) (display-buffer (get-buffer-create "foo")))) in the *scratch* buffer I end up in `foo' - whether this is TRT I don't know. Doing a `save-window-excursion' on the command line is beyond my comprehension. martin