Your favorite Python-related (X)Emacs thingamajiks?

Edvard Majakari edvard+news at majakari.net
Tue Mar 2 01:08:06 EST 2004


I just thought to share mine:

(define-skeleton esm-skel-python-def
  "Inserts a new python function definition at point."
  "method name: "
  "def " str
  "("
  ("argument, %s: "
   str & ", ") & -2 & "):" | -1 & "():"
   \n
   >"\"\"\"" ("comment: " str) ".\"\"\"" \n)

(define-abbrev python-mode-abbrev-table "def" "" 'esm-skel-python-def)

It's not very neat, but it does create a simple, consistent Python def
whenever you type 'def ' and prompts for a name, list of arguments and
comment for the method. Some day I'll try to make it more intelligent and
automatically add 'self' as the first parameter, if I'm inside a class. 

-- 
# Edvard Majakari		Software Engineer
# PGP PUBLIC KEY available    	Soli Deo Gloria!

$_ = '456476617264204d616a616b6172692c20612043687269737469616e20'; print
join('',map{chr hex}(split/(\w{2})/)),uc substr(crypt(60281449,'es'),2,4),"\n";




More information about the Python-list mailing list