ruby-insert-encoding-magic-comment = nil

It is the default with enh-ruby-mode.

Also: refactor ruby-mode config out of enh-ruby-mode.
This commit is contained in:
Henrik Lissner 2020-02-20 15:25:38 -05:00
parent dbf9c92b48
commit 59cb9b4aba
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395

View file

@ -7,15 +7,18 @@
;; ;;
;;; Packages ;;; Packages
(after! ruby-mode
(setq ruby-insert-encoding-magic-comment nil)
(when (require 'enh-ruby-mode nil t)
(rassq-delete-all 'ruby-mode interpreter-mode-alist)))
(use-package! enh-ruby-mode (use-package! enh-ruby-mode
:mode ("\\.\\(?:pry\\|irb\\)rc\\'" . +ruby-init-h) :mode ("\\.\\(?:pry\\|irb\\)rc\\'" . +ruby-init-h)
:mode ("\\.\\(?:rb\\|rake\\|rabl\\|ru\\|builder\\|gemspec\\|jbuilder\\|thor\\)\\'" . +ruby-init-h) :mode ("\\.\\(?:rb\\|rake\\|rabl\\|ru\\|builder\\|gemspec\\|jbuilder\\|thor\\)\\'" . +ruby-init-h)
:mode ("/\\(?:Berks\\|Cap\\|Gem\\|Guard\\|Pod\\|Puppet\\|Rake\\|Thor\\|Vagrant\\)file\\'" . +ruby-init-h) :mode ("/\\(?:Berks\\|Cap\\|Gem\\|Guard\\|Pod\\|Puppet\\|Rake\\|Thor\\|Vagrant\\)file\\'" . +ruby-init-h)
:interpreter ("j?ruby\\([0-9.]+\\)" . +ruby-init-h) :interpreter ("j?ruby\\([0-9.]+\\)" . +ruby-init-h)
:preface :preface
(after! ruby-mode
(rassq-delete-all 'ruby-mode interpreter-mode-alist)
(require 'enh-ruby-mode))
(defun +ruby-init-h () (defun +ruby-init-h ()
"Enable `enh-ruby-mode' if ruby is available, otherwise `ruby-mode'." "Enable `enh-ruby-mode' if ruby is available, otherwise `ruby-mode'."
(if (executable-find "ruby") (if (executable-find "ruby")