From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Filipp Gunbin Newsgroups: gmane.emacs.help Subject: Re: How to debug functions depending on (current-time)? Date: Thu, 16 Jul 2015 00:44:19 +0300 Message-ID: References: <87h9p5mb1t.fsf@mbork.pl> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1436996696 22978 80.91.229.3 (15 Jul 2015 21:44:56 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 15 Jul 2015 21:44:56 +0000 (UTC) Cc: Help Gnu Emacs mailing list To: Marcin Borkowski Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Jul 15 23:44:36 2015 Return-path: Envelope-to: geh-help-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 1ZFUTk-0003ew-3h for geh-help-gnu-emacs@m.gmane.org; Wed, 15 Jul 2015 23:44:36 +0200 Original-Received: from localhost ([::1]:37583 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZFUTj-0000Ba-Ht for geh-help-gnu-emacs@m.gmane.org; Wed, 15 Jul 2015 17:44:35 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:33312) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZFUTZ-0000BK-UR for help-gnu-emacs@gnu.org; Wed, 15 Jul 2015 17:44:26 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZFUTW-0003ng-Np for help-gnu-emacs@gnu.org; Wed, 15 Jul 2015 17:44:25 -0400 Original-Received: from out1-smtp.messagingengine.com ([66.111.4.25]:51408) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZFUTW-0003kV-Jh for help-gnu-emacs@gnu.org; Wed, 15 Jul 2015 17:44:22 -0400 Original-Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id 1507C20A0A for ; Wed, 15 Jul 2015 17:44:21 -0400 (EDT) Original-Received: from frontend1 ([10.202.2.160]) by compute1.internal (MEProxy); Wed, 15 Jul 2015 17:44:21 -0400 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=fastmail.fm; h=cc :content-type:date:from:in-reply-to:message-id:mime-version :references:subject:to:x-sasl-enc:x-sasl-enc; s=mesmtp; bh=lFt5h X9hOfWTT0fboRKYUATLQyM=; b=Y7PlDaWpJaCbE8ac3Cfwx8+8BIVl0n6S6wTz6 BuIIHz7Js1onpk1kedYTmWUXk+G/qlr9h99cUAswJ2MUecXq2z+4YS6GSVqpFVoo XVKPAygn1PhSkDsWwRAUq822wM02KFHt0Rj1rWPilrzkLxQUosGG6YPal8ZlJ2ly JitAY4= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-sasl-enc :x-sasl-enc; s=smtpout; bh=lFt5hX9hOfWTT0fboRKYUATLQyM=; b=OFqA0 /2UeYnefmw3p6MzPkkRb2dHMkLJYSkbNZuGTUJsUwQRZO1vq2o0tGvKuZFDXc9HJ VK5nxlnGwzoZOFyaqHRw+Da5pOUxAgDCSt02wBW5GYOxs8fSm5aZWcD5EP6+BxK5 fy0d7vciPqxXA6s337tEpx3jL3XmQZ4dyybVkM= X-Sasl-enc: RykMoqAVUm0HA8PLxfqxyAUeeoWueU/nIEAbPH7yc6uF 1436996660 Original-Received: from fgunbin.local (pppoe.178-66-139-213.dynamic.avangarddsl.ru [178.66.139.213]) by mail.messagingengine.com (Postfix) with ESMTPA id 5D4B5C00022; Wed, 15 Jul 2015 17:44:20 -0400 (EDT) In-Reply-To: <87h9p5mb1t.fsf@mbork.pl> (Marcin Borkowski's message of "Wed, 15 Jul 2015 22:16:14 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (darwin) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 66.111.4.25 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:105741 Archived-At: On 15/07/2015 22:16 +0200, Marcin Borkowski wrote: > Hi all, > > I have a bunch of functions depending on (current-time), and I'm > wondering how to test/debug them. Is it safe to (temporarily) redefine > `current-time'? Maybe it's better to do that in a separate Emacs > instance? I could of course change their source code for the time of > debugging, but this still lefts the problem of testing (esp. automatic > testing) open. As your code may use some builtin functions which use current-time, this won't be reliable. So I'd do what Pascal suggested. Filipp