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: pop-to-buffer behavior Date: Wed, 21 Apr 2010 20:37:09 +0200 Organization: ThierryVolpiatto Message-ID: <87fx2or6sq.fsf@tux.homenetwork> References: <87vdblb2fu.fsf@tux.homenetwork> <4BCF0A52.5090701@gmx.at> <87mxwwr7ex.fsf@tux.homenetwork> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: dough.gmane.org 1271875375 8286 80.91.229.12 (21 Apr 2010 18:42:55 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Wed, 21 Apr 2010 18:42:55 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Apr 21 20:42:54 2010 connect(): No such file or directory Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1O4esu-00064w-Sn for ged-emacs-devel@m.gmane.org; Wed, 21 Apr 2010 20:42:53 +0200 Original-Received: from localhost ([127.0.0.1]:38907 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1O4esu-0004GY-CC for ged-emacs-devel@m.gmane.org; Wed, 21 Apr 2010 14:42:52 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1O4er7-0002BB-Le for emacs-devel@gnu.org; Wed, 21 Apr 2010 14:41:01 -0400 Original-Received: from [140.186.70.92] (port=57583 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1O4er2-00023U-7I for emacs-devel@gnu.org; Wed, 21 Apr 2010 14:41:01 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1O4er0-0001zh-9F for emacs-devel@gnu.org; Wed, 21 Apr 2010 14:40:56 -0400 Original-Received: from lo.gmane.org ([80.91.229.12]:55861) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1O4eqz-0001zN-TF for emacs-devel@gnu.org; Wed, 21 Apr 2010 14:40:54 -0400 Original-Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1O4eqy-0004rT-17 for emacs-devel@gnu.org; Wed, 21 Apr 2010 20:40:52 +0200 Original-Received: from 202.77.197-77.rev.gaoland.net ([77.197.77.202]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 21 Apr 2010 20:40:51 +0200 Original-Received: from thierry.volpiatto by 202.77.197-77.rev.gaoland.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 21 Apr 2010 20:40:51 +0200 X-Injected-Via-Gmane: http://gmane.org/ connect(): No such file or directory Original-Lines: 42 Original-X-Complaints-To: usenet@dough.gmane.org X-Gmane-NNTP-Posting-Host: 202.77.197-77.rev.gaoland.net Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAAElBMVEUHBARgJRFPS0WbMBTC TSG/uJs0yyVHAAAACXBIWXMAAAsSAAALEgHS3X78AAAACXZwQWcAAAAwAAAAMADO7oxXAAABpUlE QVQ4y3VTQXKDMAyUnD7AwvQOhtxj5N4LFh9ow/+/UtlpM0BczWSS0Wola7UBeEb3+3kJ/5p9ZLz3 UI0n0J0Y4K/lh1nG24FhlJOR2LdSKtpV5gfi/Zd+NdaJBbB4D5N0JnfUIVp6obZURkJwS2a8b9uX AkgxA5gCEcknAH1s2z0DPooWmjGKcJR+HNZt+9bm0GtGRycRuZGs98Ffr02vABWGopIAhmXmxnQN BwBXZjgFLHRoqbfeYxCLWqsjLyKhbEHW+A5nEs699Q2O80ALrgHTmUTy6P0MnKyKQpKHpoNWokxs F0D5VegvWmEozyE6nuMiS98mWzlUQ9bW8qYfqOaFtzWlYCqGeIs6HEyl08jkrxUG9MF5ipXpOOpd ZMoXPPVSLWJiiwNNB+eRSyxJZmQKcacikgucnCRiHuJOLmyYJRDPwOqAvY4pA+Wy+VS8G26BAsdb Ph2Hw7ORy/H0IOG0TnaM8Cp0XrFYyU0v2z8AqkifPVbLZ0qo/gsRg60C7p+8Ov9jrUIxFde+jnAq X42hyp/c+ZcnVyUYBarrqZt3+R8450png3cWKgAAACV0RVh0ZGF0ZTpjcmVhdGUAMjAwOC0wNS0z MVQyMjoxNDoyMiswMjowMK3VBDcAAAAldEVYdGRhdGU6bW9kaWZ5ADIwMDctMTAtMjhUMTc6MDg6 NDgrMDE6MDDLdIcLAAAAEXRFWHRqcGVnOmNvbG9yc3BhY2UAMix1VZ8AAAAgdEVYdGpwZWc6c2Ft cGxpbmctZmFjdG9yADJ4MiwxeDEsMXgxSfqmtAAAAABJRU5ErkJggg== User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) Cancel-Lock: sha1:f00iX2RNWdjj7fa9Jn8kVda9yo4= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:123998 Archived-At: Thierry Volpiatto writes: > martin rudalics writes: > >>> 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) >> >> `pop-to-buffer' gives no guarantee which window it selects when the same >> buffer appears in several windows at once. Also, using `pop-to-buffer' >> for checking buffer-window associations is probably a bad idea. >> >> If `buffer' denotes the "particular buffer" and "this window" means the >> selected window why not simply use (eq (window-buffer) buffer) instead? > > No that's doesn't work, i finally end up with this: :-) > > ,---- > | (defun ioccur-visible-buffer-p (buffer) > | "Can i see this buffer in this window." > | (let* ((cur-w-conf (current-window-configuration))) > | (or (eq buf (get-buffer buffer)) > | (save-window-excursion > | (save-selected-window > | (pop-to-buffer buffer)) > | ;; 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)))))) > `---- > > > What i needed is `save-selected-window'. But what i really need is to read more carefully elisp manual: `get-buffer-window' work perfectly. Thank you Stefan ;-) and Martin also. -- Thierry Volpiatto Gpg key: http://pgp.mit.edu/