From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Paul Eggert Newsgroups: gmane.emacs.bugs Subject: bug#12215: CSET is unnecessarily confusing Date: Fri, 24 Aug 2012 10:19:34 -0700 Organization: UCLA Computer Science Department Message-ID: <5037B7A6.5030202@cs.ucla.edu> References: <502D8A95.7060609@cs.ucla.edu> <5034511B.7010409@cs.ucla.edu> <50350A4C.5050103@cs.ucla.edu> <87fw7d3qan.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1345828836 861 80.91.229.3 (24 Aug 2012 17:20:36 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 24 Aug 2012 17:20:36 +0000 (UTC) Cc: Tom Tromey , Chong Yidong , 12215@debbugs.gnu.org, Dmitry Antipov To: Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Aug 24 19:20:35 2012 Return-path: Envelope-to: geb-bug-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 1T4xYf-00036c-3P for geb-bug-gnu-emacs@m.gmane.org; Fri, 24 Aug 2012 19:20:33 +0200 Original-Received: from localhost ([::1]:53255 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T4xYd-0004Ks-Al for geb-bug-gnu-emacs@m.gmane.org; Fri, 24 Aug 2012 13:20:31 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:58620) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T4xYa-0004Kl-Re for bug-gnu-emacs@gnu.org; Fri, 24 Aug 2012 13:20:29 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1T4xYX-0001Uv-Pj for bug-gnu-emacs@gnu.org; Fri, 24 Aug 2012 13:20:28 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:37621) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T4xYX-0001Ue-M1 for bug-gnu-emacs@gnu.org; Fri, 24 Aug 2012 13:20:25 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1T4xZ8-0006E7-15 for bug-gnu-emacs@gnu.org; Fri, 24 Aug 2012 13:21:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Paul Eggert Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 24 Aug 2012 17:21:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 12215 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 12215-submit@debbugs.gnu.org id=B12215.134582882323887 (code B ref 12215); Fri, 24 Aug 2012 17:21:01 +0000 Original-Received: (at 12215) by debbugs.gnu.org; 24 Aug 2012 17:20:23 +0000 Original-Received: from localhost ([127.0.0.1]:47167 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1T4xYU-0006DE-Bi for submit@debbugs.gnu.org; Fri, 24 Aug 2012 13:20:23 -0400 Original-Received: from smtp.cs.ucla.edu ([131.179.128.62]:46412) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1T4xYR-0006D5-F2 for 12215@debbugs.gnu.org; Fri, 24 Aug 2012 13:20:20 -0400 Original-Received: from localhost (localhost.localdomain [127.0.0.1]) by smtp.cs.ucla.edu (Postfix) with ESMTP id D2DCF39E8019; Fri, 24 Aug 2012 10:19:41 -0700 (PDT) X-Virus-Scanned: amavisd-new at smtp.cs.ucla.edu Original-Received: from smtp.cs.ucla.edu ([127.0.0.1]) by localhost (smtp.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id n-H+IV8N49xI; Fri, 24 Aug 2012 10:19:41 -0700 (PDT) Original-Received: from [192.168.1.3] (pool-108-23-119-2.lsanca.fios.verizon.net [108.23.119.2]) by smtp.cs.ucla.edu (Postfix) with ESMTPSA id C637239E8017; Fri, 24 Aug 2012 10:19:40 -0700 (PDT) User-Agent: Mozilla/5.0 (X11; Linux i686; rv:14.0) Gecko/20120714 Thunderbird/14.0 In-Reply-To: X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:63458 Archived-At: [Tom, I'm CC'ing you as this discussion is veering into concurrency. For context please see .] On 08/24/2012 08:10 AM, Stefan Monnier wrote: > The BVAR accessor macro is not for the GC but for the concurrency code. How exactly does that work? I just now looked at the concurrency branch and its BVAR is the same as in the trunk. Is BVAR a speculative change, that was put in because eventually we thought we'd need it for concurrency? If so, perhaps we should revert it until the need is demonstrated. After all, it's been many months since BVAR went in, and the concurrency branch still isn't really using it. > And yes, I think that BVAR(foo->bar) can be sufficient for the > concurrency code (it can be macro-expanded to buffer_var(foo->bar, > current_thread)), assuming we change all buffer slots to be of a new > type, which is a table from thread_ids to Lisp_Object. In that case we shouldn't need BVAR. Instead, we can do something like this: #define backed_up backed_up_table[current_thread->id] #define save_length save_length_table[current_thread->id] ... and then instead of this: bset_save_length (b, Fadd1 (BVAR (b, save_length))); code can just go back to what it used to do: b->save_length = Fadd1 (b->save_length); which is considerably more readable. If you like, we could use a different naming convention for these special slots, to give the reader a clue that the slots are actually thread-local. But the point is that we shouldn't need BVAR or BSET. > For the setters, I think we'll be better off with either > BSET (b->directory, val), or BSET (b, ->directory, val), which restricts > the form that can be used. Wouldn't the above approach work for setters too? The concurrency branch's BSET macro is also identical to that of the trunk, so it's hard to see what the plan is here ...