all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Thierry Volpiatto <thierry.volpiatto@gmail.com>
To: martin rudalics <rudalics@gmx.at>
Cc: emacs-devel@gnu.org
Subject: Re: question about pop-to-buffer
Date: Sun, 30 Sep 2012 20:37:44 +0200	[thread overview]
Message-ID: <87pq53jr0n.fsf@gmail.com> (raw)
In-Reply-To: <506855EA.4000601@gmx.at> (martin rudalics's message of "Sun, 30 Sep 2012 16:23:38 +0200")

martin rudalics <rudalics@gmx.at> writes:

>> Also, I have noticed that window-right/left can also handle vertical
>> splitting (I.e I was looking for something like window-above/bottom and
>> I discover that window-right/left do this).
>> Maybe that can be documented somewhere?
>
> No, and I probably should have called them window--right and
> window--left, but I faintly recall having called them from somewhere
> outside window.el.  These functions are only useful to avoid writing
>
>   (and window (window-parent window) (window-next-sibling window)))
>
> which is needed for technical reasons because usually the minibuffer
> window is the "sibling" of the frame's root window and the window tree
> functions should not work on the minibuffer window.  Anyone interested
> finds the rationale in the comment preceding `window-right'.
>
> The functions you are interested in are either
>
> `window-next-sibling' and `window-prev-sibling' plus `window-combined-p'
>   where the latter is needed to find out whether any such sibling is
>   horizontally or vertically aligned - an information `window-right' and
>   `window-left' won't give you anyway, or
>
> `window-in-direction'.
>
> If you tell me more precisely how you want to use them, I can provide
> more information.
I want a function that return the window at the left of the selected one
or nil if none.
Same for above, right, below.

If a window is returned I use it, otherwise (nil) I use the selected
one.

Actually I use window-left/right and it works fine, but IIUC, I don't
need the first checking:
(and window (window-parent window) (window-next-sibling window)))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

I can use directly window-next/prev-sibling, right?

-- 
  Thierry
Get my Gnupg key:
gpg --keyserver pgp.mit.edu --recv-keys 59F29997 



  reply	other threads:[~2012-09-30 18:37 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-29 13:10 question about pop-to-buffer Thierry Volpiatto
2012-09-29 19:11 ` martin rudalics
2012-09-29 19:20   ` Thierry Volpiatto
2012-09-30 10:48   ` martin rudalics
2012-09-30 11:03     ` Thierry Volpiatto
2012-09-30 14:23       ` martin rudalics
2012-09-30 18:37         ` Thierry Volpiatto [this message]
2012-10-01 15:48           ` martin rudalics
2012-10-01 16:17             ` Thierry Volpiatto

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87pq53jr0n.fsf@gmail.com \
    --to=thierry.volpiatto@gmail.com \
    --cc=emacs-devel@gnu.org \
    --cc=rudalics@gmx.at \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.