From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: "Basil L. Contovounesios" Newsgroups: gmane.emacs.devel Subject: Re: master d378615: Cancel timer when world-clock buffer is killed Date: Sun, 06 Sep 2020 16:55:27 +0100 Message-ID: <87zh62sxw0.fsf@tcd.ie> References: <20200903105449.22858.36474@vcs0.savannah.gnu.org> <20200903105450.8CD2D20A15@vcs0.savannah.gnu.org> <87sgbzrn0l.fsf@tcd.ie> <87k0x9sw1c.fsf@tcd.ie> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="21883"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: emacs-devel@gnu.org To: Stefan Kangas Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sun Sep 06 17:56:38 2020 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kEx1x-0005aa-KG for ged-emacs-devel@m.gmane-mx.org; Sun, 06 Sep 2020 17:56:37 +0200 Original-Received: from localhost ([::1]:49468 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kEx1w-0001Ue-Me for ged-emacs-devel@m.gmane-mx.org; Sun, 06 Sep 2020 11:56:36 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:38830) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kEx0y-0000ru-Ga for emacs-devel@gnu.org; Sun, 06 Sep 2020 11:55:36 -0400 Original-Received: from mail-ej1-x62f.google.com ([2a00:1450:4864:20::62f]:44723) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kEx0w-0005IP-Bi for emacs-devel@gnu.org; Sun, 06 Sep 2020 11:55:36 -0400 Original-Received: by mail-ej1-x62f.google.com with SMTP id r7so1351370ejs.11 for ; Sun, 06 Sep 2020 08:55:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tcd-ie.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=8eU7vRXFHz5aGrBBbSPC6qPKKsPKZXRufDVIhJn5Fd8=; b=kFv1EzJrtqVwQ1WSkXCDwWFz3ftLBm8FYIt/AWhjLKvVuBR7Wm3NHgUK6USOopzcwk iNOw1LumZ+NcqzjT6YMS/vMbTPKAOykX/XsGMTFx7Av8pIsqHFEwifyylsFBE5zINe8/ SL3iLSX8h3eWel2NU/SJd8AXeS6v9oXU2FDhQO6hPiFPxXqFbmJ+ojUuvyYxr2NuG2Vu LLs1P5dZIWgkVSsGXDGhHhL4Am0I95EZK9rziDX/iyG3qVPE5uulb0HCPLn2Z92P4T6P CzRTrvSrv/u7jm3lh5CLhJVivJSitCY1WfgSWftzrt2+nFqyesD+gNpTjcSM0CUHBqqR r2Iw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=8eU7vRXFHz5aGrBBbSPC6qPKKsPKZXRufDVIhJn5Fd8=; b=tg1sEgnKIZZ1XgerFjelk9rsOBcoUAeVVvT+d7PMg+qlDcaB+3QD1qoetHzTNu5fdW V+TpnYK0NhlDj7Z5yM8mYFWgf2n/BH1MHH+yQki7+2hZdxXdvvBkJ2uG7fqTk9M2VsHj rI3gDSmvjdcXBaTc9/gt4K3zWjTTtknXfr/d1P2wzra94Gr6HW8JwYosem8x13InnChL xAkEngWWJyvvfvHng3hDZ6qHjSvBHaeaAg2wDYNhoyVONP3A9w0hzLUfNUzfQ8nHo/Ij HlIKyGArE4zWegYUcJPgF3GlzPrZjbYcLMqp29b9HrRd1dWgcmOEw0DpM2ppAgO0zm8X gYrQ== X-Gm-Message-State: AOAM530jfWB05o6BJVn4zg3IhPlVi9Q2GL1AE+WksflPi51UJqD66IRR pwqORTuL7v9HRhJrt+pNADCUvg== X-Google-Smtp-Source: ABdhPJx0TR4iikz7l/HvxevuR03R95lBgqphFpDTxP8s+bHek1F/1FHmhyt3Gtr5V1i789flqL75gw== X-Received: by 2002:a17:906:fb84:: with SMTP id lr4mr17950402ejb.282.1599407729380; Sun, 06 Sep 2020 08:55:29 -0700 (PDT) Original-Received: from localhost ([109.77.32.127]) by smtp.gmail.com with ESMTPSA id d13sm11443092edl.68.2020.09.06.08.55.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 06 Sep 2020 08:55:28 -0700 (PDT) In-Reply-To: (Stefan Kangas's message of "Sun, 6 Sep 2020 15:38:10 +0000") Received-SPF: none client-ip=2a00:1450:4864:20::62f; envelope-from=contovob@tcd.ie; helo=mail-ej1-x62f.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_NONE=0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 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-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:254569 Archived-At: Stefan Kangas writes: > "Basil L. Contovounesios" writes: > >> Why not keep the (internal) variable and pass it to cancel-timer >> directly instead of searching through timer-list for a particular entry? > > Thanks for your attention to detail. > > It's a matter of taste, I suppose. While mucking around with this, I > saw two timers at one point, so I just kept that code as is. (Although > the particular issue causing two timers should be fixed now.) > > Perhaps this should just use `cancel-function-timers' though... > > Are there any strong reasons why keeping it in a variable is better? > Maybe we just prefer that style? I think it's the cleanest and least surprising approach. Matching based on function symbol (via cancel-function-timers) or name (as in the current world-clock-cancel-timer) runs the risk of cancelling something we didn't add. If we want to cancel a timer that we added, we should keep track of what we added, and explicitly cancel only that; at least that's what my idea of common sense dictates. Unless there's some benefit to the other approaches I'm not seeing? Thanks, -- Basil