all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#28713: Inconvenient usage of defconst in python-mode
@ 2017-10-05 15:35 Lele Gaifax
  2017-10-05 23:42 ` Noam Postavsky
  0 siblings, 1 reply; 4+ messages in thread
From: Lele Gaifax @ 2017-10-05 15:35 UTC (permalink / raw)
  To: 28713

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.





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

end of thread, other threads:[~2017-10-08  0:11 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-10-05 15:35 bug#28713: Inconvenient usage of defconst in python-mode Lele Gaifax
2017-10-05 23:42 ` Noam Postavsky
2017-10-06  6:49   ` Eli Zaretskii
2017-10-08  0:11     ` Noam Postavsky

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.