From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Florian Lindner Newsgroups: gmane.emacs.help Subject: Re: Modify indention for C/C++ Date: Wed, 11 Jun 2014 16:23:41 +0200 Message-ID: References: <87oaxzsgtm.fsf@mithlond.arda> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1402496658 1113 80.91.229.3 (11 Jun 2014 14:24:18 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 11 Jun 2014 14:24:18 +0000 (UTC) Cc: help-gnu-emacs@gnu.org To: Teemu Likonen Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Jun 11 16:24:11 2014 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 1WujRg-00046z-Jw for geh-help-gnu-emacs@m.gmane.org; Wed, 11 Jun 2014 16:24:08 +0200 Original-Received: from localhost ([::1]:46780 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WujRg-0002Nn-56 for geh-help-gnu-emacs@m.gmane.org; Wed, 11 Jun 2014 10:24:08 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:36219) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WujRP-0002NO-0U for help-gnu-emacs@gnu.org; Wed, 11 Jun 2014 10:23:58 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WujRH-0005h7-HV for help-gnu-emacs@gnu.org; Wed, 11 Jun 2014 10:23:50 -0400 Original-Received: from astarte.centershock.net ([5.45.98.111]:43658) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WujRH-0005h2-Ad for help-gnu-emacs@gnu.org; Wed, 11 Jun 2014 10:23:43 -0400 Original-Received: from astarte.centershock.net (unknown [IPv6:::1]) by astarte.centershock.net (Postfix) with ESMTPA id 114DCFF93A; Wed, 11 Jun 2014 16:23:41 +0200 (CEST) In-Reply-To: <87oaxzsgtm.fsf@mithlond.arda> X-Sender: mailinglists@xgm.de User-Agent: Roundcube Webmail/1.0.1 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 5.45.98.111 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:98148 Archived-At: Am 11.06.2014 15:42, schrieb Teemu Likonen: > Florian Lindner [2014-06-11 15:24:34 +02:00] wrote: > >> what is the canonical way to modify indention for certain keywords? >> I've found numerous ways in the internets. I want to change the linux >> style so, that is does not do indention for namespaces. >> >> (c-add-style "linux" >> '( >> (c-basic-offset . 2) >> (c-offset-alist . ( >> (namespace-open . 0) >> (namespace-close . 0) >> (innamespace . 0) >> )) >> )) > > How about this? > > (c-add-style "my-linux" > '("linux" > (c-basic-offset . 2) > (c-offset-alist (namespace-open . 0) > (namespace-close . 0) > (innamespace . 0)))) > > This adds "my-linux" style, so the original is not overwritten. c-style-alist now has an entry: ("my-linux" "linux" (c-basic-offset . 2) (c-offset-alist (namespace-open . 0) (namespace-close . 0) (innamespace . 0))) Does that mean the mode is derived from linux? Indention is still the same, after a namespace code is being indented. I've activated the my-linux style. Thx, Florian