unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / 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: Tue, 24 Dec 2013 20:31:18 +0100	[thread overview]
Message-ID: <87d2km11wg.fsf@nl106-137-194.student.uu.se> (raw)
In-Reply-To: mailman.10142.1387810292.10748.help-gnu-emacs@gnu.org

Luca Ferrari <fluca1978@infinito.it> writes:

> Very good example, thanks.

Yes, the example is good (or at least interesting) but
I think to actually make it work would require some
work.

First problem is, when to update the table?

Could it be done periodically without slowing
everything down? Remember the idle-timer, that perhaps
is suitable for a thing like that.

Or, what about the method with abbrev, when instead of
inserting a word, you evaluate code, as in:

("word" "" (lambda ()
              (interactive)
              ;; do stuff ))

Say that you define a variable with `int' (as in C),
then you could add "int" as such an "abbrev", and that
word would set a flag that indicates that work must be
done. If the idle-timer executes, but that flag isn't
set, no work is done (and the flag is unset at the end
of a "work burst").

Second problem is, how to remove stuff from the table?
When an int var_digit; line is removed, should
highlighting be dropped from the "var_digit"? Really, I
don't know, perhaps it is only good that it still
sticks out because each occurrence is a likely bug at
that state.

Perhaps it is easiest to have a separate keyword table,
and for each update, erase the whole thing and build it
anew.

Anyway, if you do anything more on this, be sure to
tell us.

-- 
Emanuel Berg, programmer-for-rent. CV, projects, etc at uXu
underground experts united:  http://user.it.uu.se/~embe8573


  parent reply	other threads:[~2013-12-24 19:31 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 ` random color of variables in programming languages Emanuel Berg
2013-12-12 15:21   ` 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 [this message]
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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=87d2km11wg.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.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).