From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Oleg Sivokon Newsgroups: gmane.emacs.bugs Subject: bug#24959: 26.0.50; cancel-timer: void-variable timer Date: Thu, 17 Nov 2016 20:06:40 +0200 Message-ID: References: <874m36sahw.fsf@localhost.localdomain> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Trace: blaine.gmane.org 1479406170 13857 195.159.176.226 (17 Nov 2016 18:09:30 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Thu, 17 Nov 2016 18:09:30 +0000 (UTC) Cc: 24959@debbugs.gnu.org To: Lars Ingebrigtsen Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Nov 17 19:09:25 2016 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c7R7l-0003CY-4h for geb-bug-gnu-emacs@m.gmane.org; Thu, 17 Nov 2016 19:09:25 +0100 Original-Received: from localhost ([::1]:60769 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1c7R7m-0001sl-Sw for geb-bug-gnu-emacs@m.gmane.org; Thu, 17 Nov 2016 13:09:26 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:48692) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1c7R5V-0000Ao-N7 for bug-gnu-emacs@gnu.org; Thu, 17 Nov 2016 13:07:08 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1c7R5S-0002cM-57 for bug-gnu-emacs@gnu.org; Thu, 17 Nov 2016 13:07:05 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:45533) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1c7R5S-0002cA-1a for bug-gnu-emacs@gnu.org; Thu, 17 Nov 2016 13:07:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1c7R5R-0000Ne-Me for bug-gnu-emacs@gnu.org; Thu, 17 Nov 2016 13:07:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Oleg Sivokon Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 17 Nov 2016 18:07:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 24959 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 24959-submit@debbugs.gnu.org id=B24959.14794060121447 (code B ref 24959); Thu, 17 Nov 2016 18:07:01 +0000 Original-Received: (at 24959) by debbugs.gnu.org; 17 Nov 2016 18:06:52 +0000 Original-Received: from localhost ([127.0.0.1]:60932 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c7R5H-0000NG-6M for submit@debbugs.gnu.org; Thu, 17 Nov 2016 13:06:51 -0500 Original-Received: from mail-qt0-f199.google.com ([209.85.216.199]:39669) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c7R5C-0000N0-Eq for 24959@debbugs.gnu.org; Thu, 17 Nov 2016 13:06:49 -0500 Original-Received: by mail-qt0-f199.google.com with SMTP id x26so85991664qtb.6 for <24959@debbugs.gnu.org>; Thu, 17 Nov 2016 10:06:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=elastifile-com.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=sm13RoqO+PXh62nQueIwx0FP1grJhpjebDomVIUtcw8=; b=hjXWiqdHVV90XoEMlnfiTXbibBf6JRPKwdM5m0fGQDnMIUwn9XhkRyRWYZle7pK/Bi +sqj1SjbcBNjGAJ/Y0BilSL7R0abFy8swZjzqKEmOQ096FPsZY6eH0lXy4q1st0+OiDc aOc3vqoXuG1LgutDR/ELp99XD4pVuiLfC+mwYCMqWMR1EcqAfOfC4ryzrMB8CbI1swrV HTMhENyVjQ8A6ASyIZZF0k34qrksLS19mzi2jevcrRQLwm6X+4Zl0hNI7Cef8j6aCluQ litukmpOTr/UikvpLjMKjNTGtXIgPuu7P1B0QawP/xmvwC7VJJQ4NAV44a0VpkNAkzlh Mtbw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=sm13RoqO+PXh62nQueIwx0FP1grJhpjebDomVIUtcw8=; b=FBK5HBubEt243aFkoHzhyYBVqrsueMdljElduiSF+SZb4/Dz7yLpSxYIXxUD55hmnC gYSYr/DlRoMDAmS1BJY0eFPn2w6o5b/L/+9Ivyg1QKp9ilx+a25GtutPUvbegxZKkq5l p7TCBtr2bx8igTCZC67lg0k4Wjzna6fckOyNUGKYHNka5Kx2zedBNDDHDSP2ZmLasgj8 +N+i3YFdreX5b8YZkltz3iGPJzV/cx18g6QZabWDbBZj3qXSlteWhC+KyaCZ6ffUDT61 7gUgLy3DVH55ZhxcR3yW583Kk3b0lHBGPWTSonyojLSh4Mnn4yWMN25BXPTus8yZhVg7 JvkQ== X-Gm-Message-State: AKaTC03uSXCZOzJhE3WIaELhYtRGCTbSShXpXtQcG/R3szEG5KfnVaYTuabDr2JRu664fvaNK1UrMF35ZGSuvLcg X-Received: by 10.55.16.147 with SMTP id 19mr4806932qkq.255.1479406000974; Thu, 17 Nov 2016 10:06:40 -0800 (PST) Original-Received: by 10.237.33.34 with HTTP; Thu, 17 Nov 2016 10:06:40 -0800 (PST) In-Reply-To: X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.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" Xref: news.gmane.org gmane.emacs.bugs:125795 Archived-At: Lars, No, I don't use lexical bindings in this code. But, my point is that the behavior of setq used to be to make variable special (i.e. universaly accessible, like global, except it can be let-bound temporarily), which it doesn't seem to do anymore. Is this change intentional? I still didn't go over the entire changelog, but on the surface of it, I didn't see this mentioned. On Thu, Nov 17, 2016 at 8:03 PM, Lars Ingebrigtsen wrote: > Oleg Sivokon writes: > >> Lars, >> >> Simplified version looks like this: >> >> (setq timer (run-at-time 1 1 (lambda () (cancel-timer timer))) >> >> The version that does work looks like this: >> >> (let ((timer [nil])) >> (aset timer 0 (run-at-time 1 1 (lambda (timer) (cancel-timer (aref >> timer 0))) timer)) > > This will only work if you're using lexical binding -- otherwise that > `timer' in the lambda will be unbound when the lambda is called. > > Is there a -*- lexical-binding: t -*- on the first line of the file in > question? > > -- > (domestic pets only, the antidote for overdose, milk.) > bloggy blog: http://lars.ingebrigtsen.no