[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Setting key bindings in view-mode-hook
From: |
Bill Wohler |
Subject: |
Re: Setting key bindings in view-mode-hook |
Date: |
Sun, 27 Nov 2005 11:03:16 -0800 |
User-agent: |
Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux) |
"Drew Adams" <address@hidden> 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 <address@hidden> 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.