[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Automatic Python self completion
From: |
Nikolaj Schumacher |
Subject: |
Re: Automatic Python self completion |
Date: |
Fri, 11 Apr 2008 15:14:49 +0200 |
User-agent: |
Gnus/5.11 (Gnus v5.11) Emacs/22.2.50 (darwin) |
"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