From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Yilkal Argaw Newsgroups: gmane.emacs.devel Subject: Re: [PATCH] add outline regexp to ruby-mode Date: Fri, 8 Jul 2022 11:27:48 +0300 Message-ID: References: <867d4qvep9.fsf@mail.linkov.net> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="982"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Emacs Devel To: Bozhidar Batsov Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Fri Jul 08 10:29:29 2022 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 1o9jMe-000AbJ-Mx for ged-emacs-devel@m.gmane-mx.org; Fri, 08 Jul 2022 10:29:28 +0200 Original-Received: from localhost ([::1]:48540 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o9jMd-00067b-M2 for ged-emacs-devel@m.gmane-mx.org; Fri, 08 Jul 2022 04:29:27 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:50058) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o9jLH-0005Pp-VN for emacs-devel@gnu.org; Fri, 08 Jul 2022 04:28:07 -0400 Original-Received: from mail-yw1-x1134.google.com ([2607:f8b0:4864:20::1134]:45598) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1o9jLE-00071S-GX for emacs-devel@gnu.org; Fri, 08 Jul 2022 04:28:02 -0400 Original-Received: by mail-yw1-x1134.google.com with SMTP id 00721157ae682-31bf3656517so191572597b3.12 for ; Fri, 08 Jul 2022 01:28:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=Xp60oQ43ES5JjN8efPSKbabQIU1PeokAroNtFEFtFRI=; b=Oc5LdRlAUJxtXv9gh0i3JrQ/AMMfHoMKaneyyF7BuvwK6CE3CU/5b1E81HrZf8XBpG 9fBaV0m96nctLNU2GkcqMZQDL1UC53zAoI0ofqGPZxtx7P117TAAa8oBxQXVSCobsnI9 3LT4o6xhpHTX445/1RlJcCrbhDAENp734ZES6WeFsqH0F3vB8Z012KnkcMrqAmgNSE+9 5uUs+lwnWrUiMHiEQgCeFGcNx+upaG9GbBpIaOdHeDl9Wxpd863AaVR2Dr9hgdvOBlO7 P+/Z0uXYFDtV0Tw71gdBKpTTi0a4ZItMua735KyXXZH1FVD6YLh6PeDfBYYHGyuQlTwJ gGsg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=Xp60oQ43ES5JjN8efPSKbabQIU1PeokAroNtFEFtFRI=; b=dKIPBnhGcQKZYlTQ2YTC4oQq2+6mpBed5wIxpbZxd4E/jp2TP7XYmHzKsz1nZ/pu6U ZvOF9C0RdwsrfbXs0sPLMPU5gRJoKEc8arFW59kTyrbNFMXYIhx4P6IgoOn6qo/AhGG0 3ofpXtioxZpwl/by/0njyl2DqhlYWqKfPd4qAO3jUPqpgBEuuDnxc5yIVGAhWyVQkXG2 g1KiC5GBYGh+hMsH8AHbbEEGzt8kevvbJBfaJXGSF/Hnov3PjPNO/omABufi7eQo0aL2 JYn00otjEc7t4BoyygVQQWiuOYYzsyXR+SKxuLGWl3ByRRIZ8dsOxkMWcWk+T8Rv7qWa dMRA== X-Gm-Message-State: AJIora/Xy5UjU4jYgrw6X08jSlyUbPtsF/Yx/SIf4K6xqSWEVLw9DHFG c2ONpmIsQVSU9kPJoN4/0mk4M3spozYlYsVhUceStSNiDeo= X-Google-Smtp-Source: AGRyM1s62VWTspNPewvhnpeueZ0AkRx1tRRFQ0PPtLoF/EptRZpldQt968Jzdh6J+uWg66FcT8+JA0BXRtAy6zB28IQ= X-Received: by 2002:a81:8842:0:b0:31c:11ff:149 with SMTP id y63-20020a818842000000b0031c11ff0149mr2507254ywf.351.1657268879418; Fri, 08 Jul 2022 01:27:59 -0700 (PDT) In-Reply-To: Received-SPF: pass client-ip=2607:f8b0:4864:20::1134; envelope-from=yilkalargawworkneh@gmail.com; helo=mail-yw1-x1134.google.com 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, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 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:291948 Archived-At: > 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 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. > > >