help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Setting key bindings in view-mode-hook


From: Johan Bockgård
Subject: Re: Setting key bindings in view-mode-hook
Date: Sat, 19 Nov 2005 01:50:36 +0100
User-agent: Gnus/5.110004 (No Gnus v0.4) Emacs/22.0.50 (gnu/linux)

Bill Wohler <wohler@newt.com> 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)))

,----
| local-set-key is an interactive compiled Lisp function in `subr'.
| (local-set-key KEY COMMAND)
| 
| Give KEY a local binding as COMMAND.
| [...]
| The binding goes in the current buffer's local map, which in most
| cases is shared with all other buffers in the same major mode.
`----

Define the key in `view-mode-map' instead.

> However, "C-h c q" in a buffer in view mode still shows View-quit.

View mode is a minor mode. Minor mode maps take precedence over the
local map (where "q" will have been defined).

-- 
Johan Bockgård


reply via email to

[Prev in Thread] Current Thread [Next in Thread]