From: Thierry Volpiatto <thierry.volpiatto@gmail.com>
To: emacs-devel@gnu.org
Subject: pop-to-buffer behavior
Date: Wed, 21 Apr 2010 11:05:41 +0200 [thread overview]
Message-ID: <87vdblb2fu.fsf@tux.homenetwork> (raw)
Hi all,
i have three windows, 2 with the same buffer (foo.el) splitted in two
and one with another buffer say *scratch*.
point is -|-
+---------------+--------------+
| | |
| -|-foo.el | foo.el |
| | |
+---------------+--------------+
| |
| *scratch* |
| |
+------------------------------+
Here the code:(sit-for is just to see point moving)
,----
| (let ((buf (current-buffer)))
| (pop-to-buffer "*scratch*") (sit-for 2) (pop-to-buffer buf))
`----
Ok, that work as expected, point is now again in the left buffer foo.el.
Now put point in the right side foo.el, and eval same code again, point
is now in the left side foo.el buffer.
I would like point come back at original place (right foo.el)
The purpose is to know if a particular buffer is actually visible in
this window:(work fine in most case, but not in this one)
,----
| (defun ioccur-visible-buffer-p (buffer)
| "Can i see this buffer in this window."
| (let ((buf (current-buffer))
| (cur-w-conf (current-window-configuration)))
| (or (eq buf (get-buffer buffer))
| (save-window-excursion
| (pop-to-buffer buffer)
| (pop-to-buffer buf)
| ;; If BUFFER is NOT in same window than BUF
| ;; We should have now another window configuration.
| (compare-window-configurations
| cur-w-conf (current-window-configuration))))))
`----
Any idea?
Thanks.
--
Thierry Volpiatto
Gpg key: http://pgp.mit.edu/
next reply other threads:[~2010-04-21 9:05 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-04-21 9:05 Thierry Volpiatto [this message]
2010-04-21 14:23 ` pop-to-buffer behavior martin rudalics
2010-04-21 18:23 ` Thierry Volpiatto
2010-04-21 18:37 ` Thierry Volpiatto
2010-04-21 20:31 ` martin rudalics
2010-04-21 21:08 ` 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
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87vdblb2fu.fsf@tux.homenetwork \
--to=thierry.volpiatto@gmail.com \
--cc=emacs-devel@gnu.org \
/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 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).