unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Yilkal Argaw <yilkalargawworkneh@gmail.com>
To: emacs-devel@gnu.org
Subject: [PATCH] add outline regexp to ruby-mode
Date: Wed, 6 Jul 2022 02:28:53 +0300	[thread overview]
Message-ID: <CAJddU=qHhYNBiKU+ik0K4Y=RAR93_MUN_aQy9w+5r8QTWu3WgQ@mail.gmail.com> (raw)

Hello guys.
Some programming modes built into emacs provide outline-regexp to
allow for code folding and an example of this is python-mode.
"ruby-mode" on the other hand does does not have this feature. Since
it is a very handy feature to have it might be worth adding with the
following simple patch.

diff --git a/lisp/progmodes/ruby-mode.el b/lisp/progmodes/ruby-mode.el
index a197724634..6437b84628 100644
--- a/lisp/progmodes/ruby-mode.el
+++ b/lisp/progmodes/ruby-mode.el
@@ -2447,6 +2447,7 @@ ruby--prettify-symbols-alist
     ("lambda" . ?λ))
   "Value for `prettify-symbols-alist' in `ruby-mode'.")

+
 ;;;###autoload
 (define-derived-mode ruby-mode prog-mode "Ruby"
   "Major mode for editing Ruby code."
@@ -2465,7 +2466,8 @@ ruby-mode
                                    ((?_ . "w"))))
   (setq-local prettify-symbols-alist ruby--prettify-symbols-alist)

-  (setq-local syntax-propertize-function #'ruby-syntax-propertize))
+  (setq-local syntax-propertize-function #'ruby-syntax-propertize)
+  (setq-local outline-regexp ruby-indent-beg-re))

 ;;; Invoke ruby-mode when appropriate



             reply	other threads:[~2022-07-05 23:28 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-05 23:28 Yilkal Argaw [this message]
2022-07-05 23:48 ` [PATCH] add outline regexp to ruby-mode 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
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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to='CAJddU=qHhYNBiKU+ik0K4Y=RAR93_MUN_aQy9w+5r8QTWu3WgQ@mail.gmail.com' \
    --to=yilkalargawworkneh@gmail.com \
    --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 public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).