From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: master 6458e16: New mode outline-cycle-minor-mode with Orgmode-like TAB cycling on headings Date: Wed, 03 Mar 2021 16:44:07 -0500 Message-ID: References: <20210303191236.24697.93201@vcs0.savannah.gnu.org> <20210303191237.2B2D720E1B@vcs0.savannah.gnu.org> <87zgzkug5d.fsf@mail.linkov.net> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="23161"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.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 Wed Mar 03 22:45:10 2021 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 1lHZIs-0005rX-7e for ged-emacs-devel@m.gmane-mx.org; Wed, 03 Mar 2021 22:45:10 +0100 Original-Received: from localhost ([::1]:45438 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lHZIr-00010y-8o for ged-emacs-devel@m.gmane-mx.org; Wed, 03 Mar 2021 16:45:09 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:42994) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lHZHz-0000Yq-LM for emacs-devel@gnu.org; Wed, 03 Mar 2021 16:44:15 -0500 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:5507) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lHZHw-0000zO-K2 for emacs-devel@gnu.org; Wed, 03 Mar 2021 16:44:14 -0500 Original-Received: from pmg3.iro.umontreal.ca (localhost [127.0.0.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id E395D441DF9; Wed, 3 Mar 2021 16:44:10 -0500 (EST) Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 1B41A441DF7; Wed, 3 Mar 2021 16:44:09 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1614807849; bh=/jy2Oqn03KM6zu8+mmeIrVnYxMMfL5/GqGcEZkQ4KY0=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=E6R7aJPPjcBk1bh4b3oEgtPXVTGvxmUCk5j9WEJ8kMjuHDayOg/xRG+s+Dnw9GjsN LRmmUmD9puKz9rAIsSbvS6B4xsgWC/XO/VocjU+3UyW2/qfI5NOjYnWR8K34chXRcz Yxl4UYOuCEwRN92O//5A2vIbWJOxfdMXVALsjAhDnGxd0x6rWIksPhjJxsM/t0OwaZ S7t9D+FW464dVYpdeibtBoa0Qu48dGFzv5aWBYFSUcDJmdGOSD83oDdOjBJM84GAru 7OKfrtzpi0EghwXhE9CKbwBNWiUOiIKVIjBC5vSor6E7NHqdpaVJ+T8YDcyKKcV4rv kfsyCvXq/JYJg== Original-Received: from alfajor (unknown [216.154.43.249]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id D4B121202CA; Wed, 3 Mar 2021 16:44:08 -0500 (EST) In-Reply-To: <87zgzkug5d.fsf@mail.linkov.net> (Juri Linkov's message of "Wed, 03 Mar 2021 22:38:22 +0200") Received-SPF: pass client-ip=132.204.25.50; envelope-from=monnier@iro.umontreal.ca; helo=mailscanner.iro.umontreal.ca X-Spam_score_int: -42 X-Spam_score: -4.3 X-Spam_bar: ---- X-Spam_report: (-4.3 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 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:265917 Archived-At: >> This is very welcome functionality (and the highlighting as well). >> I wonder if we really need the new minor modes, tho, instead of just >> sticking to the new `outline-minor-mode-cycle` and >> `outline-minor-mode-highlight` variables (which we could make into >> `defcustom`s). > > One example (mostly for demonstration purposes) currently is > in etc/compilation.txt. whose Local Variables contains just: > > ;;; eval: (outline-cycle-highlight-minor-mode) > > Initially I implemented this only with variables and without modes > like you suggested: > > ;;; outline-minor-mode-cycle: t > ;;; outline-minor-mode-highlight: t > ;;; eval: (outline-minor-mode 1) > > But then thought that maybe with a mode would be more concise and convenient. > > I'm fine with removing these modes after analyzing more use cases. BTW, I'm writing under the assumption that we'd want to eventually have both of those vars default to t. >> IOW, I wonder if there are many use cases where users will want to have >> some `outline-minor-mode` buffers with cycling and others without. > Here's is a list of use cases where I tried to use outline-minor-mode > with cycling, and somewhere also with highlighting. Any mode where you've found bad interactions? > 3. (add-hook 'emacs-lisp-mode-hook 'outline-cycle-minor-mode) > without outline highlighting to not overwrite major mode faces In which way did the highlighting get in the way? > But none of them require to disable cycling. I don't know where > outline-minor-mode without cycling would be needed. Maybe in > external packages that implement own cycling in outline-minor-mode > like in https://debbugs.gnu.org/41198#99 FWIW, I think the only really good way to solve this problem is to replace `indent-for-tab-command` with a new command (call it `tab-dwim`?) which can be more finely configured by major and minor modes. E.g. by making it call `tab-dwim-function` on which modes can `add-function` at will (and at various depths so they can control whether it should take precedence or not over the "TAB causes indentation" or "TAB causes completion", ...). The mechanism of priorities of keymaps coupled with "fallthrough" (either via the "menu-item + filter" trick or via some explicitly looking up the keymaps and calling the next command) isn't fine-grained enough to deal with the amount of overloading that people want to use on that poor TAB key. Stefan