aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/progmodes/python.el
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/progmodes/python.el')
-rw-r--r--lisp/progmodes/python.el22
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).
625QUOTE-CHAR is the quote char to count. Optional argument POINT is 630QUOTE-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.
3636Internally it uses the `python-pdbtrack-tracked-buffer' variable. 3641Internally it uses the `python-pdbtrack-tracked-buffer' variable.
3637Returns the tracked buffer." 3642Returns 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)