From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: bojohan+news@dd.chalmers.se (Johan =?utf-8?Q?Bockg=C3=A5rd?=) Newsgroups: gmane.emacs.help Subject: Re: Setting key bindings in view-mode-hook Date: Sat, 19 Nov 2005 01:50:36 +0100 Organization: Chalmers University of Technology, Sweden Message-ID: References: NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: sea.gmane.org 1132362091 23227 80.91.229.2 (19 Nov 2005 01:01:31 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sat, 19 Nov 2005 01:01:31 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sat Nov 19 02:01:29 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1EdH5n-0008PC-Do for geh-help-gnu-emacs@m.gmane.org; Sat, 19 Nov 2005 02:00:35 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1EdH5m-0000YC-NZ for geh-help-gnu-emacs@m.gmane.org; Fri, 18 Nov 2005 20:00:34 -0500 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!news.tele.dk!news.tele.dk!small.news.tele.dk!newsfeed1.swip.net!swipnet!newsfeed.sunet.se!news01.sunet.se!129.16.116.9.MISMATCH!dd.chalmers.se!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 27 Original-NNTP-Posting-Host: linus003.dd.chalmers.se Mail-Copies-To: never User-Agent: Gnus/5.110004 (No Gnus v0.4) Emacs/22.0.50 (gnu/linux) Cancel-Lock: sha1:kPAqhJI5ehea5k/htLCUTWmThJ8= Original-Xref: shelby.stanford.edu gnu.emacs.help:135560 Original-To: help-gnu-emacs@gnu.org X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:31157 Archived-At: Bill Wohler 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