From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Thierry Volpiatto Newsgroups: gmane.emacs.devel Subject: Re: question about pop-to-buffer Date: Sat, 29 Sep 2012 21:20:37 +0200 Organization: Emacs Helm Message-ID: <87y5jsmy9m.fsf@gmail.com> References: <87ipaxnfdy.fsf@gmail.com> <506747EA.3080906@gmx.at> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1348946452 2995 80.91.229.3 (29 Sep 2012 19:20:52 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 29 Sep 2012 19:20:52 +0000 (UTC) Cc: emacs-devel@gnu.org To: martin rudalics Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Sep 29 21:20:57 2012 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1TI2av-0001Jx-CD for ged-emacs-devel@m.gmane.org; Sat, 29 Sep 2012 21:20:57 +0200 Original-Received: from localhost ([::1]:38852 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TI2aq-00075z-2V for ged-emacs-devel@m.gmane.org; Sat, 29 Sep 2012 15:20:52 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:50777) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TI2an-00075t-Io for emacs-devel@gnu.org; Sat, 29 Sep 2012 15:20:50 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TI2al-0003r4-To for emacs-devel@gnu.org; Sat, 29 Sep 2012 15:20:49 -0400 Original-Received: from mail-wi0-f171.google.com ([209.85.212.171]:65352) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TI2al-0003r0-Ia for emacs-devel@gnu.org; Sat, 29 Sep 2012 15:20:47 -0400 Original-Received: by mail-wi0-f171.google.com with SMTP id hj13so923418wib.12 for ; Sat, 29 Sep 2012 12:20:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:organization:references:date:in-reply-to :message-id:user-agent:mime-version:content-type; bh=SFBt81jZyWoMx7X+/dLXFpMCQwQm1fBc2S9NYU4/lM0=; b=G5SLuKFwcjoNdIspZMe/EKc57liAI05ipbx0poMnUnAT6HXgZPSgeafo1wP7LA7UAh X6CBOhZD6F5cB9gJVR9j7dEytkWWINH21lnCKLe4o8mPGOuLHUoH1I/pMZKp5wNStCrX JQJyyaXZVsx+KJiVSsnQFxpgIJmQd5Op+UN7VNpNRS7JiOkrnNQEGGt/kLOtF4y8rdNT 9OkV+hkVhYd0m2Ij0jKjcjrIu+ttJA817nYt0ahqg6NZTiT0Nk/4E76n6T3KtrMW23xo tZMysq+1X54RFHHLeVoM3kPLHBVHPJCHFhvI77qGP8VxAM+CaFQ+QaX+FyTv6Apl5XVJ cWKQ== Original-Received: by 10.216.28.140 with SMTP id g12mr975885wea.59.1348946446592; Sat, 29 Sep 2012 12:20:46 -0700 (PDT) Original-Received: from dell-14z (lbe83-2-78-243-104-167.fbx.proxad.net. [78.243.104.167]) by mx.google.com with ESMTPS id cl8sm6650937wib.10.2012.09.29.12.20.44 (version=TLSv1/SSLv3 cipher=OTHER); Sat, 29 Sep 2012 12:20:45 -0700 (PDT) In-Reply-To: <506747EA.3080906@gmx.at> (martin rudalics's message of "Sat, 29 Sep 2012 21:11:38 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.2.50 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 209.85.212.171 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:153714 Archived-At: martin rudalics writes: >> how can I set pop-to-buffer action arg to create the new window on top >> and not on bottom of current window and split the windows equally. > > Side windows serve a different purpose and don't care about the selected > window. Moreover you can't set their heights and widths individually: > All side windows on the left or right get the same width once set, all > side windows on the top or bottom have the same height. And you > currently can't set the size of the first window at some side because > there's a bug in `display-buffer-in-major-side-window' :-( > > So in `display-buffer-in-major-side-window' you have to replace > > (size (or (assq 'size alist) > > by > > (size (or (cdr (assq 'size alist)) > > and then use for example > > (pop-to-buffer > (get-buffer-create "*toto*") > `(display-buffer-in-side-window . ((side . top) (size . ,(/ (window-total-size (selected-window)) 2)) (slot . 0)))) > > which is clumsy and won't work if a window of that size exists already. > > Interpreting your request literally with "selected" substituting > "current", I suppose the following should do what you want: > > (let ((split-window-preferred-function > #'(lambda (window) (split-window (selected-window) nil 'above)))) > (pop-to-buffer (get-buffer-create "*toto*"))) > >> Also if I have two windows the second one is not reused, a new one is >> created instead. (but maybe is what `display-buffer-in-side-window' for >> ?) > > I suppose you have to customize `window-sides-slots' appropriately. Many thanks to take the time to clarify all this. -- Thierry Get my Gnupg key: gpg --keyserver pgp.mit.edu --recv-keys 59F29997