unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* [PATCH] add outline regexp to ruby-mode
@ 2022-07-05 23:28 Yilkal Argaw
  2022-07-05 23:48 ` Yilkal Argaw
  0 siblings, 1 reply; 8+ messages in thread
From: Yilkal Argaw @ 2022-07-05 23:28 UTC (permalink / raw)
  To: emacs-devel

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



^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2022-07-08 17:18 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
2022-07-08 17:18             ` Juri Linkov

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).