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: view-mode exit hook? Date: Wed, 19 Dec 2007 07:39:11 +0100 Message-ID: <4768BC8F.90308@gmx.at> References: 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 1198046711 29970 80.91.229.12 (19 Dec 2007 06:45:11 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 19 Dec 2007 06:45:11 +0000 (UTC) Cc: Emacs-Devel To: Drew Adams Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Dec 19 07:45:22 2007 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 1J4sgE-0003yW-7S for ged-emacs-devel@m.gmane.org; Wed, 19 Dec 2007 07:45:22 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1J4sfu-0005uk-Sg for ged-emacs-devel@m.gmane.org; Wed, 19 Dec 2007 01:45:02 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1J4sfp-0005s8-7p for emacs-devel@gnu.org; Wed, 19 Dec 2007 01:44:57 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1J4sfn-0005p2-LV for emacs-devel@gnu.org; Wed, 19 Dec 2007 01:44:56 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1J4sfn-0005ol-EO for emacs-devel@gnu.org; Wed, 19 Dec 2007 01:44:55 -0500 Original-Received: from mail.gmx.net ([213.165.64.20]) by monty-python.gnu.org with smtp (Exim 4.60) (envelope-from ) id 1J4sfm-0006UX-Vt for emacs-devel@gnu.org; Wed, 19 Dec 2007 01:44:55 -0500 Original-Received: (qmail invoked by alias); 19 Dec 2007 06:44:53 -0000 Original-Received: from N907P025.adsl.highway.telekom.at (EHLO [62.47.57.89]) [62.47.57.89] by mail.gmx.net (mp012) with SMTP; 19 Dec 2007 07:44:53 +0100 X-Authenticated: #14592706 X-Provags-ID: V01U2FsdGVkX19X3CNZyJZXSM6CNGrJop06+obD/i0J50yq3pXtGA y46NYC7si/pZWE User-Agent: Mozilla Thunderbird 1.0 (Windows/20041206) X-Accept-Language: de-DE, de, en-us, en In-Reply-To: X-Y-GMX-Trusted: 0 X-detected-kernel: by monty-python.gnu.org: 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:85271 Archived-At: > I wasn't suggesting to use `view-mode-hook'. As I noted, that is run only > upon entering the mode. I don't know whether view-mode manages to keep track > of window configs - I thought it did, but that's beside the point here. What > would be needed in this case would be restoring the frame config, not a > window config. _If_ that were feasible. If you want to restore the frame configuration you have to save it first. Where do you want to do that? All I said was that `view-mode-hook' might be the wrong place. > If the frame cannot be restored, I'm happy to deal with this by fitting the > frame again upon view-mode exit, even though that is less desirable for a > user than putting back the frame parameters s?he had before view-mode. > > I don't want to go near `view-exit-action', if I can avoid it. That code is > far too complicated for a mortal such as I. I did think that I could > recuperate the current value of `view-exit-action' and then tack my function > call onto it, but that seems quite ugly. I'd sooner advise `view-mode-exit', > I think (and I don't like to use advice either). > > I was looking for a simple and clean way to go, such as a hook. > > Does it make sense for Emacs to have a `view-mode-exit-hook'? You can always think of `view-exit-action' as doing that. For example, there's no harm setting `view-exit-action' to a function that restores a frame configuration saved earlier. The question remains _which_ frame configuration you want to restore.