diff --git a/.emacs.d/lisp/python.el b/.emacs.d/lisp/python.el index 30b62f5..0337a17 100644 --- a/.emacs.d/lisp/python.el +++ b/.emacs.d/lisp/python.el @@ -284,6 +284,7 @@ (define-key map [remap backward-sentence] 'python-nav-backward-block) (define-key map [remap forward-sentence] 'python-nav-forward-block) (define-key map [remap backward-up-list] 'python-nav-backward-up-list) + (define-key map [remap mark-defun] 'python-mark-defun) (define-key map "\C-c\C-j" 'imenu) ;; Indent specific (define-key map "\177" 'python-indent-dedent-line-backspace) @@ -1285,7 +1286,7 @@ With positive ARG search backwards, else search forwards." 0)))) (found (progn - (when (and (< arg 0) + (when (and (> arg 0) (python-info-looking-at-beginning-of-defun)) (end-of-line 1)) (while (and (funcall re-search-fn @@ -4460,6 +4461,12 @@ default to utf-8." ;;; Utility functions +(defun python-mark-defun () + (interactive) + (when (python-info-looking-at-beginning-of-defun) + (end-of-line 1)) + (mark-defun)) + (defun python-util-goto-line (line-number) "Move point to LINE-NUMBER." (goto-char (point-min))