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: Tue, 11 Mar 2008 11:00:20 -0800 Message-ID: <000c01c883aa$27cceec0$0600a8c0@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 1205262147 26295 80.91.229.12 (11 Mar 2008 19:02:27 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 11 Mar 2008 19:02:27 +0000 (UTC) To: "'Emacs-Devel'" Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Mar 11 20:02:55 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 1JZ9jp-0006wN-Kf for ged-emacs-devel@m.gmane.org; Tue, 11 Mar 2008 20:02:14 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JZ9jG-0004HF-MF for ged-emacs-devel@m.gmane.org; Tue, 11 Mar 2008 15:01:38 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JZ9jC-0004DM-Bv for emacs-devel@gnu.org; Tue, 11 Mar 2008 15:01:34 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JZ9jB-0004BH-M0 for emacs-devel@gnu.org; Tue, 11 Mar 2008 15:01:33 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JZ9jB-0004At-5E for emacs-devel@gnu.org; Tue, 11 Mar 2008 15:01:33 -0400 Original-Received: from rgminet01.oracle.com ([148.87.113.118]) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1JZ9jA-0004v8-It for emacs-devel@gnu.org; Tue, 11 Mar 2008 15:01:32 -0400 Original-Received: from agmgw2.us.oracle.com (agmgw2.us.oracle.com [152.68.180.213]) by rgminet01.oracle.com (Switch-3.2.4/Switch-3.1.6) with ESMTP id m2BJ1SjN002138 for ; Tue, 11 Mar 2008 13:01:29 -0600 Original-Received: from acsmt350.oracle.com (acsmt350.oracle.com [141.146.40.150]) by agmgw2.us.oracle.com (Switch-3.2.0/Switch-3.2.0) with ESMTP id m2AF1u6j020382 for ; Tue, 11 Mar 2008 13:01:28 -0600 Original-Received: from inet-141-146-46-1.oracle.com by acsmt351.oracle.com with ESMTP id 3608145271205262021; Tue, 11 Mar 2008 12:00:21 -0700 Original-Received: from dradamslap1 (/141.144.106.216) by bhmail.oracle.com (Oracle Beehive Gateway v4.0) with ESMTP ; Tue, 11 Mar 2008 12:00:21 -0700 X-Mailer: Microsoft Office Outlook 11 Thread-Index: AchsFsoznKpVRLmZQIiY26UzeCf2pQXk0Dgg 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:92179 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?