Correctly lazy load ruby-end and fix its activation in ruby mode
resolves #644
This commit is contained in:
parent
ec1f23454a
commit
50f230f27f
|
@ -80,13 +80,14 @@ which require an initialization must be listed explicitly in the list.")
|
||||||
:defer t
|
:defer t
|
||||||
:config
|
:config
|
||||||
(progn
|
(progn
|
||||||
(require 'ruby-end)
|
|
||||||
(add-to-list 'elixir-mode-hook
|
|
||||||
(defun auto-activate-ruby-end-mode-for-elixir-mode ()
|
(defun auto-activate-ruby-end-mode-for-elixir-mode ()
|
||||||
(set (make-variable-buffer-local 'ruby-end-expand-keywords-before-re)
|
(set (make-variable-buffer-local 'ruby-end-expand-keywords-before-re)
|
||||||
"\\(?:^\\|\\s-+\\)\\(?:do\\)")
|
"\\(?:^\\|\\s-+\\)\\(?:do\\)")
|
||||||
(set (make-variable-buffer-local 'ruby-end-check-statement-modifiers) nil)
|
(set (make-variable-buffer-local 'ruby-end-check-statement-modifiers)
|
||||||
(ruby-end-mode +1))))))
|
nil)
|
||||||
|
(ruby-end-mode +1))
|
||||||
|
(add-to-list 'elixir-mode-hook
|
||||||
|
'auto-activate-ruby-end-mode-for-elixir-mode))))
|
||||||
|
|
||||||
(defun erlang-elixir/init-erlang ()
|
(defun erlang-elixir/init-erlang ()
|
||||||
(use-package erlang
|
(use-package erlang
|
||||||
|
@ -132,4 +133,9 @@ which require an initialization must be listed explicitly in the list.")
|
||||||
(defun erlang-elixir/init-ruby-end ()
|
(defun erlang-elixir/init-ruby-end ()
|
||||||
(use-package ruby-end
|
(use-package ruby-end
|
||||||
:defer t
|
:defer t
|
||||||
:config (spacemacs|hide-lighter ruby-end-mode)))
|
:config
|
||||||
|
(progn
|
||||||
|
(spacemacs|hide-lighter ruby-end-mode)
|
||||||
|
;; hack to remove the autoloaded `add-hook' in `ruby-end'
|
||||||
|
(remove-hook 'ruby-mode-hook 'ruby-end-mode)
|
||||||
|
(remove-hook 'enh-ruby-mode-hook 'ruby-end-mode))))
|
||||||
|
|
Loading…
Reference in a new issue