all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Yilkal Argaw <yilkalargawworkneh@gmail.com>
To: Bozhidar Batsov <bozhidar@batsov.dev>
Cc: Emacs Devel <emacs-devel@gnu.org>
Subject: Re: [PATCH] add outline regexp to ruby-mode
Date: Fri, 8 Jul 2022 11:27:48 +0300	[thread overview]
Message-ID: <CAJddU=qH0vxQMi9QvjOzXOLpT7gNnu=fX_8-Rzw-5Tye58mjFQ@mail.gmail.com> (raw)
In-Reply-To: <fd58d537-2bdd-413e-86be-b389ccfdcd38@www.fastmail.com>

> 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	other threads:[~2022-07-08  8:27 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-05 23:28 [PATCH] add outline regexp to ruby-mode Yilkal Argaw
2022-07-05 23:48 ` Yilkal Argaw
2022-07-06  7:04   ` Bozhidar Batsov
2022-07-06  8:06     ` Juri Linkov
2022-07-08  1:12       ` Dmitry Gutov
2022-07-08  5:38         ` Bozhidar Batsov
2022-07-08  8:27           ` Yilkal Argaw [this message]
2022-07-08 17:18             ` 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='CAJddU=qH0vxQMi9QvjOzXOLpT7gNnu=fX_8-Rzw-5Tye58mjFQ@mail.gmail.com' \
    --to=yilkalargawworkneh@gmail.com \
    --cc=bozhidar@batsov.dev \
    --cc=emacs-devel@gnu.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.