aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMark Oteiza2015-09-20 15:20:36 -0400
committerMark Oteiza2015-09-20 22:39:35 -0400
commitdadcf33984391a285ef0b161c1122864264e4386 (patch)
treeaa2f6e174c6205496edbbadf571cb35f7793ce3a
parentdd1e6846198e559b1c2ca321a1e6f8b05945fd66 (diff)
downloademacs-dadcf33984391a285ef0b161c1122864264e4386.tar.gz
emacs-dadcf33984391a285ef0b161c1122864264e4386.zip
Add prettify symbols to python-mode
lisp/progmodes/python.el (python-prettify-symbols-alist): New variable lisp/progmodes/python.el (python-mode): Use it
-rw-r--r--lisp/progmodes/python.el8
1 files changed, 8 insertions, 0 deletions
diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el
index 243125e310c..4fdf2ca8542 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" . ?\u03bb)
625 ("and" . ?\u2227)
626 ("or" . ?\u2228)))
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
@@ -5104,6 +5109,9 @@ returned as is."
5104 "`outline-level' function for Python mode." 5109 "`outline-level' function for Python mode."
5105 (1+ (/ (current-indentation) python-indent-offset)))) 5110 (1+ (/ (current-indentation) python-indent-offset))))
5106 5111
5112 (set (make-local-variable 'prettify-symbols-alist)
5113 python--prettify-symbols-alist)
5114
5107 (python-skeleton-add-menu-items) 5115 (python-skeleton-add-menu-items)
5108 5116
5109 (make-local-variable 'python-shell-internal-buffer) 5117 (make-local-variable 'python-shell-internal-buffer)