all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Daniel Mendler <mail@daniel-mendler.de>
To: Lars Ingebrigtsen <larsi@gnus.org>, Juri Linkov <juri@linkov.net>
Cc: 53981@debbugs.gnu.org, "Kévin Le Gouguec" <kevin.legouguec@gmail.com>
Subject: bug#53981: 28.0.91; shortdoc: Add support for outline-minor-mode
Date: Thu, 17 Feb 2022 14:44:20 +0100	[thread overview]
Message-ID: <3fc750e0-a003-b3f3-a6cb-abe75be2f1a8@daniel-mendler.de> (raw)
In-Reply-To: <87czjln2fq.fsf@gnus.org>



On 2/17/22 12:43, Lars Ingebrigtsen wrote:
> Juri Linkov <juri@linkov.net> 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






  reply	other threads:[~2022-02-17 13:44 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-13 22:39 bug#53981: 28.0.91; shortdoc: Add support for outline-minor-mode Daniel Mendler
2022-02-14 11:06 ` Lars Ingebrigtsen
2022-02-14 12:23   ` Daniel Mendler
2022-02-14 14:18     ` Lars Ingebrigtsen
2022-02-14 14:29       ` Daniel Mendler
2022-02-15  7:32   ` Kévin Le Gouguec
2022-02-15  9:29     ` Lars Ingebrigtsen
2022-02-15  9:36       ` Daniel Mendler
2022-02-16 18:18       ` Juri Linkov
2022-02-17 11:43         ` Lars Ingebrigtsen
2022-02-17 13:44           ` Daniel Mendler [this message]
2022-02-17 15:02             ` Lars Ingebrigtsen
2022-02-17 17:45           ` Juri Linkov
2022-02-19 12:49             ` Lars Ingebrigtsen
2022-11-08 19:12 ` Juri Linkov
2022-11-08 19:32   ` Eli Zaretskii
2022-11-09 17:17     ` Juri Linkov
2022-11-16 19:14       ` Juri Linkov
2022-11-21  7:57         ` Juri Linkov
2022-11-09 17:24     ` Juri Linkov
2022-11-09 17:34       ` Eli Zaretskii
2022-11-09 19:47         ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-11-09 20:09           ` Eli Zaretskii
2022-11-09 20:14             ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-11-10  7:42             ` Juri Linkov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3fc750e0-a003-b3f3-a6cb-abe75be2f1a8@daniel-mendler.de \
    --to=mail@daniel-mendler.de \
    --cc=53981@debbugs.gnu.org \
    --cc=juri@linkov.net \
    --cc=kevin.legouguec@gmail.com \
    --cc=larsi@gnus.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.