From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Daniel Mendler Newsgroups: gmane.emacs.bugs Subject: bug#53981: 28.0.91; shortdoc: Add support for outline-minor-mode Date: Thu, 17 Feb 2022 14:44:20 +0100 Message-ID: <3fc750e0-a003-b3f3-a6cb-abe75be2f1a8@daniel-mendler.de> References: <87czjpso5q.fsf@gnus.org> <87sfsky494.fsf@gmail.com> <875ypgqxzg.fsf@gnus.org> <86fsoi29ho.fsf@mail.linkov.net> <87czjln2fq.fsf@gnus.org> 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="37949"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 53981@debbugs.gnu.org, =?UTF-8?Q?K=C3=A9vin?= Le Gouguec To: Lars Ingebrigtsen , Juri Linkov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Feb 17 15:32:52 2022 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1nKhpz-0009db-QW for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 17 Feb 2022 15:32:51 +0100 Original-Received: from localhost ([::1]:38770 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nKhpy-0003ff-Lo for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 17 Feb 2022 09:32:50 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:35790) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nKh5j-00035h-RR for bug-gnu-emacs@gnu.org; Thu, 17 Feb 2022 08:45:05 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:56612) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nKh5h-0002eR-RC for bug-gnu-emacs@gnu.org; Thu, 17 Feb 2022 08:45:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nKh5h-0006z6-P0 for bug-gnu-emacs@gnu.org; Thu, 17 Feb 2022 08:45:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Daniel Mendler Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 17 Feb 2022 13:45:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 53981 X-GNU-PR-Package: emacs Original-Received: via spool by 53981-submit@debbugs.gnu.org id=B53981.164510547426799 (code B ref 53981); Thu, 17 Feb 2022 13:45:01 +0000 Original-Received: (at 53981) by debbugs.gnu.org; 17 Feb 2022 13:44:34 +0000 Original-Received: from localhost ([127.0.0.1]:50509 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nKh5F-0006yB-Ob for submit@debbugs.gnu.org; Thu, 17 Feb 2022 08:44:33 -0500 Original-Received: from server.qxqx.de ([178.63.65.180]:52909 helo=mail.qxqx.de) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nKh5B-0006xt-4t for 53981@debbugs.gnu.org; Thu, 17 Feb 2022 08:44:32 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=qxqx.de; s=mail1392553390; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:From: References:Cc:To:Subject:MIME-Version:Date:Message-ID:Sender:Reply-To: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=VtKvsJ5gxlOt7Thm0HxoNTkDX5MeOjfHrQh3+hbzKXc=; b=BORJkd0yZdgyl8CpmlQ0ujgBN7 lQ9wbDqndhWlqdN2bi1B8HsnKCj4Tbyw6GuHzcmb+PhTawyhu5nvPg3Hjv0kX/iI/gJKvC0gsRQte PObR76XX3PWMVBZFXqaJ15YsALgn/eo19B1fX/mt/t8gWjEf4kzmqO76VHn5LFLevTxo=; Content-Language: en-US In-Reply-To: <87czjln2fq.fsf@gnus.org> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:227096 Archived-At: On 2/17/22 12:43, Lars Ingebrigtsen wrote: > Juri Linkov writes: > >> Is this a promising direction? > > [...] > >> + (setq-local outline-level (lambda () (if (eq (char-after) ?\() 2 1))) >> + (setq-local outline-search-function >> + (lambda (&optional looking-at) >> + (save-excursion >> + (let* ((prop-at (if looking-at >> + (get-text-property (point) 'shortdoc-section) >> + t)) >> + (prop-match (and prop-at (text-property-search-forward 'shortdoc-section)))) >> + (when prop-match >> + (set-match-data (list (prop-match-beginning prop-match) >> + (prop-match-end prop-match))) >> + t)))))) > > No, I was thinking that modes like this would just put a text property > like `outline-heading' (or even just `heading') on the heading, and then > outline-minor-mode would use that. > > I.e., we make modes that generate buffers provide semantics for the data > it's inserted, and then outline-minor-mode reacts to those semantics. I think Juri's approach to provide a search function is better, since it gives more flexibility. At least please don't hard code the `outline-heading` property. Then one could use different properties and retroactively enable outline minor mode for modes which don't come with the outline-heading property. Maybe support a list of properties which indicate headlines? But at that point a function may just be simpler... Daniel