From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: Watchpoints for emacs lisp. Date: Tue, 11 May 2010 10:10:34 -0400 Message-ID: References: <28512483.post@talk.nabble.com> <28523705.post@talk.nabble.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: dough.gmane.org 1273587080 1479 80.91.229.12 (11 May 2010 14:11:20 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Tue, 11 May 2010 14:11:20 +0000 (UTC) Cc: Emacs-devel@gnu.org To: "alin.s" Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue May 11 16:11:17 2010 connect(): No such file or directory Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1OBqB2-0006pO-JQ for ged-emacs-devel@m.gmane.org; Tue, 11 May 2010 16:11:16 +0200 Original-Received: from localhost ([127.0.0.1]:33436 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OBqB2-0004ye-1Z for ged-emacs-devel@m.gmane.org; Tue, 11 May 2010 10:11:16 -0400 Original-Received: from [140.186.70.92] (port=53610 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OBqAP-0004ke-9Z for Emacs-devel@gnu.org; Tue, 11 May 2010 10:10:38 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OBqAN-00030F-OT for Emacs-devel@gnu.org; Tue, 11 May 2010 10:10:37 -0400 Original-Received: from ironport2-out.teksavvy.com ([206.248.154.181]:65290 helo=ironport2-out.pppoe.ca) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OBqAN-000302-Kf for Emacs-devel@gnu.org; Tue, 11 May 2010 10:10:35 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AvsEANsB6UtLd+Zs/2dsb2JhbACeKnK7MoUQBIwx X-IronPort-AV: E=Sophos;i="4.53,207,1272859200"; d="scan'208";a="63897915" Original-Received: from 75-119-230-108.dsl.teksavvy.com (HELO pastel.home) ([75.119.230.108]) by ironport2-out.pppoe.ca with ESMTP; 11 May 2010 10:10:34 -0400 Original-Received: by pastel.home (Postfix, from userid 20848) id 7FE6880B1; Tue, 11 May 2010 10:10:34 -0400 (EDT) In-Reply-To: <28523705.post@talk.nabble.com> (alin s.'s message of "Tue, 11 May 2010 05:54:24 -0700 (PDT)") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:124705 Archived-At: > 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