[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: random color of variables in programming languages
From: |
Emanuel Berg |
Subject: |
Re: random color of variables in programming languages |
Date: |
Wed, 11 Dec 2013 17:06:38 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/23.4 (gnu/linux) |
Luca Ferrari <fluca1978@infinito.it> writes:
> Hi all, anyone knows about an Emacs extension so that
> in different programming languages (e.g., C/C++)
> variables are assigned a different random color like
> KDevelop does?
I don't know. That seems like a cool idea though. Then
you would see (i.e., not read) all the occurrences of
that variable at once. However I don't know how it
would work in practice. Perhaps you would just get
dizzy. With lots of parameters, perhaps it is better to
have them a uniform color, to make a really clear
separation what is data and what is metadata,
branching, etc.
If you were to put it up, I wouldn't recommend random
colors, instead you could use the variable *name* (the
letters) as function input to be mapped to colors: the
first letter - the ASCII position, "normalized" - could
be red, the second - same for green - etc.
First step if you were to do this would be to examine
how colors are setup to begin with. Instead of the
static color, you would hook a defun to calculate the
color based on the variable name.
--
Emanuel Berg, programmer-for-rent. CV, projects, etc at uXu
underground experts united: http://user.it.uu.se/~embe8573