From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Daniele Nicolodi Newsgroups: gmane.emacs.devel Subject: Re: master 6458e16: New mode outline-cycle-minor-mode with Orgmode-like TAB cycling on headings Date: Thu, 4 Mar 2021 18:03:56 +0100 Message-ID: <9d5801ee-7b73-9312-063e-5cefe227123e@grinta.net> 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; charset=utf-8 Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="17166"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:78.0) Gecko/20100101 Thunderbird/78.8.0 To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Thu Mar 04 18:11: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 1lHrVF-0004K0-JR for ged-emacs-devel@m.gmane-mx.org; Thu, 04 Mar 2021 18:11:09 +0100 Original-Received: from localhost ([::1]:53580 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lHrVE-0001fS-IE for ged-emacs-devel@m.gmane-mx.org; Thu, 04 Mar 2021 12:11:08 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:43806) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lHrOO-000596-Ns for emacs-devel@gnu.org; Thu, 04 Mar 2021 12:04:04 -0500 Original-Received: from grinta.net ([109.74.203.128]:34634) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lHrOL-0003Hk-JN for emacs-devel@gnu.org; Thu, 04 Mar 2021 12:04:04 -0500 Original-Received: from black.local (ip-109-41-64-162.web.vodafone.de [109.41.64.162]) (Authenticated sender: daniele) by grinta.net (Postfix) with ESMTPSA id 850D0E07DC for ; Thu, 4 Mar 2021 17:03:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=grinta.net; s=2020; t=1614877438; bh=1Y9mFwAfUUVRmaw6SnllJsR79KXCqLXt52auJ7ulzC8=; h=Subject:To:References:From:Date:In-Reply-To:From; b=jx9qZI1oZmTtnFx6A+k88PTAH1+KBGe7jizdgUfWSqf3liPNmHkp7m5G9TdITAWaV K0EnX+KyfeGGT3is49SAs6fh5RyYDtnm0ySIf6NjS1gMfPGjPMSOQMeVj4OE4xVd2Z yeg+gYMFthMfbVPhr4+oC2SPlBHitecLaR35i/84hDodsP6tE0+xZ3wlbGoccImSC+ ALUoppqoTq9EMz5aHOFA5Uc3leBpfpOjMGj+wj9a5lurCcNYEVo+tPx+9+qiAVpORb EinSkO9q98VmhWMVnF7e7RL1y124p5E2skLcPCcWYCVn5JSSbC5mmGYeMdrvSYqyW/ SL0jjyS4u6frw== In-Reply-To: Content-Language: en-US Received-SPF: pass client-ip=109.74.203.128; envelope-from=daniele@grinta.net; helo=grinta.net X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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, NICE_REPLY_A=-0.001, SPF_HELO_PASS=-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:265973 Archived-At: On 03/03/2021 22:44, Stefan Monnier wrote: >>> This is very welcome functionality (and the highlighting as well). Having implemented it myself [1], in what seems like a much less elegant way at a quick lock at the code, I fully agree. [1] https://github.com/beancount/beancount-mode/blob/main/beancount.el#L922 >>> 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. Can't you add setting the variables to the minor-mode hooks? I haven't tried your code, but there are occasions in which outline-minor-mode is used to section the buffer on syntactic elements that are already fontified (on function declarations, for example). What does happen then when outline-minor-mode-highlight is t? I think these would be cases in which outline-minor-mode-highlight nil would be better. > 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. That would be nice to have, indeed. Cheers, Dan