From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Lennart Borgman Newsgroups: gmane.emacs.help Subject: Re: Reset Emacs state Date: Tue, 2 Mar 2010 12:18:52 +0100 Message-ID: References: <929ccd881003020241g8fa36cdq6462baab058de215@mail.gmail.com> <929ccd881003020303w5b4635d8r6e452142e5076c35@mail.gmail.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Trace: dough.gmane.org 1267529195 8476 80.91.229.12 (2 Mar 2010 11:26:35 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Tue, 2 Mar 2010 11:26:35 +0000 (UTC) Cc: help-gnu-emacs@gnu.org To: Johan Andersson Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Tue Mar 02 12:26:31 2010 Return-path: Envelope-to: geh-help-gnu-emacs@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 1NmQFC-0004Qh-GP for geh-help-gnu-emacs@m.gmane.org; Tue, 02 Mar 2010 12:26:30 +0100 Original-Received: from localhost ([127.0.0.1]:43955 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NmQFB-00021h-Tz for geh-help-gnu-emacs@m.gmane.org; Tue, 02 Mar 2010 06:26:29 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NmQ8C-0005ff-RS for help-gnu-emacs@gnu.org; Tue, 02 Mar 2010 06:19:16 -0500 Original-Received: from [140.186.70.92] (port=37946 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NmQ8B-0005dh-3z for help-gnu-emacs@gnu.org; Tue, 02 Mar 2010 06:19:15 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1NmQ89-00043E-JC for help-gnu-emacs@gnu.org; Tue, 02 Mar 2010 06:19:14 -0500 Original-Received: from mail-fx0-f222.google.com ([209.85.220.222]:40109) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1NmQ89-000438-80 for help-gnu-emacs@gnu.org; Tue, 02 Mar 2010 06:19:13 -0500 Original-Received: by fxm22 with SMTP id 22so135289fxm.26 for ; Tue, 02 Mar 2010 03:19:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:cc:content-type :content-transfer-encoding; bh=yrxgNO+7gKq3GrnKom+KiEDYPO6QBUDlr8X90tsFjs8=; b=Mo1qWl2gnIqX2m2bxT5ryMJHstlMOUrL8dXXRgzwZl4V1o9sKCgBwygbdac7mJdSfp bifk4AYBhaiELSZTYu4k/Ze/30kWqHxHAGxuUyuRiN1cS0+o5xYOBM9ENQhnNyXXJJov AE56xMIIJyM/6RTYX5sZkX/1sztZbOI5Kzh8M= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type:content-transfer-encoding; b=VpnpbbmmXqX88LvGUSqEKFR1+e06G3p/SsMrvIFdABIcivnyTsw6H8BjkeSkchxRJd 0nEQ0azbelXHbV5n9MOtbyMksNMWbI5X3EGUO1Y3JnIriAXpn0cNicdQpTfPDUNEwHZ8 q6AwLyqwpqGHeoW60ZXhcDp5k7Tas6SyvYRAs= Original-Received: by 10.239.189.80 with SMTP id s16mr606772hbh.43.1267528752146; Tue, 02 Mar 2010 03:19:12 -0800 (PST) In-Reply-To: <929ccd881003020303w5b4635d8r6e452142e5076c35@mail.gmail.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:72298 Archived-At: On Tue, Mar 2, 2010 at 12:03 PM, Johan Andersson w= rote: > You mean like this? > =C2=A0=C2=A0(setq var "some value...") > =C2=A0=C2=A0(let ((var "some other value...")) > =C2=A0=C2=A0 =C2=A0;; Use var with some other value > =C2=A0=C2=A0 =C2=A0) > =C2=A0=C2=A0;; Use var with original value > That would only work if I knew the variable names that I would set in the > test, right? And that wont work... Yes, you are right. However that is not a serious problem (as long as you are not testing display things). You can always collect the result to your current Emacs. For an example of how to implement this see for example web-vcs-byte-compile-file in nXhtml. (Which essentially just locates the current Emacs executable and calls call-process.) > On Tue, Mar 2, 2010 at 10:50 AM, Lennart Borgman > wrote: >> >> On Tue, Mar 2, 2010 at 11:41 AM, Johan Andersson >> wrote: >> > Hey, >> > I'm looking for a way to reset Emacs. By reset I mean like something y= ou >> > would want to do in a testing framework. So if you set a variable in o= ne >> > test, it will not be set in the next. >> > The only way I find this possible is to run each test as a Emacs Batch >> > script: >> > (dolist (test tests) >> > =C2=A0=C2=A0(shell-command "./run-test")) >> > I guess that would work. However, there is a problem with this.=C2=A0r= un-test >> > does not have the=C2=A0test object. I could solve that by for each tes= t >> > output >> > the object to a file and then read it in run-test. >> > This solution seems rather clumpy though and I'm wondering if you can >> > think >> > of any good way to do it. >> >> >> Dynamic scoping? > >