Below again the code, as end-of-defun-raw had a bug last times
;; GNU's lisp.el ;; unhappily sets this var globally, ignoring its use for progmodes (when (featurep 'emacs) (setq end-of-defun-function nil)) (setq defun-searchform '(if defun-prompt-regexp (concat "^\\s(\\|" "\\(" defun-prompt-regexp "\\)\\s(") "^\\s(")) (defun beginning-of-defun (&optional arg) "Move backward to the beginning of a functions definition. " (interactive "P") (or arg (setq arg 1)) (if beginning-of-defun-function (funcall beginning-of-defun-function arg) (beginning-of-defun-raw arg))) (defun beginning-of-defun-raw (&optional arg) "Called if progmodes didn't set beginning-of-defun-function. " (when (re-search-backward (eval defun-searchform) nil 'move (or arg 1)) (goto-char (match-beginning 0)))) (defun end-of-defun (&optional arg) "Move backward to the end of a function. " (interactive "P") (or arg (setq arg 1)) (if end-of-defun-function (funcall end-of-defun-function arg) (end-of-defun-raw arg))) (defun end-of-defun-raw (&optional arg) "Called if progmodes didn't set end-of-defun-function. " (skip-chars-forward " \t\r\n\f") (unless (looking-at (eval defun-searchform)) (beginning-of-defun 1)) (when (re-search-forward (eval defun-searchform) nil t arg) (goto-char (match-beginning 0)) (forward-sexp 1))) _______________________________________________ Python-mode mailing list Python-mode@python.org http://mail.python.org/mailman/listinfo/python-mode