From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: wenbinye@gmail.com Newsgroups: gmane.emacs.help Subject: Re: Toggle Keybinding Date: 30 Jul 2006 03:33:57 -0700 Organization: http://groups.google.com Message-ID: <1154255637.060982.204000@p79g2000cwp.googlegroups.com> References: NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" X-Trace: sea.gmane.org 1154256054 20901 80.91.229.2 (30 Jul 2006 10:40:54 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sun, 30 Jul 2006 10:40:54 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sun Jul 30 12:40:51 2006 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1G78j1-0004B1-R1 for geh-help-gnu-emacs@m.gmane.org; Sun, 30 Jul 2006 12:40:49 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1G78j1-00073l-3T for geh-help-gnu-emacs@m.gmane.org; Sun, 30 Jul 2006 06:40:47 -0400 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!postnews.google.com!p79g2000cwp.googlegroups.com!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 27 Original-NNTP-Posting-Host: 218.17.227.208 Original-X-Trace: posting.google.com 1154255641 27071 127.0.0.1 (30 Jul 2006 10:34:01 GMT) Original-X-Complaints-To: groups-abuse@google.com Original-NNTP-Posting-Date: Sun, 30 Jul 2006 10:34:01 +0000 (UTC) In-Reply-To: User-Agent: G2/0.2 X-HTTP-UserAgent: Opera/9.00 (X11; Linux i686; U; en),gzip(gfe),gzip(gfe) Complaints-To: groups-abuse@google.com Injection-Info: p79g2000cwp.googlegroups.com; posting-host=218.17.227.208; posting-account=3wOHJA0AAAAYp1ktKqTr4LI0QMFE1g-B Original-Xref: shelby.stanford.edu gnu.emacs.help:140756 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:36381 Archived-At: The key binding syntax is not right, use "\M-+" instead. It is better to use c++-mode-map: (add-hook 'c++-mode-hook (lambda () (define-key c++-mode-map "\M-+" 'hs-toggle-hiding))) Paulo J. Matos wrote: > Hi, > I'm setting in .emacs (cvs-emacs) the following: > (add-hook 'c++-mode-hook 'hs-minor-mode) > > (add-hook 'c++-mode-hook > (lambda () > (local-set-key "M-+" 'hs-toggle-hiding))) > > For some reason the keybinding is not working. But if I do > local-set-key in emacs everything seems to go fine! :-) > > Any ideas? Should the + in "M-+" be escaped somehow? > > -- > Paulo Jorge Matos - pocm at sat inesc-id pt > Web: http://sat.inesc-id.pt/~pocm > Computer and Software Engineering > INESC-ID - SAT Group