1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2025-01-23 18:47:57 +00:00

* lisp/progmodes/ruby-mode.el (ruby-mode): Set outline-regexp, outline-level.

Suggested by Yilkal Argaw <yilkalargawworkneh@gmail.com>.
This commit is contained in:
Juri Linkov 2022-07-08 20:17:29 +03:00
parent 1c300c983f
commit 033d370a51

View File

@ -2457,6 +2457,13 @@ If there is no Rubocop config file, Rubocop will be passed a flag
(setq-local beginning-of-defun-function #'ruby-beginning-of-defun)
(setq-local end-of-defun-function #'ruby-end-of-defun)
;; `outline-regexp' contains the first part of `ruby-indent-beg-re'
(setq-local outline-regexp (concat "^\\s *"
(regexp-opt '("class" "module" "def"))
"\\_>"))
(setq-local outline-level (lambda () (1+ (/ (current-indentation)
ruby-indent-level))))
(add-hook 'after-save-hook #'ruby-mode-set-encoding nil 'local)
(add-hook 'electric-indent-functions #'ruby--electric-indent-p nil 'local)
(add-hook 'flymake-diagnostic-functions #'ruby-flymake-auto nil 'local)