emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Watchpoints for emacs lisp.


From: Stefan Monnier
Subject: Re: Watchpoints for emacs lisp.
Date: Tue, 11 May 2010 10:10:34 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux)

> I insert to the struct Lisp_Symbol a field :watched: .

No, that would add 8 more bytes to every symbol for a feature that's
almost never used.

I think a good starting point is to use the existing `constant'
field and just add a special WATCHED value to it (it already has 2bits
but only uses 1, so you don't even need to make the field any larger).

Then you just need to check all places where this `constant' field is
used and make them react appropriately (which may mean "don't do
anything since it's already signalling an error" in many places).

And then you need to add functions to set/clear this `watched' attribute.

> I write a function whose input it a string S. This function looks for the
> given symbol in the corresponding obarray (global and local environment).

No, don't take a string as argument: take a symbol.

> Is it ok the algorithm ? In how many obarrays should I look for the given
> symbol ?

If your arg is a symbol instead of a string, this question is
trivially solved.


        Stefan



reply via email to

[Prev in Thread] Current Thread [Next in Thread]