all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* [PATCH] Add prettify symbols to python-mode
@ 2015-09-20 19:28 Mark Oteiza
  2015-09-20 22:48 ` Xue Fuqiao
  0 siblings, 1 reply; 38+ messages in thread
From: Mark Oteiza @ 2015-09-20 19:28 UTC (permalink / raw)
  To: emacs-devel; +Cc: Mark Oteiza

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




^ permalink raw reply related	[flat|nested] 38+ messages in thread

end of thread, other threads:[~2015-09-28  7:17 UTC | newest]

Thread overview: 38+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-09-20 19:28 [PATCH] Add prettify symbols to python-mode Mark Oteiza
2015-09-20 22:48 ` Xue Fuqiao
2015-09-21  0:53   ` Mark Oteiza
2015-09-21  2:20     ` Stefan Monnier
2015-09-22  6:55       ` Richard Stallman
2015-09-22 12:44         ` Stefan Monnier
2015-09-22 14:42           ` Rasmus
2015-09-22 22:02           ` Richard Stallman
2015-09-23  6:22           ` Achim Gratz
2015-09-23  7:13             ` Eli Zaretskii
2015-09-23  8:04               ` David Kastrup
2015-09-23 14:12               ` Xue Fuqiao
2015-09-23 16:15                 ` Eli Zaretskii
2015-09-23 16:52                   ` David Kastrup
2015-09-23 17:09                     ` Eli Zaretskii
2015-09-23 17:58                       ` David Kastrup
2015-09-23 19:24                         ` Eli Zaretskii
2015-09-23 19:39                           ` David Kastrup
2015-09-23 19:48                             ` Eli Zaretskii
2015-09-23 19:56                               ` David Kastrup
2015-09-23 20:04                                 ` Eli Zaretskii
2015-09-23 20:10                                   ` David Kastrup
2015-09-23 19:38                         ` Paul Eggert
2015-09-23 19:46                           ` David Kastrup
2015-09-23 20:15                             ` Paul Eggert
2015-09-23 21:40                               ` David Kastrup
2015-09-24  1:16                                 ` Stephen J. Turnbull
2015-09-24  3:57                   ` Xue Fuqiao
2015-09-24 14:31                     ` Eli Zaretskii
2015-09-23 19:07               ` Achim Gratz
2015-09-23 19:42                 ` Eli Zaretskii
2015-09-24  8:06               ` Xue Fuqiao
2015-09-24  8:35                 ` David Kastrup
2015-09-24 10:33                   ` Kaushal Modi
2015-09-24 14:32                     ` Eli Zaretskii
2015-09-24 13:06                   ` Xue Fuqiao
2015-09-24 14:32                   ` Eli Zaretskii
2015-09-28  7:17             ` Dmitry Gutov

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.