all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Nikolaj Schumacher <n_schumacher@web.de>
To: jseakle@gmail.com
Cc: help-gnu-emacs@gnu.org
Subject: Re: Automatic Python self completion
Date: Fri, 11 Apr 2008 15:14:49 +0200	[thread overview]
Message-ID: <m2fxtsleie.fsf@nschum.de> (raw)
In-Reply-To: <91d2aca70804101506m41c6b95ft4f3fbedc92adce45@mail.gmail.com> (Jake Eakle's message of "Thu\, 10 Apr 2008 18\:06\:50 -0400")

"Jake Eakle" <jseakle@gmail.com> wrote:

> I'm relatively new to emacs lisping, and I'm wondering how to go about
> adding a but of functionality to python-mode. I want emacs to, whenever I
> type '[tab]def <function name>(', automatically append the text 'self,
> '.Thanks!
>
> Jake Eakle

Here are the steps, you'll need to do:

- Define an interactive function with `defun'.
- Test for surrounding text with `looking-at'.
- Insert text with `insert'.
- Optionally do `indent-according-to-mode' otherwise.
- Bind function to tab.

Good luck.


regards,
Nikolaj Schumacher




  reply	other threads:[~2008-04-11 13:14 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-04-10 22:06 Automatic Python self completion Jake Eakle
2008-04-11 13:14 ` Nikolaj Schumacher [this message]
     [not found] <mailman.10249.1207865543.18990.help-gnu-emacs@gnu.org>
2008-04-10 23:17 ` weber

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m2fxtsleie.fsf@nschum.de \
    --to=n_schumacher@web.de \
    --cc=help-gnu-emacs@gnu.org \
    --cc=jseakle@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.