From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Philipp Haselwarter Newsgroups: gmane.emacs.help Subject: Re: Different options for different modes? Date: Thu, 29 Mar 2012 11:51:59 +0200 Message-ID: <87vclnpwe8.fsf@nzebook.haselwarter.org> References: <8c415ae4-eedc-41e2-9993-0c2fbd8b3573@t3g2000vbe.googlegroups.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1333014747 22058 80.91.229.3 (29 Mar 2012 09:52:27 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Thu, 29 Mar 2012 09:52:27 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Mar 29 11:52:26 2012 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1SDC1p-0001TU-4O for geh-help-gnu-emacs@m.gmane.org; Thu, 29 Mar 2012 11:52:25 +0200 Original-Received: from localhost ([::1]:42129 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SDC1o-0002fJ-DV for geh-help-gnu-emacs@m.gmane.org; Thu, 29 Mar 2012 05:52:24 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:43055) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SDC1i-0002ed-Hw for help-gnu-emacs@gnu.org; Thu, 29 Mar 2012 05:52:19 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SDC1b-0005YU-Rj for help-gnu-emacs@gnu.org; Thu, 29 Mar 2012 05:52:18 -0400 Original-Received: from plane.gmane.org ([80.91.229.3]:49334) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SDC1b-0005Xi-Kd for help-gnu-emacs@gnu.org; Thu, 29 Mar 2012 05:52:11 -0400 Original-Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1SDC1Z-0001HF-Sy for help-gnu-emacs@gnu.org; Thu, 29 Mar 2012 11:52:09 +0200 Original-Received: from 153.71.114.78.rev.sfr.net ([78.114.71.153]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 29 Mar 2012 11:52:09 +0200 Original-Received: from philipp.haselwarter by 153.71.114.78.rev.sfr.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 29 Mar 2012 11:52:09 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 22 Original-X-Complaints-To: usenet@dough.gmane.org X-Gmane-NNTP-Posting-Host: 153.71.114.78.rev.sfr.net X-NSA-Fodder: cybercash bootleg jihad Majic Tony Blair radar BLU-114/B AMEMB X-Meat: Chicken Fried Steak User-Agent: Gnus/5.130004 (Ma Gnus v0.4) Emacs/24.0.94 (gnu/linux) Cancel-Lock: sha1:Ke0y7WtbDUmNpkIGm8XIj4wqjnM= X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 80.91.229.3 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:84206 Archived-At: 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