From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: martin rudalics Newsgroups: gmane.emacs.devel Subject: Re: help-window-select and info-lookup-symbol Date: Tue, 21 Jul 2009 16:12:38 +0200 Message-ID: <4A65CCD6.7060505@gmx.at> References: <4A6439A9.6080406@gmx.at> <4A65C23E.3010801@gmx.at> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1248185583 5444 80.91.229.12 (21 Jul 2009 14:13:03 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 21 Jul 2009 14:13:03 +0000 (UTC) Cc: emacs-devel@gnu.org To: Helmut Eller Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Jul 21 16:12:56 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 1MTG5N-00026q-2f for ged-emacs-devel@m.gmane.org; Tue, 21 Jul 2009 16:12:53 +0200 Original-Received: from localhost ([127.0.0.1]:56613 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MTG5M-0001rz-4h for ged-emacs-devel@m.gmane.org; Tue, 21 Jul 2009 10:12:52 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MTG5G-0001ns-RL for emacs-devel@gnu.org; Tue, 21 Jul 2009 10:12:46 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MTG5B-0001Xx-IG for emacs-devel@gnu.org; Tue, 21 Jul 2009 10:12:45 -0400 Original-Received: from [199.232.76.173] (port=48912 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MTG5B-0001XN-Bq for emacs-devel@gnu.org; Tue, 21 Jul 2009 10:12:41 -0400 Original-Received: from mail.gmx.net ([213.165.64.20]:58024) by monty-python.gnu.org with smtp (Exim 4.60) (envelope-from ) id 1MTG5A-0001rU-RR for emacs-devel@gnu.org; Tue, 21 Jul 2009 10:12:41 -0400 Original-Received: (qmail invoked by alias); 21 Jul 2009 14:12:38 -0000 Original-Received: from 62-47-56-251.adsl.highway.telekom.at (EHLO [62.47.56.251]) [62.47.56.251] by mail.gmx.net (mp036) with SMTP; 21 Jul 2009 16:12:38 +0200 X-Authenticated: #14592706 X-Provags-ID: V01U2FsdGVkX1/pB1FULSPpB7aAtXk1wsDVHvsgTC3C0ePmQWQyMa dWUrxl53Ajk2X3 User-Agent: Thunderbird 2.0.0.21 (Windows/20090302) In-Reply-To: X-Y-GMX-Trusted: 0 X-FuHaFi: 0.6899999999999999 X-detected-operating-system: by monty-python.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:112903 Archived-At: > 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? > 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. martin