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: Window configurations Date: Fri, 14 May 2010 08:59:34 +0200 Message-ID: <4BECF4D6.9030707@gmx.at> References: <4BB4CF6B.2000007@alice.it> <87vdbhgqgd.fsf@mail.jurta.org> <828BB36311A84C43B96D1F2A559DACAE@us.oracle.com> <87d3xo662u.fsf@mail.jurta.org> <69D40D69CC6F4982A8E91D8D8F0F494F@us.oracle.com> <87r5m4hz39.fsf@mail.jurta.org> <4BD40821.70808@gmx.at> <87zl0rtmqy.fsf@mail.jurta.org> <871vdu6qn5.fsf@mail.jurta.org> <87bpcv1wvt.fsf@mail.jurta.org> <4BE13828.2030609@gmx.at> <87vdb2qo82.fsf@mail.jurta.org> <4BE27C17.3030005@gmx.at> <87vdav4vx5.fsf@mail.jurta.org> <4BE900E7.3090402@gmx.at> <87r5liqv8f.fsf@mail.jurta.org> <4BEA74DC.2060103@gmx.at> <87y6fns8qo.fsf@mail.jurta.org> 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: dough.gmane.org 1273820412 22066 80.91.229.12 (14 May 2010 07:00:12 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Fri, 14 May 2010 07:00:12 +0000 (UTC) Cc: Ken Hori , Emacs To: Juri Linkov Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri May 14 09:00:10 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 1OCosO-0005cc-Ju for ged-emacs-devel@m.gmane.org; Fri, 14 May 2010 09:00:04 +0200 Original-Received: from localhost ([127.0.0.1]:42258 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OCosO-0005qI-3G for ged-emacs-devel@m.gmane.org; Fri, 14 May 2010 03:00:04 -0400 Original-Received: from [140.186.70.92] (port=43768 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OCosG-0005pz-6J for emacs-devel@gnu.org; Fri, 14 May 2010 02:59:59 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OCos4-0006J5-Is for emacs-devel@gnu.org; Fri, 14 May 2010 02:59:55 -0400 Original-Received: from mail.gmx.net ([213.165.64.20]:39739) by eggs.gnu.org with smtp (Exim 4.69) (envelope-from ) id 1OCos4-0006Il-4Z for emacs-devel@gnu.org; Fri, 14 May 2010 02:59:44 -0400 Original-Received: (qmail invoked by alias); 14 May 2010 06:59:42 -0000 Original-Received: from 62-47-45-110.adsl.highway.telekom.at (EHLO [62.47.45.110]) [62.47.45.110] by mail.gmx.net (mp007) with SMTP; 14 May 2010 08:59:42 +0200 X-Authenticated: #14592706 X-Provags-ID: V01U2FsdGVkX1/GWU8D1VDG6TyM6/DVRfEK3Z2QJinVt7jisbH/EX ViHm2NuqQIXxcz User-Agent: Thunderbird 2.0.0.21 (Windows/20090302) In-Reply-To: <87y6fns8qo.fsf@mail.jurta.org> X-Y-GMX-Trusted: 0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. 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:124757 Archived-At: >> The culprit here is the `other-buffer' call when unshowing the buffer. >> Practically all occurrences of `other-buffer' in window handling code >> are harmful. Their original purpose was to make sure that the same >> buffer isn't displayed twice on a frame I suppose. > > Yes, and occurrences of `(car (buffer-list))' are harmful too. Obviously. It just makes it more difficult grepping them. > It is sufficient because it stores this information in the buffer-local > variable `view-return-to-alist'. I don't think a similar variable > would help for other non-view buffers because it is specific to windows, > not to buffers. So it seems a window parameter is more suitable. What I meant is this: With view-mode the variable is useful in the sense that when I exit view-mode I get the last non-view-mode buffer shown in that window. For commands like "show me the last meaningful view-mode buffer when I'm already in view mode" or "show me the last meaningful non-view-mode buffer when I'm not in view-mode" I need a stack where to pop that buffer from. >>> Then every switch-to-buffer could add a `quit-restore' element to the >>> window history parameter, >> We'd have to enumerate all actions that would add such an element. > > I think it should be every action that changes the window's buffer. And these should all boil down to `set-window-buffer' calls. > No need to scan all windows' history stacks. During restoring the saved > state from the stack, we could drop elements with killed buffers and > continue popping the stack until we find an element with a live buffer. OK. If we put an upper limit on the size of such stacks, stale entries will get removed automatically after some time. > I think this window parameter should be treated like the frame parameter > `buffer-list'. E.g. `other-buffer' prefers selected frame's buffer list > instead of the global buffer list, etc. We'd have to specify the meaning of "prefers" here. martin