From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Yuan Fu Newsgroups: gmane.emacs.devel Subject: Re: Duplicated outline-cycle binding, and problems with the new one Date: Sun, 9 Jan 2022 14:55:45 -0800 Message-ID: References: <9DFDAD07-DBC0-4FAE-A565-D1EE6045E7D8@gmail.com> <86ilv25714.fsf@mail.linkov.net> <86pmp6cohf.fsf@mail.linkov.net> <86a6g87lu5.fsf@mail.linkov.net> Mime-Version: 1.0 (Mac OS X Mail 15.0 \(3693.40.0.1.81\)) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="12673"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Stefan Monnier , Emacs developers To: Juri Linkov Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sun Jan 09 23:56:43 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 1n6h7D-000366-2d for ged-emacs-devel@m.gmane-mx.org; Sun, 09 Jan 2022 23:56:43 +0100 Original-Received: from localhost ([::1]:48260 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n6h7C-0008Ig-15 for ged-emacs-devel@m.gmane-mx.org; Sun, 09 Jan 2022 17:56:42 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:57312) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n6h6N-0006uL-Ta for emacs-devel@gnu.org; Sun, 09 Jan 2022 17:55:53 -0500 Original-Received: from [2607:f8b0:4864:20::102c] (port=39630 helo=mail-pj1-x102c.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1n6h6K-00031Y-Kf for emacs-devel@gnu.org; Sun, 09 Jan 2022 17:55:50 -0500 Original-Received: by mail-pj1-x102c.google.com with SMTP id c14-20020a17090a674e00b001b31e16749cso18710187pjm.4 for ; Sun, 09 Jan 2022 14:55:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=ImtKoblXmdNFLmt02PRp6/qrL9XAUKLdhSyLbECls8M=; b=q3k7OdLqt5doOFfI1QexmDknGUEfUluq1iJ2gTGnEKJiLXHYYCjBr91dP90XD7AxtC TABrqTXEZ0i1d1PBbABbbzJGlg4JTVqZukCUjp5JC4suRm4bKObQtiG3kYe4deIyzO6q dJo40AY5OE851gi9It1FatdVwh4AS9981DQ4PsWDTVTMyfoMH0QsejqABUcHQ0DlNI4x v1mRJ5R62pi4y6lsZNRTrzjnHVXYi2iIIzGTP+cOIkaw0sGpAXITJnFqYxfA6cRE5mza 1PiX+h7XRxM+NgvyUtobYmnaSlx2OgX5xrb45RyZa4+LDADKW5sAC8lTeNKl6lMy9cSZ 4j0Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=ImtKoblXmdNFLmt02PRp6/qrL9XAUKLdhSyLbECls8M=; b=7Cu8c6/oOEmK4sG2c2BgigAkErny/qn1uhi/dCfr9PKbb8xgNlZI6QYzo4BChvay47 feshG0Zj7TasqKDZqon+Bo+lsbv202m1ebjx2o4C9yS7o1aZbyduUERQO9H5alTwJpUA wQB2gXBMOiYfUwFP/XAVmWCgY0KJeSvy0Rna2olt3vFLZveutdlCKd0jS6AE2ADdShlK 2cGCB8j6z4Mfi1SrmDi8080Hgk7aVGbS9iNvyUqBM1hv3T9QBSTHBsXW6Dqelq+y50Te j3aDXr4+xp5DYT5C01wKxp707Z/ClXk3R2fNfWNRfpRbKHXzgnlii0feuUKdl0mNRGAV KDbQ== X-Gm-Message-State: AOAM533TNRuRbyj8nxJaNLWxtstyScugDFAMwNwOXCyvR4YfwldFk8cZ GHjIBK8zaEYTw6Me7mZHvD+5a7NffN0= X-Google-Smtp-Source: ABdhPJwMiSyj2bTSTwxO1ShvzUPcth1+pVyoEnmBk4JoAUFaSWUaKmb9j1GJ8mcj25Ln37LB09uufQ== X-Received: by 2002:a17:902:b908:b0:149:f6e8:7e0e with SMTP id bf8-20020a170902b90800b00149f6e87e0emr15942893plb.138.1641768947294; Sun, 09 Jan 2022 14:55:47 -0800 (PST) Original-Received: from smtpclient.apple ([2600:1700:2ec7:8c90:9c7:fb82:7899:9cb5]) by smtp.gmail.com with ESMTPSA id a1sm4637135pfv.99.2022.01.09.14.55.46 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sun, 09 Jan 2022 14:55:46 -0800 (PST) In-Reply-To: <86a6g87lu5.fsf@mail.linkov.net> X-Mailer: Apple Mail (2.3693.40.0.1.81) X-Host-Lookup-Failed: Reverse DNS lookup failed for 2607:f8b0:4864:20::102c (failed) Received-SPF: pass client-ip=2607:f8b0:4864:20::102c; envelope-from=casouri@gmail.com; helo=mail-pj1-x102c.google.com X-Spam_score_int: -12 X-Spam_score: -1.3 X-Spam_bar: - X-Spam_report: (-1.3 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no 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:284512 Archived-At: > On Jan 6, 2022, at 10:56 AM, Juri Linkov wrote: > >>> But diff-mode overrides this binding with diff-mode-shared-map >>> where the TAB key is bound to diff-hunk-next, since >>> minor-mode-overriding-map-alist takes priority over >>> minor-mode-map-alist when diff-mode does this: >> >> I see. I knew using `minor-mode-overriding-map-alist` in `diff-mode.el` >> this way was going to bite us sooner or later. >> >> Maybe we should use a hook on `read-only-mode` to set/unset >> a `diff-mode-read-only` variable so we can add the keymap >> (conditionalized on this new `diff-mode-read-only`) to >> `minor-mode-map-alist` instead of `minor-mode-overriding-map-alist`. > > So this is because `minor-mode-map-alist` is not buffer-local. > Then this requires changing `(setq buffer-read-only t)` to > `(read-only-mode 1)` in diff-related places. Since `read-only-mode` > always activates `view-mode` when `view-read-only` is t, > it needs let-binding: (let ((view-read-only nil)) (read-only-mode 1)). > This will keep the current behavior. Then special-handling of > `view-mode` in `diff-mode` is not needed because `view-mode` > is higher than `diff-mode-read-only` in `minor-mode-map-alist`, > where `diff-mode-read-only` is at the end to not take precedence > over `outline-minor-mode`. Once again, LGTM :-) Yuan