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: testcover: setf-method and treatment of `defcustom' Date: Thu, 13 Sep 2012 09:09:13 -0400 Message-ID: References: <6900.1347261102@theowa.merten-home.homelinux.org> <7050.1347482308@theowa.merten-home.homelinux.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1347541773 10716 80.91.229.3 (13 Sep 2012 13:09:33 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 13 Sep 2012 13:09:33 +0000 (UTC) Cc: Jonathan Yavner , emacs-devel@gnu.org To: Stefan Merten Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Sep 13 15:09:36 2012 Return-path: Envelope-to: ged-emacs-devel@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 1TC9Ak-0001FA-Sw for ged-emacs-devel@m.gmane.org; Thu, 13 Sep 2012 15:09:35 +0200 Original-Received: from localhost ([::1]:56977 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TC9Ah-0003od-35 for ged-emacs-devel@m.gmane.org; Thu, 13 Sep 2012 09:09:31 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:35124) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TC9AZ-0003m5-MO for emacs-devel@gnu.org; Thu, 13 Sep 2012 09:09:29 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TC9AQ-0005i2-7o for emacs-devel@gnu.org; Thu, 13 Sep 2012 09:09:23 -0400 Original-Received: from ironport2-out.teksavvy.com ([206.248.154.182]:63658) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TC9AQ-0005hy-3N for emacs-devel@gnu.org; Thu, 13 Sep 2012 09:09:14 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Av0EAG6Zu09MCqmt/2dsb2JhbABEtBGBCIIVAQEEAVYjEAsOJhIUGA0kiBwFugmQRAOjM4FYgwWBOho X-IronPort-AV: E=Sophos;i="4.75,637,1330923600"; d="scan'208";a="198236664" Original-Received: from 76-10-169-173.dsl.teksavvy.com (HELO pastel.home) ([76.10.169.173]) by ironport2-out.teksavvy.com with ESMTP/TLS/ADH-AES256-SHA; 13 Sep 2012 09:09:13 -0400 Original-Received: by pastel.home (Postfix, from userid 20848) id 4218459445; Thu, 13 Sep 2012 09:09:13 -0400 (EDT) In-Reply-To: <7050.1347482308@theowa.merten-home.homelinux.org> (Stefan Merten's message of "Wed, 12 Sep 2012 22:38:28 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.2.50 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 206.248.154.182 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:153280 Archived-At: >> Does one of the 2 patches work? > I'd need to compile and install an Emacs 24 version for this to try. Actually, not just "Emacs 24" but "Emacs trunk" because it uses gv.el which is new on the trunk. For older Emacsen, I'd have to use define-setf-expander which is a pain the rear. >> But your `(setf ,val ,store) will end up changing some temporary >> variable rather than changing the I'th slot of the A vector. > Oops. My intention with ",val" was to expand the original form before > binding it to val into this place so `setf' treats the original form. > May be that's not possible with `defsetf'. Indeed, that's not possible with `defsetf' which is macro designed specifically for setters that do not care about the shape of their argument, but only about the value they return. >> My 1st patch has the downside that it doesn't call testcover-after at all. >> The reason is that I don't know what VAL to set in IDX when we do >> things like (push VAL (testcover-after IDX PLACE)): should it be the >> value read before pushing VAL onto it, or the value set afterwards? > My cent: Before pushing VAL. AFAICS `testcover-after' needs to see > PLACE unmodified. So for (setf (testcover-after IDX PLACE) VAL), we should first read the value of PLACE, pass it to testcover-after, and then modify PLACE to have value VAL? Stefan