From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Lars Ingebrigtsen Newsgroups: gmane.emacs.bugs Subject: bug#24959: 26.0.50; cancel-timer: void-variable timer Date: Thu, 17 Nov 2016 19:03:53 +0100 Message-ID: References: <874m36sahw.fsf@localhost.localdomain> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1479406990 1537 195.159.176.226 (17 Nov 2016 18:23:10 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Thu, 17 Nov 2016 18:23:10 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.50 (gnu/linux) Cc: 24959@debbugs.gnu.org To: Oleg Sivokon Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Nov 17 19:23:06 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 1c7RKz-0008RH-Si for geb-bug-gnu-emacs@m.gmane.org; Thu, 17 Nov 2016 19:23:05 +0100 Original-Received: from localhost ([::1]:60871 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1c7RL3-00037U-BK for geb-bug-gnu-emacs@m.gmane.org; Thu, 17 Nov 2016 13:23:09 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:46902) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1c7R2g-0006Fi-SM for bug-gnu-emacs@gnu.org; Thu, 17 Nov 2016 13:04:16 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1c7R2Z-0000kf-02 for bug-gnu-emacs@gnu.org; Thu, 17 Nov 2016 13:04:10 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:45525) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1c7R2Y-0000jz-ME for bug-gnu-emacs@gnu.org; Thu, 17 Nov 2016 13:04:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1c7R2Y-0000Ig-E1 for bug-gnu-emacs@gnu.org; Thu, 17 Nov 2016 13:04:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Lars Ingebrigtsen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 17 Nov 2016 18:04:02 +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.14794058381143 (code B ref 24959); Thu, 17 Nov 2016 18:04:02 +0000 Original-Received: (at 24959) by debbugs.gnu.org; 17 Nov 2016 18:03:58 +0000 Original-Received: from localhost ([127.0.0.1]:60924 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c7R2U-0000IN-Hv for submit@debbugs.gnu.org; Thu, 17 Nov 2016 13:03:58 -0500 Original-Received: from hermes.netfonds.no ([80.91.224.195]:52715) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c7R2T-0000IF-3e for 24959@debbugs.gnu.org; Thu, 17 Nov 2016 13:03:57 -0500 Original-Received: from cm-84.215.1.64.getinternet.no ([84.215.1.64] helo=stories) by hermes.netfonds.no with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1c7R2P-0001T0-L4; Thu, 17 Nov 2016 19:03:56 +0100 Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAAIVBMVEUGBAkDAgYBAAQAAAM9 KicBAQMNCAsgFRXdvJMAAAJ5VEO49rZsAAACXklEQVQ4jW2UMYsbMRCF5cJbWwYbUlrgIj8gP+BA ZIOr2CDCdmsIWkh1Bp0UUl+xqFex/cIZ/cq8J9m+K24WbJhP8+aNdiURPoQP1gY7DBYhkjEdI6Up TV1nzF7t1kpKYczEFAKsS+Z32wY8UmBxyfLHdKn75ZwO2qGiw/JSgd9wRhtv/WBZgSz08FBH69Zp hBQQQRdDHXQxxpzUTsodpCCBBCgaIJ8MgSqAqKPZiRVJqQJKKiU6ADIMlJwAaLVjCRywISZUrPha 1nGMrkqp/X4t12VyDm0SS4vQSak1t6QmyoQTwQmg7hV12QROTdFaK8U5DEyZMprh5p6+oYBgogqn NJySsb+BR1CtbEnt8Q7q+gJ2sLuZUlf3vExRAN7gSsTLfX3qpjrHDrsoxJh1i8/gy3RzhjGkLGDM JQ5ZX4yikryDMYLhb8wvSvAdlTzBI95cfj7LT8DrIftGfALinzyLHvkFwfWezmN0Y3w61wKRK6Cx MfoxtueaF+7ud8zXeMlz22NqIWyxe4Ve1uFvfDq8hVphPzSPP8bvbmgW7xX33hhESisfICJzZYc8 vp5X/QPEfGteum/7agpg5sed6RpQB2+H4FqAOHvbOKI5z9dZh4B1DmD2G3NcCWn95t8VVOOIBNdb 0S+N+Wnt4LQfAFCBo+uerQhWNJANUHvBWt8v0DygvQ62nHGAy1asFkfabQAObNfinNLQBi8dpIBM t0y35WJYmuNGrgj04QCAdLku7LnUFMDgPUJnnuBYNwXztPWGgTdW1HwjYKcCuPMNgLy9j+BuWgRb uzzWj8T+B3V/pSJEAOHrAAAAAElFTkSuQmCC In-Reply-To: (Oleg Sivokon's message of "Thu, 17 Nov 2016 20:00:27 +0200") 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:125801 Archived-At: 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