From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: "T.V Raman" Newsgroups: gmane.emacs.devel Subject: Re: Q: How to programatically terminate repeat-mode Date: Mon, 3 Oct 2022 07:20:45 -0700 Message-ID: <25402.61373.427526.906328@retriever.mtv.corp.google.com> References: <86r10jghs7.fsf@mail.linkov.net> <86czba2jib.fsf@mail.linkov.net> <86mtadv0kv.fsf@mail.linkov.net> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="22269"; mail-complaints-to="usenet@ciao.gmane.io" Cc: juri@linkov.net, raman@google.com, emacs-devel@gnu.org To: monnier@iro.umontreal.ca Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Mon Oct 03 16:30:35 2022 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 1ofMSo-0005cQ-VR for ged-emacs-devel@m.gmane-mx.org; Mon, 03 Oct 2022 16:30:35 +0200 Original-Received: from localhost ([::1]:48020 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ofMSn-0000wW-U1 for ged-emacs-devel@m.gmane-mx.org; Mon, 03 Oct 2022 10:30:33 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:42724) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ofMJO-0007Os-NE for emacs-devel@gnu.org; Mon, 03 Oct 2022 10:20:51 -0400 Original-Received: from mail-pj1-x102c.google.com ([2607:f8b0:4864:20::102c]:40640) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ofMJM-0007ev-T8 for emacs-devel@gnu.org; Mon, 03 Oct 2022 10:20:50 -0400 Original-Received: by mail-pj1-x102c.google.com with SMTP id h8-20020a17090a054800b00205ccbae31eso15429439pjf.5 for ; Mon, 03 Oct 2022 07:20:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=references:in-reply-to:subject:cc:to:date:message-id :content-transfer-encoding:mime-version:from:from:to:cc:subject:date; bh=TZFlyQCdUGilNfLvPP/q+Fm513dUyy1uL19ooBBhu+A=; b=fw5gYevMEnQSITu4yqKLWfyNqv0e4kubao75zIGsjeKK6Nvn2BMG5ieLjcrCZyvAle A/jX/jSlCsFTs/CM/Nk44WNTOyGtN4wgMbz6YhMzxtkGeswm9LXhEuM7WEbh9Rk2PMCi uSHZND+gcNl54Y57N+hVAVL6Yp7vgv+kINv1EzklFiKkGtiBFfb5LsFPw/7MbrEvJMbN 9cA9+GZYoOIBiSZuKdEsOyPd2mqQorBHuVRZsKO+TPeDSGRWLgPRcjrKLUwYXQ4/u10v yGBmffRlde8GKiVUiBwB0gm/15YM7uBPy+o5uaapstHx6ueqJ4c9bXesQYsTO8r9zQWf a8JQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=references:in-reply-to:subject:cc:to:date:message-id :content-transfer-encoding:mime-version:from:x-gm-message-state:from :to:cc:subject:date; bh=TZFlyQCdUGilNfLvPP/q+Fm513dUyy1uL19ooBBhu+A=; b=bFxIJYLDVShjDeArg5MsPBHr7YihUK+l2s+QpHbeXUVjVatp3IYldFdoVi7wUZFqQ8 +1p/Kee8lu0ufMgDnjl8HnAJzOHIbN3//T520P4eQ4+NY8CkZlJJvZHnG+dQ6BdEZMa9 xwzDH/hLB9XY/Vr/+PZIacyu6mY8UWYusGvpR02Im3JVPJiHrS6H2bL3WsGlS9nuPfFW DqFgw61yX3f+pZMIhP/qBzR10ecjOEOqd17Tj3P51DpJ8OYKrtiY9Ion16Iji+Ut81sl wkbeGlpDz9Jhh9zC2dylT3v6ipXVfi43af19HEk8mJOO53Ga6SxQ7g1CoNROuXsgia3A yyJw== X-Gm-Message-State: ACrzQf1b9wxYomokEmwZ5hskIySwBzmGanbeP9OjGamdtvGPWCEkOE7y wJO+cytBptBIOPNUg9vg/NQk/pLwReZi0w== X-Google-Smtp-Source: AMsMyM7QdELIbu8ki3YT5FR7vLKOMWFhkdL+N7p+XMWuiBG1s1VAJiG8NOQVdXUbQMDN5RoCkBJ/mQ== X-Received: by 2002:a17:90b:38ce:b0:205:ea87:6177 with SMTP id nn14-20020a17090b38ce00b00205ea876177mr12318936pjb.41.1664806846909; Mon, 03 Oct 2022 07:20:46 -0700 (PDT) Original-Received: from retriever.mtv.corp.google.com ([2620:0:1000:1612:110:5844:f806:c8e7]) by smtp.gmail.com with ESMTPSA id h1-20020a654801000000b0041c30def5e8sm6635586pgs.33.2022.10.03.07.20.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 03 Oct 2022 07:20:46 -0700 (PDT) In-Reply-To: X-Mailer: VM 8.1.1 under 29.0.50 (x86_64-pc-linux-gnu) Received-SPF: pass client-ip=2607:f8b0:4864:20::102c; envelope-from=raman@google.com; helo=mail-pj1-x102c.google.com X-Spam_score_int: -190 X-Spam_score: -19.1 X-Spam_bar: ------------------- X-Spam_report: (-19.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_MED=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, ENV_AND_HDR_SPF_MATCH=-0.5, NICE_REPLY_A=-1.467, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, USER_IN_DEF_DKIM_WL=-7.5, USER_IN_DEF_SPF_WL=-7.5 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 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:296753 Archived-At: yes, API-wise, repeat-mode providing a programmatic means of turning off a repeat would be best; also I dont think there is a way for a user to have multiple repeats active, which makes things simpler. Stefan Monnier writes: > Juri Linkov [2022-10-03 09:56:32] wrote: >=20 > >> Replacing the earlier (push 7 unread-command-events) > >> with > >> (when repeat-exit-timer > >> (timer-set-idle-time repeat-exit-timer 0)) > >> > >> in my disable-repeat function that I called from the process-sent= inel of > >> the media player -- with check for exit as the guard condition ha= s no > >> effect and the repeat remains in effect. > > > > Maybe you are starting multiple timers=3F Currently repeat-mode c= ancels > > all previously started timers, but unfortunately cancel-timer for > > repeat-exit-timer doesn't run its timer function that should exit > > the repeat map. I propose to add a new optional argument RUN-FUNC= TION > > to cancel-timer, that will run the timer function after canceling = the timer. > > This means copying this part of timer-event-handler to cancel-time= r: >=20 > I don't see any need to add some weird `run-function` arg to > `cancel-timer`, here. >=20 > Why can't the repeat-map code offer a function to ... "programatical= ly > terminate repeat-mode"=3F Since it set up the timer, it can know wh= at > function the timer will run and with what args and can thus run that= > same code if it wants to. >=20 >=20 > Stefan --=20 Thanks, --Raman(I Search, I Find, I Misplace, I Research) =E2=99=89 Id: kg:/m/0285kf1 =F0=9F=A6=AE -- Thanks, --Raman(I Search, I Find, I Misplace, I Research) ♉ Id: kg:/m/0285kf1 🦮