emacs-devel
[Top][All Lists]
Advanced

[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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]