From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "alin.s" Newsgroups: gmane.emacs.devel Subject: Re: Watchpoints for emacs lisp. Date: Sat, 15 May 2010 04:24:05 -0700 (PDT) Message-ID: <28567697.post@talk.nabble.com> References: <28512483.post@talk.nabble.com> <28523705.post@talk.nabble.com> <28567671.post@talk.nabble.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: dough.gmane.org 1273922655 11977 80.91.229.12 (15 May 2010 11:24:15 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sat, 15 May 2010 11:24:15 +0000 (UTC) To: Emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat May 15 13:24:14 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 1ODFTZ-0000Eh-VH for ged-emacs-devel@m.gmane.org; Sat, 15 May 2010 13:24:14 +0200 Original-Received: from localhost ([127.0.0.1]:40578 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1ODFTZ-0000Of-CX for ged-emacs-devel@m.gmane.org; Sat, 15 May 2010 07:24:13 -0400 Original-Received: from [140.186.70.92] (port=36605 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1ODFTU-0000Oa-0g for Emacs-devel@gnu.org; Sat, 15 May 2010 07:24:09 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1ODFTS-0002vq-E0 for Emacs-devel@gnu.org; Sat, 15 May 2010 07:24:07 -0400 Original-Received: from kuber.nabble.com ([216.139.236.158]:53121) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1ODFTS-0002vi-5b for Emacs-devel@gnu.org; Sat, 15 May 2010 07:24:06 -0400 Original-Received: from isper.nabble.com ([192.168.236.156]) by kuber.nabble.com with esmtp (Exim 4.63) (envelope-from ) id 1ODFTR-0000We-Js for Emacs-devel@gnu.org; Sat, 15 May 2010 04:24:05 -0700 In-Reply-To: <28567671.post@talk.nabble.com> X-Nabble-From: alinsoar@voila.fr X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) 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:124797 Archived-At: alin.s wrote: > > > > Stefan Monnier wrote: >> >>> I insert to the struct Lisp_Symbol a field :watched: . >> >> 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). >> >> > > Here is the symbol structure. Can you point your finger on the unused bit > ? > > > /* In a symbol, the markbit of the plist is used as the gc mark bit */ > > struct Lisp_Symbol > { > unsigned gcmarkbit : 1; > > /* Non-zero means symbol serves as a variable alias. The symbol > holding the real value is found in the value slot. */ > unsigned indirect_variable : 1; > > /* Non-zero means symbol is constant, i.e. changing its value > should signal an error. */ > unsigned constant : 1; > > /* Interned state of the symbol. This is an enumerator from > enum symbol_interned. */ > unsigned interned : 2; > > /* The symbol's name, as a Lisp string. > > The name "xname" is used to intentionally break code referring to > the old field "name" of type pointer to struct Lisp_String. */ > Lisp_Object xname; > > /* Value of the symbol or Qunbound if unbound. If this symbol is a > defvaralias, `value' contains the symbol for which it is an > alias. Use the SYMBOL_VALUE and SET_SYMBOL_VALUE macros to get > and set a symbol's value, to take defvaralias into account. */ > Lisp_Object value; > > /* Function value of the symbol or Qunbound if not fboundp. */ > Lisp_Object function; > > /* The symbol's property list. */ > Lisp_Object plist; > > /* Next symbol in obarray bucket, if the symbol is interned. */ > struct Lisp_Symbol *next; > }; > > I see 3 free bits here: 1+1+1+2 =5. (the bits 6-7-8 are free). Why do you say that it's impossible to insert a new field :watch: there ? It takes 2 values, so it will rest 2 free bits. -- View this message in context: http://old.nabble.com/Watchpoints-for-emacs-lisp.-tp28512483p28567697.html Sent from the Emacs - Dev mailing list archive at Nabble.com.