0

I try to use tabs instead spaces in emacs with ruby-mode, but I can't do it. There is my fragment from my emacs dot-file

(setq-default indent-tabs-mode t)
(setq-default tab-width 2)

but it doesn't works, I guess this have trouble by reason ruby-mode. And how I can fix it?

sorry for my bad English

2
  • (setq indent-tabs-mode) is malformed. You need a second argument: the value to assign.
    – Drew
    Aug 11, 2016 at 16:26
  • @Drew yes, I know. Sorry, I didnt see error in my question
    – ve ar
    Aug 11, 2016 at 16:51

1 Answer 1

0

I don't write Ruby code, so don't know about the ruby-mode in particular. But it seems that you need to wrap your setting by a hook to the ruby-mode. How about trying this?

(add-hook 'ruby-mode-hook 
          (lambda ()
            (setq indent-tabs-mode t)
            (setq tab-width 2)))
3
  • thanks, I trying it now, but I get this error Wrong type argument: symbolp, (robe-mode inf-ruby-minor-mode)
    – ve ar
    Aug 11, 2016 at 16:57
  • sorry, my mistake. I forgot the ' symbol before ruby-mode-hook. Can you try it again? I updated on the answer as well.
    – Trung Ta
    Aug 11, 2016 at 16:59
  • thanks! but update please your answer. It works when (setq indent-tabs-mode) gets the second argument t :)
    – ve ar
    Aug 11, 2016 at 17:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.