all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* pop-to-buffer behavior
@ 2010-04-21  9:05 Thierry Volpiatto
  2010-04-21 14:23 ` martin rudalics
  0 siblings, 1 reply; 6+ messages in thread
From: Thierry Volpiatto @ 2010-04-21  9:05 UTC (permalink / raw)
  To: emacs-devel

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/






^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2010-04-21 21:08 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-04-21  9:05 pop-to-buffer behavior Thierry Volpiatto
2010-04-21 14:23 ` 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

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.