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: FW: view-mode exit hook? Date: Sun, 10 Feb 2008 10:57:31 -0800 Message-ID: <000601c86c16$ca67a6d0$2958908d@us.oracle.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1202669846 26958 80.91.229.12 (10 Feb 2008 18:57:26 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 10 Feb 2008 18:57:26 +0000 (UTC) To: "Emacs-Devel" Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Feb 10 19:57:48 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 1JOHN5-0005aW-Q5 for ged-emacs-devel@m.gmane.org; Sun, 10 Feb 2008 19:57:48 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JOHMc-0007J9-NB for ged-emacs-devel@m.gmane.org; Sun, 10 Feb 2008 13:57:18 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JOHMX-0007Ge-Kz for emacs-devel@gnu.org; Sun, 10 Feb 2008 13:57:13 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JOHMW-0007El-VS for emacs-devel@gnu.org; Sun, 10 Feb 2008 13:57:13 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JOHMW-0007EV-Lk for emacs-devel@gnu.org; Sun, 10 Feb 2008 13:57:12 -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 1JOHMW-000721-8l for emacs-devel@gnu.org; Sun, 10 Feb 2008 13:57:12 -0500 Original-Received: from agmgw2.us.oracle.com (agmgw2.us.oracle.com [152.68.180.213]) by agminet01.oracle.com (Switch-3.2.4/Switch-3.1.7) with ESMTP id m1AIv9Lx004160 for ; Sun, 10 Feb 2008 12:57:09 -0600 Original-Received: from acsmt351.oracle.com (acsmt351.oracle.com [141.146.40.151]) by agmgw2.us.oracle.com (Switch-3.2.0/Switch-3.2.0) with ESMTP id m1AHQEbb011516 for ; Sun, 10 Feb 2008 11:57:09 -0700 Original-Received: from inet-141-146-46-1.oracle.com by acsmt351.oracle.com with ESMTP id 3566935731202669827; Sun, 10 Feb 2008 10:57:07 -0800 Original-Received: from dradamslap1 (/141.144.88.41) by bhmail.oracle.com (Oracle Beehive Gateway v4.0) with ESMTP ; Sun, 10 Feb 2008 10:57:07 -0800 X-Mailer: Microsoft Office Outlook 11 Thread-Index: AchsFsoznKpVRLmZQIiY26UzeCf2pQ== X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3198 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:88645 Archived-At: Resending. Any arguments against adding such a hook? Argument for adding it is below. ---------- From: Drew Adams Sent: Saturday, January 05, 2008 4:33 PM > > > 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?