title: Emacs indent level global override
body: <p>I want to set the indentation mode to tabs only, with a 4 character width for any mode. This seems like a trivial thing, but I have not had success. Every mode seems to have its own variables and options. I've tried doing this for Perl and R without success.
  Things that have not worked:</p>
  
  <pre><code>(setq-default tab-width 4)
  (setq standard-indent 4)
  (setq-default r-indent-level 4)
  (setq perl-indent-level 4)
  </code></pre>
  
  <p>(setq c-basic-offset 4) works for c-mode but nothing else. Am I forgetting something? Did I set the wrong variables? Is there no such option?</p>
  
  <p>I work with a variety of languages (R, Perl, sh, C/C++ etc.) on a daily basis. Since I like to use the same indentation across languages, is there such a global override variable that I can set so that the indentation level and style is consistent across all modes? If not, is there a way to set them for each mode on startup? If all else fails, there has to be an elisp script that does this.</p>
  
  <p>Using Emacs 23</p>
  
  <hr>
  
  <p>RESOLVED: I had to set the variables for each mode individually because there is no such global override. You can put the following statements in your ~/.emacs file to configure emacs on startup.</p>
  
  <p>R mode comes from the <a href="http://ess.r-project.org/" rel="nofollow">ESS</a> package. Reading through the documentation, I found this: <code>(setq ess-indent-level 4)</code></p>
  
  <p>In CPerl mode <code>(setq cperl-indent-level 4)</code></p>
  
  <p>Looks like you'll just have to search for the right variable in each mode.</p>