Re: [Python-mode] python.el

2011-02-05 Thread skip

Eric in all seriousness, please don't waste any more time on the free
Eric software foundation. I have decided to not support them anymore
Eric since Stallman told me that the needs of free software come before
Eric the needs of disabled people.

+1.

S

___
Python-mode mailing list
Python-mode@python.org
http://mail.python.org/mailman/listinfo/python-mode


[Python-mode] py-match-paren

2011-02-05 Thread Andreas Röhler

Hi Barry,

herewith a function I'm used to when editing and didn't want miss it in 
python-mode.


Maybe have a look, if it seems useful for others too.

Needs

(require 'beg-end)
(require 'thing-at-point-utils)
(require 'thingatpt-utils-base)

from https://code.launchpad.net/s-x-emacs-werkstatt/

which are present already in branches:

lp:~a-roehler/python-mode/paragraph-fill-warts
lp:~a-roehler/python-mode/python-mode-components

;

;;   (define-key py-mode-map [(%)] 'py-match-paren)
(defun py-match-paren (arg)
  Go to the matching brace, bracket or parenthesis if on its counterpart.
Otherwise insert the character, the key is assigned to, here `%'.
With universal arg \C-u insert a `%'. 
  (interactive P)
  (if arg
  (self-insert-command (if (numberp arg) arg 1))
(cond
 ((looking-at ()
  (goto-char (ar-parentized-end-position-atpt))
  (backward-char 1))
 ((looking-at ))
  (goto-char (ar-parentized-beginning-position-atpt)))

 ((looking-at \\\[)
  (goto-char (ar-bracketed-end-position-atpt))
  (backward-char 1))
 ((looking-at ])
  (goto-char (ar-bracketed-beginning-position-atpt)))

 ((looking-at {)
  (goto-char (ar-braced-end-position-atpt))
  (backward-char 1))
 ((looking-at })
  (goto-char (ar-braced-beginning-position-atpt)))

 (t (self-insert-command 1))
___
Python-mode mailing list
Python-mode@python.org
http://mail.python.org/mailman/listinfo/python-mode