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: Mon, 3 Jan 2022 17:40:22 -0800 Message-ID: References: <9DFDAD07-DBC0-4FAE-A565-D1EE6045E7D8@gmail.com> <86ilv25714.fsf@mail.linkov.net> <86mtke3q0z.fsf@mail.linkov.net> Mime-Version: 1.0 (Mac OS X Mail 15.0 \(3693.40.0.1.81\)) 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="12886"; 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 Tue Jan 04 02:41:41 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 1n4YpW-00039z-LS for ged-emacs-devel@m.gmane-mx.org; Tue, 04 Jan 2022 02:41:38 +0100 Original-Received: from localhost ([::1]:33422 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n4YpV-0001WC-Bp for ged-emacs-devel@m.gmane-mx.org; Mon, 03 Jan 2022 20:41:37 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:45574) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n4YoR-0000mI-Ml for emacs-devel@gnu.org; Mon, 03 Jan 2022 20:40:32 -0500 Original-Received: from [2607:f8b0:4864:20::530] (port=36842 helo=mail-pg1-x530.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1n4YoP-0006bz-HH for emacs-devel@gnu.org; Mon, 03 Jan 2022 20:40:30 -0500 Original-Received: by mail-pg1-x530.google.com with SMTP id 200so31398707pgg.3 for ; Mon, 03 Jan 2022 17:40:24 -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=W10Onf5uiCDb1uUGt/8V5L6XdRMUyQqTjubtFD7IRW8=; b=UllVOnnJS9QbzFhynCgKl0zvV/sM92CJZ0jGpmSTi2yRmYgNchKKcNwkPd5770yRw8 Y506YvcEmn/pwSDvNOdpm3oHtzxYN2JkSQ5yx/HXzf94S3vMpBEX1FYkkGLVpkImx680 wGj7OqZBRIWBERoIFnfJ5rlq+qOpeMJiTwNkX71NTFWVBN1I+G4XFOT5UAzOwKYY156b wT5e7mPqPnvp+pGJhyj44FHshWm8ebEOhtH1ZFpFC6KY5Ai5gaS6u3zGMCuV2Y+aBUCS NiES25Fnf2RQ3RxVqe00sV2P08sx/TXQ9qlRyRFr9fu+5w4+OKyD4j+95/uB2d0F9kuV kE7A== 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=W10Onf5uiCDb1uUGt/8V5L6XdRMUyQqTjubtFD7IRW8=; b=oNHSdjdWs3Cs/pQht/nzjTmJ+h+f8vawSiww1aFNwsuvpEMtFhVrY528vE4ItT1+4G ZG21Ewei7dlcrtYlBEllmAJCpw2bNYOCI0USABBCPgsCzYtXRktM7hNPkpBYtagnrQUg FKIj1fDx9afW9CrSYKl9mkpbaXqzG89fRR+x3eGoGMptmB4gSCIlrpmA+Je/xxVrXQMr vFL5tcOUpJujj6z1rOPdEnU1UAtWCFip14T5eVZQ+Ye8Bu47rg0Aq5uXmUeqSF3OE8E9 a4iDcwsnAFT6xyPJexr3bOkBCYnr0ubuokzwSJwSpxH2X4goyLEZE3NaxFbBeD9bhf17 U55w== X-Gm-Message-State: AOAM530IYxlCr9LioWbqrjD8X3HCPIXRv9kP/rVucPuFYTFoe2yFf8Yy R/0AEsYCwbdEz0utGB5JGbm8y+hTkn0= X-Google-Smtp-Source: ABdhPJzF9+Nk/v1e+IORJTpZkMVYVXQaR5H/g32fEnT5kopKJxEF4giw1JFx2PCnsFVk/SYs+2rDBQ== X-Received: by 2002:a63:f80f:: with SMTP id n15mr42078151pgh.394.1641260423672; Mon, 03 Jan 2022 17:40:23 -0800 (PST) Original-Received: from smtpclient.apple ([2600:1700:2ec7:8c90:4cba:2447:3be8:afa7]) by smtp.gmail.com with ESMTPSA id l186sm32869168pga.24.2022.01.03.17.40.22 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 03 Jan 2022 17:40:23 -0800 (PST) In-Reply-To: <86mtke3q0z.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::530 (failed) Received-SPF: pass client-ip=2607:f8b0:4864:20::530; envelope-from=casouri@gmail.com; helo=mail-pg1-x530.google.com X-Spam_score_int: 6 X-Spam_score: 0.6 X-Spam_bar: / X-Spam_report: (0.6 / 5.0 requ) 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:284109 Archived-At: > On Jan 2, 2022, at 11:18 AM, Juri Linkov wrote: >=20 >>>> Overall, from my limited knowledge, I think the old approach is = more >>>> reliable: I wouldn=E2=80=99t have this problem with the old = approach. And the >>>> new functionality added by the new approach and >>>> outline-minor-mode-cycle-filter can be easily implemented in the = old >>>> approach. We don=E2=80=99t need to fiddle with font-lock-keywords = with the >>>> old approach, either. How about we go back to the old approach? >>>=20 >>> Some time ago we discussed this possibility, but it will require = writing >>> too many wrappers for different modes, for example, for diff-mode: >>>=20 >>> (defvar-keymap diff-mode-shared-map >>> "TAB" (lambda () (interactive) >>> (if (and outline-minor-mode (outline-on-heading-p)) >>> (outline-cycle) >>> (diff-hunk-next))) >>> ... >>=20 >> Why? The old approach used a conditional binding, so it should "just >> work" without the major modes knowing about it. >=20 > Then maybe something like this (not tested): [=E2=80=A6] This looks really good to me, for what it=E2=80=99s worth. Yuan=