diff options
| author | K. Handa | 2015-09-27 17:06:12 +0900 |
|---|---|---|
| committer | K. Handa | 2015-09-27 17:06:12 +0900 |
| commit | 52beda922d2cb523a03661bf74b8678c8b45e440 (patch) | |
| tree | 04617b37298746a61d5324a5b35c9b71f439d762 /lisp/progmodes/python.el | |
| parent | 94ed5167557112fb00eeca05e62589db744206de (diff) | |
| parent | 1ac5a9c20cb22efb398fa18781c6b932dd4e54df (diff) | |
| download | emacs-52beda922d2cb523a03661bf74b8678c8b45e440.tar.gz emacs-52beda922d2cb523a03661bf74b8678c8b45e440.zip | |
Merge branch 'master' of git.sv.gnu.org:/srv/git/emacs
Diffstat (limited to 'lisp/progmodes/python.el')
| -rw-r--r-- | lisp/progmodes/python.el | 22 |
1 files changed, 18 insertions, 4 deletions
diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el index 9528ffeebbc..b641e300163 100644 --- a/lisp/progmodes/python.el +++ b/lisp/progmodes/python.el | |||
| @@ -620,6 +620,11 @@ The type returned can be `comment', `string' or `paren'." | |||
| 620 | ((python-rx string-delimiter) | 620 | ((python-rx string-delimiter) |
| 621 | (0 (ignore (python-syntax-stringify)))))) | 621 | (0 (ignore (python-syntax-stringify)))))) |
| 622 | 622 | ||
| 623 | (defconst python--prettify-symbols-alist | ||
| 624 | '(("lambda" . ?λ) | ||
| 625 | ("and" . ?∧) | ||
| 626 | ("or" . ?∨))) | ||
| 627 | |||
| 623 | (defsubst python-syntax-count-quotes (quote-char &optional point limit) | 628 | (defsubst python-syntax-count-quotes (quote-char &optional point limit) |
| 624 | "Count number of quotes around point (max is 3). | 629 | "Count number of quotes around point (max is 3). |
| 625 | QUOTE-CHAR is the quote char to count. Optional argument POINT is | 630 | QUOTE-CHAR is the quote char to count. Optional argument POINT is |
| @@ -3635,12 +3640,18 @@ Never set this variable directly, use | |||
| 3635 | "Set the buffer for FILE-NAME as the tracked buffer. | 3640 | "Set the buffer for FILE-NAME as the tracked buffer. |
| 3636 | Internally it uses the `python-pdbtrack-tracked-buffer' variable. | 3641 | Internally it uses the `python-pdbtrack-tracked-buffer' variable. |
| 3637 | Returns the tracked buffer." | 3642 | Returns the tracked buffer." |
| 3638 | (let ((file-buffer (get-file-buffer | 3643 | (let* ((file-name-prospect (concat (file-remote-p default-directory) |
| 3639 | (concat (file-remote-p default-directory) | 3644 | file-name)) |
| 3640 | file-name)))) | 3645 | (file-buffer (get-file-buffer file-name-prospect))) |
| 3641 | (if file-buffer | 3646 | (if file-buffer |
| 3642 | (setq python-pdbtrack-tracked-buffer file-buffer) | 3647 | (setq python-pdbtrack-tracked-buffer file-buffer) |
| 3643 | (setq file-buffer (find-file-noselect file-name)) | 3648 | (cond |
| 3649 | ((file-exists-p file-name-prospect) | ||
| 3650 | (setq file-buffer (find-file-noselect file-name-prospect))) | ||
| 3651 | ((and (not (equal file-name file-name-prospect)) | ||
| 3652 | (file-exists-p file-name)) | ||
| 3653 | ;; Fallback to a locally available copy of the file. | ||
| 3654 | (setq file-buffer (find-file-noselect file-name-prospect)))) | ||
| 3644 | (when (not (member file-buffer python-pdbtrack-buffers-to-kill)) | 3655 | (when (not (member file-buffer python-pdbtrack-buffers-to-kill)) |
| 3645 | (add-to-list 'python-pdbtrack-buffers-to-kill file-buffer))) | 3656 | (add-to-list 'python-pdbtrack-buffers-to-kill file-buffer))) |
| 3646 | file-buffer)) | 3657 | file-buffer)) |
| @@ -5098,6 +5109,9 @@ returned as is." | |||
| 5098 | "`outline-level' function for Python mode." | 5109 | "`outline-level' function for Python mode." |
| 5099 | (1+ (/ (current-indentation) python-indent-offset)))) | 5110 | (1+ (/ (current-indentation) python-indent-offset)))) |
| 5100 | 5111 | ||
| 5112 | (set (make-local-variable 'prettify-symbols-alist) | ||
| 5113 | python--prettify-symbols-alist) | ||
| 5114 | |||
| 5101 | (python-skeleton-add-menu-items) | 5115 | (python-skeleton-add-menu-items) |
| 5102 | 5116 | ||
| 5103 | (make-local-variable 'python-shell-internal-buffer) | 5117 | (make-local-variable 'python-shell-internal-buffer) |