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 20:37:51 +0100 Message-ID: <9a88bc11-2325-b4cb-5253-4580134234d3@grinta.net> References: <20210303191236.24697.93201@vcs0.savannah.gnu.org> <20210303191237.2B2D720E1B@vcs0.savannah.gnu.org> <87zgzkug5d.fsf@mail.linkov.net> <9d5801ee-7b73-9312-063e-5cefe227123e@grinta.net> <87zgzi69zr.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="20670"; 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 Cc: emacs-devel@gnu.org To: Juri Linkov Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Thu Mar 04 20:39:30 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 1lHton-0005Fj-Qm for ged-emacs-devel@m.gmane-mx.org; Thu, 04 Mar 2021 20:39:29 +0100 Original-Received: from localhost ([::1]:40230 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lHtom-0000FP-Q6 for ged-emacs-devel@m.gmane-mx.org; Thu, 04 Mar 2021 14:39:28 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:47882) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lHtnL-00084J-3V for emacs-devel@gnu.org; Thu, 04 Mar 2021 14:37:59 -0500 Original-Received: from grinta.net ([109.74.203.128]:34996) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lHtnI-0005zO-5I for emacs-devel@gnu.org; Thu, 04 Mar 2021 14:37:58 -0500 Original-Received: from black.local (p4fe717e2.dip0.t-ipconnect.de [79.231.23.226]) (Authenticated sender: daniele) by grinta.net (Postfix) with ESMTPSA id 2C575E07DC; Thu, 4 Mar 2021 19:37:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=grinta.net; s=2020; t=1614886673; bh=lSfBCNNxakPWXXx3cpIYWE34c7oSmhv02sIYK1wwoRE=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From; b=olZnrXG6LBieJk8YO/oDXEXeQBImteKP7BfVQALbcQVPe5w184V04LjZ3gh5DIZN8 NNY+z/NLFeJzTiy5G+E9VH9em5cH+G7KKjAxxrPp2ecl2oktqYhAg51M12g8ti1OPf becX9McLBDFfa0ui5ALTxsWToS9G/cYXVd4cS8yziGEVzFuJTKJDG94AkSke5r05hN tH76SXcM7ZsE28YlQAIEvcMqgOExDoOIFQns9GgIbDVWeOm30RbhmjX8wYmemlqChA f20CYeVRpGnYCwpWypHUPgTqnAEgcdXncSIkU/P0dUmAN7wd7dH/BO42SWkGmSOkrz TblgXHFWHWfrg== In-Reply-To: <87zgzi69zr.fsf@mail.linkov.net> 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:265981 Archived-At: On 04/03/2021 19:17, Juri Linkov wrote: >>>> 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? > > It's easier to set them using minor-mode like > > (add-hook 'emacs-lisp-mode-hook 'outline-cycle-highlight-minor-mode) > > than using lambda > > (add-hook 'emacs-lisp-mode-hook > (lambda () > (setq-local outline-minor-mode-cycle t) > (setq-local outline-minor-mode-highlight t) > (outline-minor-mode 1))) That would seem to imply that there should be a minor-mode for every buffer-local safe variable in Emacs... :-) >> 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. > > outline-minor-mode-highlight already works surprisingly well, > and doesn't override faces added by major mode. Doesn't that mean that it does not apply the faces most of the time? In almost all my use of outline-mirror mode, the headings are comments in the current major mode, and almost always are fontified as such by the major mode. I should probably try your code. Do you know if it works in Emacs 27? That would spare me from having to compile Emacs. Cheers, Dan