[Python-mode] form inserting print

Andreas Roehler andreas.roehler at online.de
Fri Mar 12 10:51:17 CET 2010


Hi python-mode folks,

form below should speed up writing print-statements in Python a
little bit.

(defun druck (&optional arg)
  "Inserts a print statement out of current `(car kill-ring)' by default, inserts ARG instead if delivered. "
  (interactive "*")
  (lexical-let* ((name (or arg (car kill-ring)))
                (form (cond ((eq major-mode 'python-mode)
                            (concat "print \"" name ": %s \" % " name)))))
    (insert form)))

Opinions?

Cheers

Andreas

--
https://code.launchpad.net/~a-roehler/python-mode
https://code.launchpad.net/s-x-emacs-werkstatt/


More information about the Python-mode mailing list