From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Bill Wohler Newsgroups: gmane.emacs.devel Subject: Re: Setting key bindings in view-mode-hook Date: Sun, 27 Nov 2005 11:03:16 -0800 Organization: Newt Software Message-ID: <87d5klx6a3.fsf@olgas.newt.com> References: <18382.1133061987@olgas.newt.com> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1133118528 15772 80.91.229.2 (27 Nov 2005 19:08:48 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sun, 27 Nov 2005 19:08:48 +0000 (UTC) Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Nov 27 20:08:38 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1EgRrX-0005vM-Vz for ged-emacs-devel@m.gmane.org; Sun, 27 Nov 2005 20:07:00 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1EgRrX-00064Y-8Z for ged-emacs-devel@m.gmane.org; Sun, 27 Nov 2005 14:06:59 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1EgRrO-000642-81 for emacs-devel@gnu.org; Sun, 27 Nov 2005 14:06:50 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1EgRrM-00063o-Lz for emacs-devel@gnu.org; Sun, 27 Nov 2005 14:06:49 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1EgRrM-00063k-Ij for emacs-devel@gnu.org; Sun, 27 Nov 2005 14:06:48 -0500 Original-Received: from [80.91.229.2] (helo=ciao.gmane.org) by monty-python.gnu.org with esmtp (TLS-1.0:RSA_AES_128_CBC_SHA:16) (Exim 4.34) id 1EgRrM-0001xN-6P for emacs-devel@gnu.org; Sun, 27 Nov 2005 14:06:48 -0500 Original-Received: from list by ciao.gmane.org with local (Exim 4.43) id 1EgRpt-0005Pr-HM for emacs-devel@gnu.org; Sun, 27 Nov 2005 20:05:18 +0100 Original-Received: from h-68-166-189-106.snvacaid.dynamic.covad.net ([68.166.189.106]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sun, 27 Nov 2005 20:05:17 +0100 Original-Received: from wohler by h-68-166-189-106.snvacaid.dynamic.covad.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sun, 27 Nov 2005 20:05:17 +0100 X-Injected-Via-Gmane: http://gmane.org/ Original-To: emacs-devel@gnu.org Original-Lines: 60 Original-X-Complaints-To: usenet@sea.gmane.org X-Gmane-NNTP-Posting-Host: h-68-166-189-106.snvacaid.dynamic.covad.net User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux) Cancel-Lock: sha1:+nYP4+mJe2Lrwnw9gzI2it1gdss= 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:46661 Archived-At: "Drew Adams" writes: > I'd like to bind "q" in `view-mode' to `View-kill-and-leave'. > I customized view-mode-hook with > > (lambda nil (local-set-key "q" (quote View-kill-and-leave))) > > However, "C-h c q" in a buffer in view mode still shows View-quit. > What gives? How come my setting isn't honored? > This is in recent CVS snapshot of Emacs 22, but a quick check reveals > that this Emacs 21 shows the same behavior. > > It might help (I don't know) to look at my messages of 9/8/2005 and > 9/9/2005, subject "quitting help buffer" (which are really about quitting > view-mode). Thanks. It helps since misery loves company. > But that is not the behavior I get. For me, it iconifies the frame. And, in > some (rarer) cases, it leaves the frame displayed (no change): `q' does > nothing at all in those cases. I'm not using frames. However, I tried view-file-other-frame and hit `q'. I expected either the buffer or the frame to go away, but as you said, it was iconified instead. Ew. At best, I'd like `q' to kill the *Help* buffer or buffer in view-mode. At worst, I'd like to bury it. But for me, `q' either does nothing (maybe after visiting the *Help* buffer), or closes the window but leaves the *Help* buffer in the #2 spot so a subsequent C-x b takes me not to the mh-e.texi file that I was expecting but to *Help*. I find that the use of `C' reliably does what I want (as well as C-x k, of course). However, my fingers really prefer `q'. I think it's a bug that I can't bind `q' to View-kill-and-leave. I agree with you that all those ways of quitting view-mode are silly. Once you're in view-mode, how you got there is immaterial. I want `q' to do the same thing whether I ran view-mode manually, whether I'm in a *Help* buffer, whether I ran `v' from dired, or have view-read-only turned on. KISS. Perhaps you and I need to come up with recipes that reliably show what we mean, but I would argue that if the exit path were more simple, we wouldn't be here in the first place. Rather than try to find and isolate a small bug, we should redesign and simplify the exit path. For example, I think view-mode should take the same design as customize, in which there is a single function to exit (Custom-buffer-done), bound to `q', which buries the buffer, unless the option custom-buffer-done-kill is turned on, in which case the buffer is killed. However, I would agree that now is not the time to do this. My 2c anyway. -- Bill Wohler http://www.newt.com/wohler/ GnuPG ID:610BD9AD Maintainer of comp.mail.mh FAQ and MH-E. Vote Libertarian! If you're passed on the right, you're in the wrong lane.