Emacsをrubyモードで自動的に開いてもらいたいファイルとファイル拡張子の長いリストがあります。Googleを使用することで、機能する最も基本的なソリューションは次のとおりです。
(setq auto-mode-alist (cons '("\.rake$" . ruby-mode) auto-mode-alist))
(setq auto-mode-alist (cons '("\.thor$" . ruby-mode) auto-mode-alist))
(setq auto-mode-alist (cons '("Gemfile$" . ruby-mode) auto-mode-alist))
(setq auto-mode-alist (cons '("Rakefile$" . ruby-mode) auto-mode-alist))
(setq auto-mode-alist (cons '("Crushfile$" . ruby-mode) auto-mode-alist))
(setq auto-mode-alist (cons '("Capfile$" . ruby-mode) auto-mode-alist))
これは私には繰り返しのようです。ペアのリストを一度定義して、それを直接ループまたはコンスする方法はありますauto-mode-alist
か?私はもう試した
(cons '(("\\.rake" . ruby-mode)
("\\.thor" . ruby-mode)) auto-mode-alist)
しかし、それはうまくいかないようです。助言がありますか?