From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Drew Adams" Newsgroups: gmane.emacs.devel Subject: RE: view-mode exit hook? Date: Sat, 5 Jan 2008 16:33:12 -0800 Message-ID: References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1199579679 5013 80.91.229.12 (6 Jan 2008 00:34:39 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 6 Jan 2008 00:34:39 +0000 (UTC) To: "Emacs-Devel" Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Jan 06 01:35:01 2008 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 1JBJTW-0004PU-74 for ged-emacs-devel@m.gmane.org; Sun, 06 Jan 2008 01:34:59 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JBJT0-00074n-9l for ged-emacs-devel@m.gmane.org; Sat, 05 Jan 2008 19:34:18 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JBJSw-00074W-Gm for emacs-devel@gnu.org; Sat, 05 Jan 2008 19:34:14 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JBJSm-00072c-VE for emacs-devel@gnu.org; Sat, 05 Jan 2008 19:34:13 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JBJSm-00072Z-Qr for emacs-devel@gnu.org; Sat, 05 Jan 2008 19:34:04 -0500 Original-Received: from agminet01.oracle.com ([141.146.126.228]) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1JBJSl-0004tn-Dc for emacs-devel@gnu.org; Sat, 05 Jan 2008 19:34:04 -0500 Original-Received: from agmgw1.us.oracle.com (agmgw1.us.oracle.com [152.68.180.212]) by agminet01.oracle.com (Switch-3.2.4/Switch-3.1.7) with ESMTP id m060XqRi018889 for ; Sat, 5 Jan 2008 18:33:52 -0600 Original-Received: from acsmt351.oracle.com (acsmt351.oracle.com [141.146.40.151]) by agmgw1.us.oracle.com (Switch-3.2.0/Switch-3.2.0) with ESMTP id m05NJ6FZ025366 for ; Sat, 5 Jan 2008 17:33:51 -0700 Original-Received: from 141.144.88.62 by acsmt350.oracle.com with ESMTP id 3479630901199579591; Sat, 05 Jan 2008 16:33:11 -0800 X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook IMO, Build 9.0.6604 (9.0.2911.0) In-Reply-To: X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3198 Importance: Normal X-Brightmail-Tracker: AAAAAQAAAAI= X-Brightmail-Tracker: AAAAAQAAAAI= X-Whitelist: TRUE X-Whitelist: TRUE X-detected-kernel: by monty-python.gnu.org: Linux 2.4-2.6 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:86267 Archived-At: > > > 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. > > `view-exit-action' is not currently a no-op, AFAICT. So adding the feature > of fitting the frame would not simply be a matter of setting or binding > `view-exit-action' to a `fit-frame' function. It would instead > mean _adding_ frame fitting to whatever `view-exit-action' might > already be doing. And that "whatever" is different, IIUC, depending > on how view-mode is exited, and even, I think, depending on how > view-mode was entered. (Again, I don't master that code, nor do I want > to.) > > `view-exit-action' is not simply a hook; it is more complex (and perhaps > more fragile). As I said, I can imagine tacking `fit-frame' onto whatever > `view-exit-action' does already, but I'd sooner advise > `view-mode-exit'. And neither of those prospects looks particularly > appealing (clean) to me. > > From what I've heard so far, there seems to be no recommended way > to handle this kind of thing. In that case, I ask again, shouldn't > there be a `view-mode-exit-hook'? How about such a hook?