all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Emanuel Berg <embe8573@student.uu.se>
To: help-gnu-emacs@gnu.org
Subject: Re: random color of variables in programming languages
Date: Wed, 11 Dec 2013 17:06:38 +0100	[thread overview]
Message-ID: <87txefid7c.fsf@nl106-137-194.student.uu.se> (raw)
In-Reply-To: mailman.8911.1386765750.10748.help-gnu-emacs@gnu.org

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


       reply	other threads:[~2013-12-11 16:06 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <mailman.8911.1386765750.10748.help-gnu-emacs@gnu.org>
2013-12-11 16:06 ` Emanuel Berg [this message]
2013-12-12 15:21   ` random color of variables in programming languages Luca Ferrari
     [not found]   ` <mailman.9022.1386861695.10748.help-gnu-emacs@gnu.org>
2013-12-12 21:05     ` Emanuel Berg
2013-12-20  1:36     ` Emanuel Berg
2013-12-23 14:51       ` Luca Ferrari
     [not found]       ` <mailman.10142.1387810292.10748.help-gnu-emacs@gnu.org>
2013-12-24 19:31         ` Emanuel Berg
2013-12-11 12:42 Luca Ferrari

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87txefid7c.fsf@nl106-137-194.student.uu.se \
    --to=embe8573@student.uu.se \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.