From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Helmut Eller Newsgroups: gmane.emacs.devel Subject: Re: help-window-select and info-lookup-symbol Date: Tue, 21 Jul 2009 17:07:25 +0200 Message-ID: References: <4A6439A9.6080406@gmx.at> <4A65C23E.3010801@gmx.at> <4A65CCD6.7060505@gmx.at> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1248189641 20398 80.91.229.12 (21 Jul 2009 15:20:41 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 21 Jul 2009 15:20:41 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Jul 21 17:20:34 2009 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.50) id 1MTH8r-0007AE-PV for ged-emacs-devel@m.gmane.org; Tue, 21 Jul 2009 17:20:34 +0200 Original-Received: from localhost ([127.0.0.1]:57281 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MTH8q-0003M8-Ml for ged-emacs-devel@m.gmane.org; Tue, 21 Jul 2009 11:20:32 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MTGwe-0007MY-6B for emacs-devel@gnu.org; Tue, 21 Jul 2009 11:07:56 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MTGwZ-0007L3-II for emacs-devel@gnu.org; Tue, 21 Jul 2009 11:07:55 -0400 Original-Received: from [199.232.76.173] (port=39965 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MTGwZ-0007Ky-Av for emacs-devel@gnu.org; Tue, 21 Jul 2009 11:07:51 -0400 Original-Received: from main.gmane.org ([80.91.229.2]:60326 helo=ciao.gmane.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1MTGwY-0001nv-AZ for emacs-devel@gnu.org; Tue, 21 Jul 2009 11:07:50 -0400 Original-Received: from list by ciao.gmane.org with local (Exim 4.43) id 1MTGwN-0005rw-3l for emacs-devel@gnu.org; Tue, 21 Jul 2009 15:07:39 +0000 Original-Received: from 212.46.177.79 ([212.46.177.79]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 21 Jul 2009 15:07:39 +0000 Original-Received: from eller.helmut by 212.46.177.79 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 21 Jul 2009 15:07:39 +0000 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 50 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: 212.46.177.79 User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.50 (gnu/linux) Cancel-Lock: sha1:pLcBqT7r2W3keouZJ+QmMNgXIJ0= X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) 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:112915 Archived-At: * martin rudalics [2009-07-21 16:12+0200] writes: >> We do it by walking windows before and after display-buffer. I guess >> that window-config objects also contain the information it's just not >> accessible from Lisp. > > AFAICT they don't have it. It would be very simple to have window.el > provide a global variable that has the necessary information. > `with-help-window' could use it as well. BTW you don't restore > `window-start' and `window-point' when you restore the buffer? Nope. To much work :-). Well, it the most common case the window will just be deleted and it doesn't matter. >> That's the code that stashes the data into the buffer-local variable: >> >> (defun slime-display-popup-buffer (select) >> "Display the current buffer. >> Save the selected-window in a buffer-local variable, so that we >> can restore it later." >> (let ((selected-window (selected-window)) >> (old-windows)) >> (walk-windows (lambda (w) (push (cons w (window-buffer w)) old-windows)) >> nil t) >> (let ((new-window (display-buffer (current-buffer)))) >> (unless slime-popup-restore-data >> (set (make-local-variable 'slime-popup-restore-data) >> (list new-window >> selected-window >> (cdr (find new-window old-windows :key #'car))))) >> (when select >> (select-window new-window)) >> (current-buffer)))) > > Doesn't that fail when you manually switch to a buffer B in such a > window? In that case `slime-popup-restore-data' would remain non-nil > and a later call of `slime-display-popup-buffer' would not save the > value of B. Hmm.. no it wouldn't. I wouldn't call that failing though. One could also argue that if the user switches to B and back that's a temporary excursion and should have no permanent effect. Right or Wrong depends on the users expectations. If the window was freshly created by slime-display-popup-buffer the user might well expect that pressing q will close it. OTOH, some users have strange expectations; they expect the exact opposite from what I would :-) That's why a style-guide would be good: that "adjusts" the expectations. Helmut.