From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Hadron Newsgroups: gmane.emacs.help Subject: Re: key binding question Date: Mon, 12 Feb 2007 10:11:13 +0100 Message-ID: <87abzjyc3y.fsf@gmail.com> References: <87ejoyrwuu.fsf@gmail.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1171273242 6724 80.91.229.12 (12 Feb 2007 09:40:42 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 12 Feb 2007 09:40:42 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Mon Feb 12 10:40:31 2007 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1HGXfg-0005sj-MJ for geh-help-gnu-emacs@m.gmane.org; Mon, 12 Feb 2007 10:40:28 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HGXfg-0002Xw-8V for geh-help-gnu-emacs@m.gmane.org; Mon, 12 Feb 2007 04:40:28 -0500 Original-Path: shelby.stanford.edu!headwall.stanford.edu!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 25 Original-X-Trace: individual.net MIXDSuA+zVQJVQhgzLotdAV4SJDMp0DOZTYUCqxO3bkAsJTMFD X-Orig-Path: news.individual.net!news X-Face: 2h#||Cd#d%F*NCm59[_6/{1a@jy%; |j>{D~4^gKg(^i%7j0IK?+,/GmW&:CD5fEKb_! User-Agent: Gnus/5.110006 (No Gnus v0.6) Emacs/22.0.50 (gnu/linux) Cancel-Lock: sha1:+jpmT7LhVraK3GNx0ehHTKYxVz8= Original-Xref: shelby.stanford.edu gnu.emacs.help:145517 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:41121 Archived-At: Kevin Rodgers writes: > Hadron wrote: >> Is it to add a new key binding to be local to a specific mode by adding >> a hook e.g >> >> >> (add-hook 'html-mode-hook >> (lambda () >> (local-set-key [f10] 'myfunc))) >> >> >> or to use define-key on the specific mode-map?e.g >> >> (define-key html-mode-map [f11] 'myfunc) >> >> (assume the html-mode-map variable is instantiated/inscope. >> >> Or to ask another way, why would you choose one over the other and what >> might the pitfalls be? > > I use the mode hook, because I have an aversion to keymap variable names > :-) and because it doesn't require the package to be loaded. Makes sense, and doesn't add it multiple times I assume :-;