diff options
Diffstat (limited to 'lisp/progmodes/python.el')
| -rw-r--r-- | lisp/progmodes/python.el | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el index 1b1f2a9c2de..dfa72a3084a 100644 --- a/lisp/progmodes/python.el +++ b/lisp/progmodes/python.el | |||
| @@ -50,7 +50,7 @@ | |||
| 50 | ;; (`python-nav-forward-sentence', `python-nav-backward-sentence' | 50 | ;; (`python-nav-forward-sentence', `python-nav-backward-sentence' |
| 51 | ;; respectively). Extra functions `python-nav-sentence-start' and | 51 | ;; respectively). Extra functions `python-nav-sentence-start' and |
| 52 | ;; `python-nav-sentence-end' are included to move to the beginning and | 52 | ;; `python-nav-sentence-end' are included to move to the beginning and |
| 53 | ;; to the end of a setence while taking care of multiline definitions. | 53 | ;; to the end of a sentence while taking care of multiline definitions. |
| 54 | ;; `python-nav-jump-to-defun' is provided and allows jumping to a | 54 | ;; `python-nav-jump-to-defun' is provided and allows jumping to a |
| 55 | ;; function or class definition quickly in the current buffer. | 55 | ;; function or class definition quickly in the current buffer. |
| 56 | 56 | ||
| @@ -126,7 +126,7 @@ | |||
| 126 | ;; "VIRTUAL_ENV=/path/to/env/")) | 126 | ;; "VIRTUAL_ENV=/path/to/env/")) |
| 127 | ;; (python-shell-exec-path . ("/path/to/env/bin/")) | 127 | ;; (python-shell-exec-path . ("/path/to/env/bin/")) |
| 128 | 128 | ||
| 129 | ;; Since the above is cumbersome and can be programatically | 129 | ;; Since the above is cumbersome and can be programmatically |
| 130 | ;; calculated, the variable `python-shell-virtualenv-path' is | 130 | ;; calculated, the variable `python-shell-virtualenv-path' is |
| 131 | ;; provided. When this variable is set with the path of the | 131 | ;; provided. When this variable is set with the path of the |
| 132 | ;; virtualenv to use, `process-environment' and `exec-path' get proper | 132 | ;; virtualenv to use, `process-environment' and `exec-path' get proper |
| @@ -426,7 +426,7 @@ This variant of `rx' supports common python named REGEXPS." | |||
| 426 | ;; Extra: | 426 | ;; Extra: |
| 427 | "__all__" "__doc__" "__name__" "__package__") | 427 | "__all__" "__doc__" "__name__" "__package__") |
| 428 | symbol-end) . font-lock-builtin-face) | 428 | symbol-end) . font-lock-builtin-face) |
| 429 | ;; asignations | 429 | ;; assignments |
| 430 | ;; support for a = b = c = 5 | 430 | ;; support for a = b = c = 5 |
| 431 | (,(lambda (limit) | 431 | (,(lambda (limit) |
| 432 | (let ((re (python-rx (group (+ (any word ?. ?_))) | 432 | (let ((re (python-rx (group (+ (any word ?. ?_))) |
| @@ -703,7 +703,7 @@ START is the buffer position where the sexp starts." | |||
| 703 | ('inside-string | 703 | ('inside-string |
| 704 | (goto-char context-start) | 704 | (goto-char context-start) |
| 705 | (current-indentation)) | 705 | (current-indentation)) |
| 706 | ;; After backslash we have several posibilities | 706 | ;; After backslash we have several possibilities. |
| 707 | ('after-backslash | 707 | ('after-backslash |
| 708 | (cond | 708 | (cond |
| 709 | ;; Check if current line is a dot continuation. For this | 709 | ;; Check if current line is a dot continuation. For this |
| @@ -758,12 +758,12 @@ START is the buffer position where the sexp starts." | |||
| 758 | (current-column)))) | 758 | (current-column)))) |
| 759 | (t | 759 | (t |
| 760 | (forward-line -1) | 760 | (forward-line -1) |
| 761 | (goto-char (python-info-beginning-of-backlash)) | 761 | (goto-char (python-info-beginning-of-backslash)) |
| 762 | (if (save-excursion | 762 | (if (save-excursion |
| 763 | (and | 763 | (and |
| 764 | (forward-line -1) | 764 | (forward-line -1) |
| 765 | (goto-char | 765 | (goto-char |
| 766 | (or (python-info-beginning-of-backlash) (point))) | 766 | (or (python-info-beginning-of-backslash) (point))) |
| 767 | (python-info-line-ends-backslash-p))) | 767 | (python-info-line-ends-backslash-p))) |
| 768 | ;; The two previous lines ended in a backslash so we must | 768 | ;; The two previous lines ended in a backslash so we must |
| 769 | ;; respect previous line indentation. | 769 | ;; respect previous line indentation. |
| @@ -776,7 +776,7 @@ START is the buffer position where the sexp starts." | |||
| 776 | ;; correctly | 776 | ;; correctly |
| 777 | ('inside-paren | 777 | ('inside-paren |
| 778 | (cond | 778 | (cond |
| 779 | ;; If current line closes the outtermost open paren use the | 779 | ;; If current line closes the outermost open paren use the |
| 780 | ;; current indentation of the context-start line. | 780 | ;; current indentation of the context-start line. |
| 781 | ((save-excursion | 781 | ((save-excursion |
| 782 | (skip-syntax-forward "\s" (line-end-position)) | 782 | (skip-syntax-forward "\s" (line-end-position)) |
| @@ -1261,7 +1261,7 @@ Restart the python shell after changing this variable for it to take effect." | |||
| 1261 | 1261 | ||
| 1262 | (defcustom python-shell-send-setup-max-wait 5 | 1262 | (defcustom python-shell-send-setup-max-wait 5 |
| 1263 | "Seconds to wait for process output before code setup. | 1263 | "Seconds to wait for process output before code setup. |
| 1264 | If output is received before the especified time then control is | 1264 | If output is received before the specified time then control is |
| 1265 | returned in that moment and not after waiting." | 1265 | returned in that moment and not after waiting." |
| 1266 | :type 'integer | 1266 | :type 'integer |
| 1267 | :group 'python | 1267 | :group 'python |
| @@ -1811,7 +1811,7 @@ completions on the current context." | |||
| 1811 | (overlay-start comint-last-prompt-overlay) | 1811 | (overlay-start comint-last-prompt-overlay) |
| 1812 | (overlay-end comint-last-prompt-overlay)))) | 1812 | (overlay-end comint-last-prompt-overlay)))) |
| 1813 | (completion-context | 1813 | (completion-context |
| 1814 | ;; Check wether a prompt matches a pdb string, an import statement | 1814 | ;; Check whether a prompt matches a pdb string, an import statement |
| 1815 | ;; or just the standard prompt and use the correct | 1815 | ;; or just the standard prompt and use the correct |
| 1816 | ;; python-shell-completion-*-code string | 1816 | ;; python-shell-completion-*-code string |
| 1817 | (cond ((and (> (length python-shell-completion-pdb-string-code) 0) | 1817 | (cond ((and (> (length python-shell-completion-pdb-string-code) 0) |
| @@ -2474,7 +2474,7 @@ It can contain a \"%s\" which will be replaced with the root name." | |||
| 2474 | 2474 | ||
| 2475 | (defun python-imenu-make-element-tree (element-list full-element plain-index) | 2475 | (defun python-imenu-make-element-tree (element-list full-element plain-index) |
| 2476 | "Make a tree from plain alist of module names. | 2476 | "Make a tree from plain alist of module names. |
| 2477 | ELEMENT-LIST is the defun name splitted by \".\" and FULL-ELEMENT | 2477 | ELEMENT-LIST is the defun name split by \".\" and FULL-ELEMENT |
| 2478 | is the same thing, the difference is that FULL-ELEMENT remains | 2478 | is the same thing, the difference is that FULL-ELEMENT remains |
| 2479 | untouched in all recursive calls. | 2479 | untouched in all recursive calls. |
| 2480 | Argument PLAIN-INDEX is the calculated plain index used to build the tree." | 2480 | Argument PLAIN-INDEX is the calculated plain index used to build the tree." |
| @@ -2497,7 +2497,7 @@ Argument PLAIN-INDEX is the calculated plain index used to build the tree." | |||
| 2497 | (push (cons subelement-name subelement-point) | 2497 | (push (cons subelement-name subelement-point) |
| 2498 | python-imenu-index-alist) | 2498 | python-imenu-index-alist) |
| 2499 | (when (not (listp (cdr path-ref))) | 2499 | (when (not (listp (cdr path-ref))) |
| 2500 | ;; Modifiy root cdr to be a list | 2500 | ;; Modify root cdr to be a list. |
| 2501 | (setcdr path-ref | 2501 | (setcdr path-ref |
| 2502 | (list (cons (format python-imenu-subtree-root-label | 2502 | (list (cons (format python-imenu-subtree-root-label |
| 2503 | (car path-ref)) | 2503 | (car path-ref)) |
| @@ -2644,8 +2644,8 @@ With optional argument LINE-NUMBER, check that line instead." | |||
| 2644 | (when (equal (char-before) ?\\) | 2644 | (when (equal (char-before) ?\\) |
| 2645 | (point-marker))))) | 2645 | (point-marker))))) |
| 2646 | 2646 | ||
| 2647 | (defun python-info-beginning-of-backlash (&optional line-number) | 2647 | (defun python-info-beginning-of-backslash (&optional line-number) |
| 2648 | "Return the point where the backlashed line start. | 2648 | "Return the point where the backslashed line start. |
| 2649 | Optional argument LINE-NUMBER forces the line number to check against." | 2649 | Optional argument LINE-NUMBER forces the line number to check against." |
| 2650 | (save-excursion | 2650 | (save-excursion |
| 2651 | (save-restriction | 2651 | (save-restriction |