emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] add outline regexp to ruby-mode


From: Yilkal Argaw
Subject: Re: [PATCH] add outline regexp to ruby-mode
Date: Fri, 8 Jul 2022 11:27:48 +0300

> I'd still prefer the simpler regexp suggested by Juri, as it's more intention 
> revealing, but I can live with using ruby-indent-beg-re as well.

For my personal use I used to use a similar approach where I defined
outline-regexp through ruby-mode-hook. But I did not want to add an
additional regex that might be left trailing when the regex for the
syntax parsing changes. It might turn out to be an additional load for
the package maintainer and it might not be noticed by new contributors
when changing the syntax parsing rules up top.

It might also be good to add ```outline-heading-end-regexp``` and
```outline-level``` for completeness but my knowledge of regular
expressions and outline-mode is a bit limited. Maybe someone might
help with that. But for now only defining outline-regexp covers most
use cases so I don't mind if mine or Juri's solution was merged.

The regex I used to use personally is the one below incase anyone
finds it helpful

 "^\\([ \t]*\\)class \\|^\\([ \t]*\\)module \\|^\\([ \t]*\\)def "




On Fri, Jul 8, 2022 at 8:41 AM Bozhidar Batsov <bozhidar@batsov.dev> wrote:
>
> I'd still prefer the simpler regexp suggested by Juri, as it's more intention 
> revealing, but I can live with using ruby-indent-beg-re as well.
>
> On Fri, Jul 8, 2022, at 4:12 AM, Dmitry Gutov wrote:
>
> On 06.07.2022 11:06, Juri Linkov wrote:
> > But now I noticed that actually if/unless/case/... in
> > ruby-indent-beg-re has no effect on outlines, because
> > they are on a separate regexp group.  So using it for
> > outline-regexp would be fine.  Then I only suggest
> > to add outline-level as well.
>
> If the result looks good to you, please go ahead.
>
>
>



reply via email to

[Prev in Thread] Current Thread [Next in Thread]