From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Jimmy Yuen Ho Wong Newsgroups: gmane.emacs.bugs Subject: bug#48153: 28.0.50; minor mode keymaps should not override keymap given to read-from-minibuffer Date: Thu, 6 May 2021 11:55:25 +0100 Message-ID: References: <1a73bd6c69bb5c6a8431@heytings.org> <1a73bd6c69374497d37b@heytings.org> <1a73bd6c69101f3312ad@heytings.org> <1a73bd6c691b937c82fc@heytings.org> <70f2eadd5f48937bb057@heytings.org> <83r1il2x7t.fsf@gnu.org> <70f2eadd5fbd139e3c62@heytings.org> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="18052"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Gregory Heytings , 48153@debbugs.gnu.org To: Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu May 06 12:57:28 2021 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1lebhA-0004bl-9s for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 06 May 2021 12:57:28 +0200 Original-Received: from localhost ([::1]:47186 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lebh9-0002Qr-Bg for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 06 May 2021 06:57:27 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:34806) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lebgk-0002QF-Sq for bug-gnu-emacs@gnu.org; Thu, 06 May 2021 06:57:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:54056) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lebgk-00031H-L2 for bug-gnu-emacs@gnu.org; Thu, 06 May 2021 06:57:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lebgk-0002lZ-Jv for bug-gnu-emacs@gnu.org; Thu, 06 May 2021 06:57:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Jimmy Yuen Ho Wong Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 06 May 2021 10:57:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 48153 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: moreinfo Original-Received: via spool by 48153-submit@debbugs.gnu.org id=B48153.162029857010621 (code B ref 48153); Thu, 06 May 2021 10:57:02 +0000 Original-Received: (at 48153) by debbugs.gnu.org; 6 May 2021 10:56:10 +0000 Original-Received: from localhost ([127.0.0.1]:37369 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lebfu-0002lF-3r for submit@debbugs.gnu.org; Thu, 06 May 2021 06:56:10 -0400 Original-Received: from mail-lj1-f171.google.com ([209.85.208.171]:35713) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lebfs-0002l8-Bv for 48153@debbugs.gnu.org; Thu, 06 May 2021 06:56:08 -0400 Original-Received: by mail-lj1-f171.google.com with SMTP id e12so6481292ljn.2 for <48153@debbugs.gnu.org>; Thu, 06 May 2021 03:56:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=hC1p8xUgFCvsCl2JqYpUK+GPI4QEgHjajFke5MlaFls=; b=E+AAL/2bi1AovtlnEr2xaqd+HXGAPh13t6PJ1Or9ynxs0mqICxVc4qFE16sRcH0DWb /b9zDlizJsbc+IVMbUPNoA9DrxjeJHYlwHwQeH99PDuJhS7KtpVjj7vE41aZscSralUs dO90iReKekKC4fvvZ2nQja6p/evmgxU3f4+jLSwIc2F3adycjwBwzUdSMT0s+xsq0twk 0ltZHNOeG8nFJHnSmdoK8voZdeU5AYyPZ/0X8qG3ZJK85qocZhkgYw/35/d4r3znsTsu ngKL4528b3j0fzr7zUMCKDlv4UrgqNcgRtiTzvz/s3AZSXlB+f4Q7KHvc3v+Ql/3/PBn l4yA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=hC1p8xUgFCvsCl2JqYpUK+GPI4QEgHjajFke5MlaFls=; b=G0uFbHWC5SXUx2Ovfo9axnnzxgAOtEA5ljAkEReeN5p/CbRWHteG/bF4EXEIczRLnT cNT2N9fQsvjSGSNErixW8TweMBFA/haaxh2FjHPiOdwAPBN4ui11E3SSsn13QOuTpzyX LYf1pZ9r255rk0gqAMieC4+CDXOyRTKF1OpXIayc1j7BrmWZOqn9w/unyBxWtIXgp12W +HIpG0c2eNux6z20Mf1pykJ2HklZkt+/dawNSrVAhih7fcewD4dEVv+2zu2XAgByHwgB IhGmfWtWnm5Zgz/4XS/s6WkxLXm6mpGgiWuWl90YeL9rIplNAkAdQ07zDdYRt0aV0XIY 4EYA== X-Gm-Message-State: AOAM533VUFsdtpFXPm3CQKF5p+uiXELb+l0UTqq5xeOTqCedkq2viafV A/g3EDXt21eYd4teXUx7wZmPgfpbRXu14hAcXUo= X-Google-Smtp-Source: ABdhPJy5YqXOU4D8HnPPLDtcSfB49AEWytoRrxRToPFUnWEDCGnjb8azuyDnUr8TkpQ0bACNDTaFkeU5hfWC3gXqc24= X-Received: by 2002:a05:651c:151:: with SMTP id c17mr389832ljd.398.1620298561809; Thu, 06 May 2021 03:56:01 -0700 (PDT) In-Reply-To: X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list 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-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:205815 Archived-At: Ok I think I've found a solution to my problem. There are a couple of things that I didn't understand and had to attach a function to print out which one is being called on 5 different hooks to find out the invocation order. This is call order I've found: 1. ido-setup-hook 2. minibuffer-mode-hook 3. minibuffer-setup-hook 4. minibuffer-exit-hook 5. minibuffer-inactive-mode-hook Specifically, the override keymaps are cleared between step 1 and 2, so if I loop thru the minibuffers in step 1 to assign to minor-mode-override-map-alist inside them, they will be reset in step 2 I suppose. So if I needed to "unshadow" the shadowed keybindings inside the minibuffer, I had to do these processing in minibuffer-setup-hook because that is called every time the minibuffer is entered. Thanks for your help, you can close this issue now. Jimmy On Wed, May 5, 2021 at 3:18 PM Stefan Monnier wrote: > > > 1. On emacs 27, minor mode keybindings will only override the key > > bindings given to read-from-minibuffer after the second invocation of > > the minibuffer, but doesn't on the first invocation. > > Something like that, yes. > That's only for minor modes defined via `define-globalized-minor-mode`. > Not for global minor modes defined in the usual way via (define-minor-mode > ... :global t ...). > > This change makes for a more predictable behavior and is a side-effect > of the change described in etc/NEWS as: > > ** An active minibuffer now has major mode 'minibuffer-mode', not the > erroneous 'minibuffer-inactive-mode' it formerly had. > > More specifically, the difference is that in Emacs<28 sometimes those > globalized minor modes where not enabled (hence their keybindings are > not active). > > > 2. On emacs 28, minor mode keybindings override the key bindings given > > to read-from-minibuffer at all times. > > And this was also true in all previous versions of Emacs. > > > 3. But, `minor-mode-overriding-map-alist` does not override the > > override in effect in the minibuffer like other buffers. > > That's the part of your bug report I haven't understood yet. > > > My expectation is when a keymap is explicitly given to > > read-from-minibuffer, the key bindings in it should take precedence, > > but it doesn't. > > No, this keymap is the "local map" a.k.a "major mode map", so it has > lower precedence than minor keymaps. Always had. > > > As you can see from the snippet from my last email, both > > ido-completion-map and test-mode bind to C-k, I expect the C-k binding > > in ido-completion-map to take effect inside the minibuffer, without > > being overridden by any minor modes in effect inside the minibuffer. > > This expectation is incorrect ;-) > > > If this is not to be desired, I'd expect setting > > minor-mode-overriding-map-alist or the usual key binding lookup search > > algorithm to work inside the minibuffer. > > This should be the case: minibuffers are treated exactly like all other > buffers by the keymap code, AFAIK. > > > Stefan >