help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Different options for different modes?


From: Philipp Haselwarter
Subject: Re: Different options for different modes?
Date: Thu, 29 Mar 2012 11:51:59 +0200
User-agent: Gnus/5.130004 (Ma Gnus v0.4) Emacs/24.0.94 (gnu/linux)

to set options for certain modes emacs uses `hooks', usually following
the naming scheme `foo-mode-hook' where "foo" is the mode in question.

Check out the section on hooks in the emacs info manual:

C-h i m Emacs m Hooks

a quick example could be
#+begin_src: elisp
(defun my-ruby-coding-style nil
  (setq indent-tabs-mode t))

(defun my-c-coding-style nil
  (setq indent-tabs-mode nil
        tab-width 4))

(add-hook 'c-mode-hook 'my-c-coding-style)
(add-hook 'ruby-mode-hook 'my-ruby-coding-style)
#+end_src

-- 
Philipp Haselwarter




reply via email to

[Prev in Thread] Current Thread [Next in Thread]