bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#28713: Inconvenient usage of defconst in python-mode


From: Lele Gaifax
Subject: bug#28713: Inconvenient usage of defconst in python-mode
Date: Thu, 05 Oct 2017 17:35:04 +0200

In Emacs 25+, to be exact after commit
dadcf33984391a285ef0b161c1122864264e4386, python-mode uses a defconst to
define the value of `python--prettify-symbols-alist':

  (defconst python--prettify-symbols-alist
    '(("lambda"  . ?\u03bb)
      ("and" . ?\u2227)
      ("or" . ?\u2228)))

that is used just once in the major mode initializer:

  (set (make-local-variable 'prettify-symbols-alist)
       python--prettify-symbols-alist)

While the replacement for "lambda" is pretty, I find the other two quite
unreadable. To get rid of those I cannot simply customize the alist, but I
have to do something like the following in one of my python-mode-hooks:

  ;; Prettify only lambda keyword
  (setq prettify-symbols-alist '(("lambda" . ?λ)))

  ;; Force a refresh
  (prettify-symbols-mode -1)
  (prettify-symbols-mode))

This is of course a minor hassle, but I wonder if the major mode could/should
use a normal variable (if not a defcustom) instead.

Thanks&bye, lele.
-- 
nickname: Lele Gaifax | Quando vivrò di quello che ho pensato ieri
real: Emanuele Gaifas | comincerò ad aver paura di chi mi copia.
lele@metapensiero.it  |                 -- Fortunato Depero, 1929.





reply via email to

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