unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* defining my own newline function
@ 2007-11-06  4:28 Ryan Krauss
  2007-11-06  5:43 ` Drew Adams
  0 siblings, 1 reply; 5+ messages in thread
From: Ryan Krauss @ 2007-11-06  4:28 UTC (permalink / raw)
  To: help-gnu-emacs


[-- Attachment #1.1: Type: text/plain, Size: 1205 bytes --]

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

[-- Attachment #1.2: Type: text/html, Size: 1421 bytes --]

[-- Attachment #2: Type: text/plain, Size: 152 bytes --]

_______________________________________________
help-gnu-emacs mailing list
help-gnu-emacs@gnu.org
http://lists.gnu.org/mailman/listinfo/help-gnu-emacs

^ permalink raw reply	[flat|nested] 5+ messages in thread
[parent not found: <c5b438120711060533s4813d551s947e036870206514@mail.gmail.com>]

end of thread, other threads:[~2007-11-06 14:29 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-11-06  4:28 defining my own newline function Ryan Krauss
2007-11-06  5:43 ` Drew Adams
2007-11-06 13:56   ` Ryan Krauss
2007-11-06 14:25     ` Ryan Krauss
     [not found] <c5b438120711060533s4813d551s947e036870206514@mail.gmail.com>
2007-11-06 14:29 ` Drew Adams

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).