From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Robert Weiner Newsgroups: gmane.emacs.devel Subject: Re: Problem quitting properly from transient keymap with one keystroke Date: Fri, 20 Oct 2017 13:51:19 -0400 Message-ID: References: Reply-To: rswgnu@gmail.com NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="001a113e205292313d055bfe20bd" X-Trace: blaine.gmane.org 1508521964 23553 195.159.176.226 (20 Oct 2017 17:52:44 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Fri, 20 Oct 2017 17:52:44 +0000 (UTC) Cc: emacs-devel To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Oct 20 19:52:40 2017 Return-path: Envelope-to: ged-emacs-devel@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 1e5bT8-0003pu-O3 for ged-emacs-devel@m.gmane.org; Fri, 20 Oct 2017 19:52:26 +0200 Original-Received: from localhost ([::1]:55136 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e5bTF-0002sy-PY for ged-emacs-devel@m.gmane.org; Fri, 20 Oct 2017 13:52:33 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:47781) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e5bSc-0002sq-C0 for emacs-devel@gnu.org; Fri, 20 Oct 2017 13:51:55 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e5bSY-0006zH-MN for emacs-devel@gnu.org; Fri, 20 Oct 2017 13:51:54 -0400 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:40649) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e5bSY-0006z6-J0 for emacs-devel@gnu.org; Fri, 20 Oct 2017 13:51:50 -0400 Original-Received: from mail-qt0-f174.google.com ([209.85.216.174]:45454) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.82) (envelope-from ) id 1e5bSY-0003fD-Bk for emacs-devel@gnu.org; Fri, 20 Oct 2017 13:51:50 -0400 Original-Received: by mail-qt0-f174.google.com with SMTP id p1so19443689qtg.2 for ; Fri, 20 Oct 2017 10:51:50 -0700 (PDT) X-Gm-Message-State: AMCzsaUd7K+gqZx6tVeeMR9rm6ZYR5LQaIwrPaG7PorowxLIInqhisZj No22a9bNPofLWAdTUdQU/Itm3WQ9B7p6beb5ezk= X-Google-Smtp-Source: ABhQp+TL/ILp08M9iNUiNp8vt40Em+Yru3sX79KxY8ZsvnvL4Ukf0gpu99bpFRTzqbEgtp7YicFnYrLc4BNOv8l7pX4= X-Received: by 10.200.56.52 with SMTP id q49mr8771708qtb.309.1508521909824; Fri, 20 Oct 2017 10:51:49 -0700 (PDT) Original-Received: by 10.200.12.74 with HTTP; Fri, 20 Oct 2017 10:51:19 -0700 (PDT) In-Reply-To: X-Gmail-Original-Message-ID: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 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.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:219656 Archived-At: --001a113e205292313d055bfe20bd Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Fri, Oct 20, 2017 at 1:34 PM, Stefan Monnier wrote: > > =E2=80=8BI understand. Would it be possible to make the exit function = run on > both > > pre- and post-command hook so that it could use the results of the > command=E2=80=8B > > when needed and eliminate the need in many cases to call the quit > function > > manually? Or would that cause problems? > > I think it would bump into other problems because the keep-pred > predicate expects to be called from pre-command-hook. > > IOW, maybe it would have been a valid design, but it would be an > incompatible change. > =E2=80=8BOk. I have everything working well now and have been able to eliminate the need for the on-exit function given to set-transient-map and instead call the quit function generated by set-transient-map in each key binding that quits from my mode (this was happening before but indirectly through the setting of a status flag). Bob --001a113e205292313d055bfe20bd Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
On Fri, Oct 20, 2= 017 at 1:34 PM, Stefan Monnier <monnier@iro.umontreal.ca> wrote:
>= ; =E2=80=8BI understand.=C2=A0 Would it be possible to make the exit functi= on run on both
> pre- and post-command hook so that it could use the results of the com= mand=E2=80=8B
> when needed and eliminate the need in many cases to call the quit func= tion
> manually?=C2=A0 Or would that cause problems?

I think it would bump into other problems because the keep-pred
predicate expects to be called from pre-command-hook.

IOW, maybe it would have been a valid design, but it would be an
incompatible change.

=E2=80=8BOk.=C2=A0 I have e= verything working well now and have been able
to eliminate the need for th= e on-exit function given to
set-transient-map and instead call the quit fu= nction generated
by set-transient-map in each key binding that quits from = my mode
(this was happening before but indirectly through the setting of
= a status flag).

Bob

--001a113e205292313d055bfe20bd--