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: defining my own newline function Date: Mon, 5 Nov 2007 22:28:33 -0600 Message-ID: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1722408286==" X-Trace: ger.gmane.org 1194323346 917 80.91.229.12 (6 Nov 2007 04:29:06 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 6 Nov 2007 04:29:06 +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 05:29:09 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 1IpG3m-0002cb-BC for geh-help-gnu-emacs@m.gmane.org; Tue, 06 Nov 2007 05:29:06 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IpG3b-0000S0-1w for geh-help-gnu-emacs@m.gmane.org; Mon, 05 Nov 2007 23:28:55 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1IpG3J-0000No-2n for help-gnu-emacs@gnu.org; Mon, 05 Nov 2007 23:28:37 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1IpG3H-0000MH-NU for help-gnu-emacs@gnu.org; Mon, 05 Nov 2007 23:28:36 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IpG3H-0000MD-Fa for help-gnu-emacs@gnu.org; Mon, 05 Nov 2007 23:28:35 -0500 Original-Received: from wa-out-1112.google.com ([209.85.146.180]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1IpG3H-0002i1-DE for help-gnu-emacs@gnu.org; Mon, 05 Nov 2007 23:28:35 -0500 Original-Received: by wa-out-1112.google.com with SMTP id k34so2316101wah for ; Mon, 05 Nov 2007 20:28:33 -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:mime-version:content-type; bh=ha4qTHj3UT5XcchbK1OE6i+TWnJuJ4rnPUDlWs2rwcI=; b=tw6AMTE1OV8nZGdbGWXbqonwtK44dydL5Lj2AtsUThUpPXwdYR6tsY41NFrSkrqRF6Mekq1GEvR7X3v5ZKlrUeOh/nLqJhQh9kYggYuY1JDB4nGV0Zdr9XKtOCjk5Ptj9Ljfyy1hgkke8lXXzWHfcrGw2HS4shYwOkySFgF2zk8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:mime-version:content-type; b=dqktLBXyIayhx2B6DW/To5vjG6JWkuHDlQTCQQ/GsYnXqqLrfVJgtMg6NF4c4BahR2nhb6DR12P+GRPKexWDjxr3o0R2+oK3tgptzFUPUrDg2OO1/aurIJDCXj6/tfvIhb7xXAQwSUV4B+loBQPhghgtvEzM+G6EZ76eR0IFsmU= Original-Received: by 10.115.72.1 with SMTP id z1mr5988484wak.1194323313352; Mon, 05 Nov 2007 20:28:33 -0800 (PST) Original-Received: by 10.114.171.19 with HTTP; Mon, 5 Nov 2007 20:28:33 -0800 (PST) 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:49044 Archived-At: --===============1722408286== Content-Type: multipart/alternative; boundary="----=_Part_35283_32596576.1194323313076" ------=_Part_35283_32596576.1194323313076 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline I am writing my first major mode and in many ways it is going well. As one of the last steps, I want to write my own newline-and-indent function. I am having trouble getting my function called when I press return. I have the following in my local keymap for the mode: (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 which is an interactive compiled Lisp function in `simple.el'. It is bound to RET. (newline &optional arg) Insert a newline, and move to left margin of the new line if it's blank. If `use-hard-newlines' is non-nil, the newline is marked with the text-property `hard'. With arg, insert that many newlines. Call `auto-fill-function' if the current column number is greater than the value of `fill-column' and arg is nil. What am I doing wrong? Is there something I need to add to the syntax table of my mode or somewhere else? Thanks, Ryan ------=_Part_35283_32596576.1194323313076 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline I am writing my first major mode and in many ways it is going well.  As one of the last steps, I want to write my own newline-and-indent function.  I am having trouble getting my function called when I press return.  I have the following in my local keymap for the mode:

(define-key pypoutline-mode-map "\C-j" 'pypoutline-newline-and-indent)
    (define-key pypoutline-mode-map [<return>] '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 <return>) runs the command newline
  which is an interactive compiled Lisp function in `simple.el'.
It is bound to RET.
(newline &optional arg)

Insert a newline, and move to left margin of the new line if it's blank.
If `use-hard-newlines' is non-nil, the newline is marked with the
text-property `hard'.
With arg, insert that many newlines.
Call `auto-fill-function' if the current column number is greater
than the value of `fill-column' and arg is nil.


What am I doing wrong?  Is there something I need to add to the syntax table of my mode or somewhere else?

Thanks,

Ryan
------=_Part_35283_32596576.1194323313076-- --===============1722408286== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ help-gnu-emacs mailing list help-gnu-emacs@gnu.org http://lists.gnu.org/mailman/listinfo/help-gnu-emacs --===============1722408286==--