From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Emanuel Berg Newsgroups: gmane.emacs.help Subject: Re: random color of variables in programming languages Date: Tue, 24 Dec 2013 20:31:18 +0100 Organization: Aioe.org NNTP Server Message-ID: <87d2km11wg.fsf@nl106-137-194.student.uu.se> References: <87txefid7c.fsf@nl106-137-194.student.uu.se> <87ppos2tie.fsf@nl106-137-194.student.uu.se> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1387913712 1233 80.91.229.3 (24 Dec 2013 19:35:12 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 24 Dec 2013 19:35:12 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Tue Dec 24 20:35:18 2013 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1VvXl8-0000xB-2V for geh-help-gnu-emacs@m.gmane.org; Tue, 24 Dec 2013 20:35:18 +0100 Original-Received: from localhost ([::1]:40216 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VvXl7-0006C2-Lb for geh-help-gnu-emacs@m.gmane.org; Tue, 24 Dec 2013 14:35:17 -0500 X-Received: by 10.205.34.71 with SMTP id sr7mr7094999bkb.4.1387913505330; Tue, 24 Dec 2013 11:31:45 -0800 (PST) Original-Path: usenet.stanford.edu!w6no245156wiw.0!news-out.google.com!m7ni3410wiy.1!nntp.google.com!feeder1.cambriumusenet.nl!82.197.223.108.MISMATCH!feeder2.cambriumusenet.nl!feed.tweaknews.nl!194.109.133.87.MISMATCH!newsfeed.xs4all.nl!newsfeed1.news.xs4all.nl!xs4all!news.stack.nl!aioe.org!.POSTED!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 45 Original-NNTP-Posting-Host: VVbyYd/iFZoeWNmD9i++cQ.user.speranza.aioe.org Original-X-Complaints-To: abuse@aioe.org User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) X-Notice: Filtered by postfilter v. 0.8.2 Cancel-Lock: sha1:Am06509659Qjq7tXGvwxoc3iZ3E= Mail-Copies-To: never Original-Xref: usenet.stanford.edu gnu.emacs.help:202885 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:95154 Archived-At: Luca Ferrari 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