From: Philipp Haselwarter <philipp.haselwarter@gmx.de>
To: help-gnu-emacs@gnu.org
Subject: Re: Different options for different modes?
Date: Thu, 29 Mar 2012 11:51:59 +0200 [thread overview]
Message-ID: <87vclnpwe8.fsf@nzebook.haselwarter.org> (raw)
In-Reply-To: 8c415ae4-eedc-41e2-9993-0c2fbd8b3573@t3g2000vbe.googlegroups.com
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
next prev parent reply other threads:[~2012-03-29 9:51 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-09-23 14:24 Different options for different modes? winkerbean
2012-03-29 9:51 ` Philipp Haselwarter [this message]
[not found] ` <mailman.53.1333014742.20052.help-gnu-emacs@gnu.org>
2012-03-29 13:00 ` rusi
2012-04-04 0:59 ` Stefan Monnier
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87vclnpwe8.fsf@nzebook.haselwarter.org \
--to=philipp.haselwarter@gmx.de \
--cc=help-gnu-emacs@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.