LoginSignup
1
1

More than 5 years have passed since last update.

coffee-modeのインデントをタブ文字にする

Last updated at Posted at 2014-02-06

coffee-modeに取り込んでもらえました。
syohexさんありがとうございます。
2014-2-8 追記


スペース派ばっかりなのかな…
後生ですからインデントをタブでもできるようにしてもらいたい><;

とりあえずフォークして改造してみたものの、init-loaderで呼ばれるところでも、なんとかやれそうな気がしてやってみた。

(add-hook 'coffee-mode-hook
    '(lambda ()
        (make-local-variable 'coffee-indent-tabs-mode)
        (set (make-local-variable 'indent-tabs-mode) coffee-indent-tabs-mode)
))

(defcustom coffee-indent-tabs-mode indent-tabs-mode
    "Indentation can insert tabs if this is t. (coffee-mode)"
    :group 'coffee)

(defadvice coffee-insert-spaces (around coffee-insert-spaces-or-tabs (count))
    "Insert spaces or tabs"
    (if coffee-indent-tabs-mode
        (insert-char ?\t (floor count coffee-tab-width))
        (insert-char ?  count)))

(ad-activate 'coffee-insert-spaces)

coffee-mode.el が評価された後に、上記が評価されれば、たぶん大丈夫。

indent-tabs-mode の値に左右されます。

1
1
4

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1