From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Ryan Krauss" Newsgroups: gmane.emacs.help Subject: Re: defining my own newline function Date: Tue, 6 Nov 2007 08:25:02 -0600 Message-ID: References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1194359207 4369 80.91.229.12 (6 Nov 2007 14:26:47 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 6 Nov 2007 14:26:47 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Tue Nov 06 15:26:51 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 1IpPN3-0000nz-Hd for geh-help-gnu-emacs@m.gmane.org; Tue, 06 Nov 2007 15:25:37 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IpPMs-0004Da-Cs for geh-help-gnu-emacs@m.gmane.org; Tue, 06 Nov 2007 09:25:26 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1IpPMa-0004BB-Ce for help-gnu-emacs@gnu.org; Tue, 06 Nov 2007 09:25:08 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1IpPMX-00048R-Tw for help-gnu-emacs@gnu.org; Tue, 06 Nov 2007 09:25:07 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IpPMX-00048O-RS for help-gnu-emacs@gnu.org; Tue, 06 Nov 2007 09:25:05 -0500 Original-Received: from nz-out-0506.google.com ([64.233.162.224]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1IpPMX-0002Fc-1P for help-gnu-emacs@gnu.org; Tue, 06 Nov 2007 09:25:05 -0500 Original-Received: by nz-out-0506.google.com with SMTP id f1so1306522nzc for ; Tue, 06 Nov 2007 06:25:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; bh=SsYICpPDahcq5wJ2Ao5ezvJoCF1mJkNMWo9rm9HWLxY=; b=pg5J+IHwBdHOyJtELA1JdUrUAkxRKWbCS2LYgnJK8CgrbzNzCnhqIS1gVZS0IJHf6YPQCu5gNiMR9Ep0mmdqdDR4m2W9rdbS2cXS5ZaKg2oXPlNgNxX6/fK2KR81RDJkkrfMpbSbowM1ITrY/SxlB04sGK05LgeFzGt5fm/FMsQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=HjiOLg1pZZSehtRx8BURfiYfaHaYETPpUoqMeAgliEzLlUkL5bgQQ8lmshajSBx9MEihp39hEsYfi/3cHu7P0v0lyOcE1dOf+v3Nd7D5fjBTRFYz6/tOmScOb3lt7ubGgxJHLmEiJVKMGjv5tMpp1ynZ4BKmdt5rJWbWynxCqho= Original-Received: by 10.114.193.1 with SMTP id q1mr5993337waf.1194359102990; Tue, 06 Nov 2007 06:25:02 -0800 (PST) Original-Received: by 10.114.171.19 with HTTP; Tue, 6 Nov 2007 06:25:02 -0800 (PST) In-Reply-To: Content-Disposition: inline X-detected-kernel: by monty-python.gnu.org: Linux 2.6 (newer, 2) 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:49052 Archived-At: On 11/6/07, Ryan Krauss wrote: > Sorry, I meant to cc the list as well. > > I can't make 'M-: (current-local-mode)' do anything. I assume you > want me to press Alt-Shift-: (the shift is needed to make a colon > rather than a semi-colon?). When I do that, I prompted with > Eval: > > so, I typed > (current-local-mode) > > there and I get > > Debugger entered--Lisp error: (void-function current-local-mode) > (current-local-mode) > eval((current-local-mode)) > eval-expression((current-local-mode) nil) > call-interactively(eval-expression) > > > But the info line lists my major mode as the one being run. The > syntax highlighting is what I have defined, and my indent function is > being used. My local key map is also available, with an outdent > function bound to backtab. These keys don't work if I create a .txt > file where my mode isn't running. So, I think my mode is running and > my local key map is happening with other keys. > > Ryan > > On 11/5/07, Drew Adams wrote: > > > (define-key pypoutline-mode-map "\C-j" 'pypoutline-newline-and-indent) > > > (define-key pypoutline-mode-map [] 'pypoutline-newline-and-indent) > > > (define-key py-mode-map "\C-m" 'pypoutline-newline-and-indent) > > > > > but none of them seem to be working. If I type C-h k and > > > then hit return (in a buffer running my mode), I get: > > > > > RET (translated from ) runs the command newline > > > > > What am I doing wrong? Is there something I need to add > > > to the syntax table of my mode or somewhere else? > > > > Are you sure that you are in your mode and that your mode has your mode map > > as its local map? What does `M-: (current-local-mode)' tell you? > > > > [BTW, it's generally better to use plain text, not HTML, for email to a > > mailing list.] > > > > > So, I found the solution to my problem. In trying to figure out what key combination I needed to bind in my local map, I copied and pasted from python-mode: (define-key py-mode-map "\C-m" 'pypoutline-newline-and-indent) I changed the name of the function, but not the name of the map. Apparently, "\C-m" is the right one for my settings, but I forgot to change which mode I wanted that key mapped in. I discovered this when I got strange behavior while trying to edit a python file. Changing the last line to (define-key pypoutline-mode-map "\C-m" 'pypoutline-newline-and-indent) fixed my issue. Ryan