GNU bug report logs -
#28713
Inconvenient usage of defconst in python-mode
Previous Next
Reported by: Lele Gaifax <lele <at> metapensiero.it>
Date: Thu, 5 Oct 2017 15:36:01 UTC
Severity: minor
Tags: fixed, patch
Fixed in version 26.1
Done: Noam Postavsky <npostavs <at> users.sourceforge.net>
Bug is archived. No further changes may be made.
Full log
Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):
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 <at> metapensiero.it | -- Fortunato Depero, 1929.
This bug report was last modified 7 years and 223 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.