[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH] Add prettify symbols to python-mode
From: |
Mark Oteiza |
Subject: |
[PATCH] Add prettify symbols to python-mode |
Date: |
Sun, 20 Sep 2015 15:28:03 -0400 |
lisp/progmodes/python.el (python-prettify-symbols-alist): New variable
lisp/progmodes/python.el (python-mode): Use it
---
lisp/progmodes/python.el | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el
index 243125e..0837919 100644
--- a/lisp/progmodes/python.el
+++ b/lisp/progmodes/python.el
@@ -620,6 +620,11 @@ The type returned can be `comment', `string' or `paren'."
((python-rx string-delimiter)
(0 (ignore (python-syntax-stringify))))))
+(defconst python-prettify-symbols-alist
+ '(("lambda" . ?\u03bb)
+ ("and" . ?\u2227)
+ ("or" . ?\u2228)))
+
(defsubst python-syntax-count-quotes (quote-char &optional point limit)
"Count number of quotes around point (max is 3).
QUOTE-CHAR is the quote char to count. Optional argument POINT is
@@ -5104,6 +5109,9 @@ returned as is."
"`outline-level' function for Python mode."
(1+ (/ (current-indentation) python-indent-offset))))
+ (set (make-local-variable 'prettify-symbols-alist)
+ python-prettify-symbols-alist)
+
(python-skeleton-add-menu-items)
(make-local-variable 'python-shell-internal-buffer)
--
2.5.3
- [PATCH] Add prettify symbols to python-mode,
Mark Oteiza <=
- Re: [PATCH] Add prettify symbols to python-mode, Xue Fuqiao, 2015/09/20
- Re: [PATCH] Add prettify symbols to python-mode, Mark Oteiza, 2015/09/20
- Re: [PATCH] Add prettify symbols to python-mode, Stefan Monnier, 2015/09/20
- Re: [PATCH] Add prettify symbols to python-mode, Richard Stallman, 2015/09/22
- Re: [PATCH] Add prettify symbols to python-mode, Stefan Monnier, 2015/09/22
- Re: [PATCH] Add prettify symbols to python-mode, Rasmus, 2015/09/22
- Re: [PATCH] Add prettify symbols to python-mode, Richard Stallman, 2015/09/22
- Re: [PATCH] Add prettify symbols to python-mode, Achim Gratz, 2015/09/23
- Re: [PATCH] Add prettify symbols to python-mode, Eli Zaretskii, 2015/09/23
- Re: [PATCH] Add prettify symbols to python-mode, David Kastrup, 2015/09/23