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: Sun, 02 Oct 2022 10:19:49 -0700 Message-ID: References: <86r10jghs7.fsf@mail.linkov.net> Mime-Version: 1.0 Content-Type: text/plain; charset=gb18030 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="22549"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) Cc: emacs-devel@gnu.org To: Juri Linkov Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sun Oct 02 19:21:34 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 1of2ek-0005id-Gx for ged-emacs-devel@m.gmane-mx.org; Sun, 02 Oct 2022 19:21:34 +0200 Original-Received: from localhost ([::1]:38982 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1of2ei-0002kV-Ui for ged-emacs-devel@m.gmane-mx.org; Sun, 02 Oct 2022 13:21:32 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:51844) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1of2dA-00013W-2i for emacs-devel@gnu.org; Sun, 02 Oct 2022 13:19:56 -0400 Original-Received: from mail-pg1-x534.google.com ([2607:f8b0:4864:20::534]:39738) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1of2d8-0004FS-Cj for emacs-devel@gnu.org; Sun, 02 Oct 2022 13:19:55 -0400 Original-Received: by mail-pg1-x534.google.com with SMTP id b5so7980257pgb.6 for ; Sun, 02 Oct 2022 10:19:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=content-transfer-encoding:mime-version:user-agent:message-id:date :references:in-reply-to:subject:cc:to:from:from:to:cc:subject:date; bh=WPD000qqp5EbY+Kw9DyRIh3amnuSH8AR3QwThGAMjPE=; b=k2sjt+ma1tj+Ty8jeo6gIw0Nf4n3ACdhjeNBYyK2ijC5XQTc+KSTqz8xCKzWFYFjhX 4aDVzUE54gWPs2Th06PWPAh3vKcaDZXbfK5K5HNvGSeVViwZZbZEijRcuRX1kndkZtYV CLVGGnmhL1w3ko7224Z+fiCVTkC0bkXs54c/kUQL6RW1sIdrkJZhkImDi1W9rqjFWBrF QBgZqTXSZ8XNm0oJnmVz23UvLoMXa6mroU1VUSwhbUU/zyQ9FYZURn/wbyyuvp6vFJ9Y nVlnVzx8CV9fUDxOnXkmu86wUs7lS3kJIofcUo28T0qQ08mIuYOXowHw/RTw3Z+lPMFe Kw0g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:user-agent:message-id:date :references:in-reply-to:subject:cc:to:from:x-gm-message-state:from :to:cc:subject:date; bh=WPD000qqp5EbY+Kw9DyRIh3amnuSH8AR3QwThGAMjPE=; b=MTyc+XFVQfeABHPPs84A4PQKTmnLFVvZrr8PGkmx7eSiFac/kuWq/D6v8L5UxL07Ks P+vTRj6OgEI/rqiwxgMraO+WkEnWf7kJwgpI5wreotr4idMM2JO3igYrpMP39B+IPfhB dhixeZLhmDdJbaakIJHh2JMLr57p5eFwcM4kIrCauz/gHgo6M4AoBdRHygcIULYakDbd meofapiBnDHZZ0+vKVi3NW9DJ13LiyUmzQguRgQBLQDw/ArRDvkzKKM37zkK4sPO1jdD 3+4WJNd+4bW/1LFCqra5IU98kJ08Jl0vijQc9jdJI8JQbUQzzyy/WEKFKIA+fih/OCxX BtVw== X-Gm-Message-State: ACrzQf0zrvwItOcwyzudN8dOG/J0cdkFnNxDYyHJSjS2jmHBplB+LuP5 VcCA2bijnQeV/lqLaZBeuYpwXeYMzx65rw== X-Google-Smtp-Source: AMsMyM5NfMx4HFlYQk0YUC/P+5vE6YXUWTi0e6ZN4T0Jva0PAcszxjMSDmmlm92zojDrxM/MtJeZKQ== X-Received: by 2002:a65:6cc8:0:b0:3fe:2b89:cc00 with SMTP id g8-20020a656cc8000000b003fe2b89cc00mr15775000pgw.599.1664731192435; Sun, 02 Oct 2022 10:19:52 -0700 (PDT) Original-Received: from raman9 (c-24-4-174-65.hsd1.ca.comcast.net. [24.4.174.65]) by smtp.gmail.com with ESMTPSA id x125-20020a626383000000b0053639773ad8sm5653561pfb.119.2022.10.02.10.19.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 02 Oct 2022 10:19:51 -0700 (PDT) In-Reply-To: (T. V. Raman's message of "Sun, 02 Oct 2022 09:20:35 -0700") Received-SPF: pass client-ip=2607:f8b0:4864:20::534; envelope-from=raman@google.com; helo=mail-pg1-x534.google.com X-Spam_score_int: -175 X-Spam_score: -17.6 X-Spam_bar: ----------------- X-Spam_report: (-17.6 / 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, 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:296649 Archived-At: "T.V Raman" writes: Answering my own question: (push 7 unread-command-events) in the process sentinel works where I have customized repeat-exit-key to C-g. However I needed to explicitly use (push 7 unread-command-events) rather than the more readable (push repeat-exit-key unread-command-events) since unread-command-events doesn't like having a vector pushed onto it. > Juri Linkov writes: > Hi, > > The suggestion you gave me, ie dont put the repeat property on the > command that stops media works brilliantly --- excpt: > > If the media plays to completion while repeat is still active, then the > repeat fails to deactivate. Any ideas on how to handle that? > > >>> I have been using repeat-mode to good effect in emacspeak e.g. in the >>> context of its media player etc. >>> >>> One issue I have is that once a command to stop media has been >>> executed, I'd like the repeat to stop i.e. without me executing >>> another explicit kbd command like C-g to terminate the repeat. >> >> The simplest way is just not to put the property 'repeat-map' >> on the symbol of the command that stops media. Then executing >> this command will terminate the repeat. >> >>> How do I do this from lisp? >> >> It's no easy to do the same from Lisp because in repeat-post-hook >> the value of 'exitfun' returned from 'set-transient-map' is not >> exposed outside. Maybe the value of 'exitfun' should be stored >> in a variable? Currently 'exitfun' is used only by repeat-exit-timer. >> >>> I'd rather not call keyboard-quit explicitly -- that sounds like >>> overkill? >> >> Or you could put 'repeat-exit-key' on 'unread-command-events'. --=20 Thanks, --Raman(I Search, I Find, I Misplace, I Research) =817=A94 Id: kg:/m/0285kf1 =950=DC8