From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Kai Grossjohann Newsgroups: gmane.emacs.help Subject: Re: Tab problem Date: Mon, 06 Sep 2004 14:16:44 +0200 Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Message-ID: <86r7pfsic3.fsf@ketchup.de.uu.net> References: <4139c71c$0$22757$db0fefd9@news.zen.co.uk> <413c4a08$0$22753$db0fefd9@news.zen.co.uk> NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1094473072 5154 80.91.224.253 (6 Sep 2004 12:17:52 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 6 Sep 2004 12:17:52 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Mon Sep 06 14:17:44 2004 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1C4IRM-00025S-00 for ; Mon, 06 Sep 2004 14:17:44 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1C4IWW-0003Vz-Rx for geh-help-gnu-emacs@m.gmane.org; Mon, 06 Sep 2004 08:23:04 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.33) id 1C4IWM-0003Vo-B2 for help-gnu-emacs@gnu.org; Mon, 06 Sep 2004 08:22:54 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.33) id 1C4IWK-0003Vb-Qj for help-gnu-emacs@gnu.org; Mon, 06 Sep 2004 08:22:54 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1C4IWK-0003VY-OE for help-gnu-emacs@gnu.org; Mon, 06 Sep 2004 08:22:52 -0400 Original-Received: from [80.91.224.249] (helo=main.gmane.org) by monty-python.gnu.org with esmtp (Exim 4.34) id 1C4IQj-0004E4-Qz for help-gnu-emacs@gnu.org; Mon, 06 Sep 2004 08:17:06 -0400 Original-Received: from list by main.gmane.org with local (Exim 3.35 #1 (Debian)) id 1C4IQi-0005Qh-00 for ; Mon, 06 Sep 2004 14:17:04 +0200 Original-Received: from 139.4.37.213 ([139.4.37.213]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 06 Sep 2004 14:17:04 +0200 Original-Received: from kai by 139.4.37.213 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 06 Sep 2004 14:17:04 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-To: help-gnu-emacs@gnu.org Original-Lines: 50 Original-X-Complaints-To: usenet@sea.gmane.org X-Gmane-NNTP-Posting-Host: 139.4.37.213 User-Agent: Gnus/5.110003 (No Gnus v0.3) Emacs/21.3.50 (gnu/linux) Cancel-Lock: sha1:Kj9PdribUHPQvNYmlCdaQGcaSlA= X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 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 Xref: main.gmane.org gmane.emacs.help:20454 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:20454 Nick Chorley writes: > It was mainly so I could put comments in without simply entering a > load of spaces. Try to hit M-; when you want to enter a comment. Also see the variable comment-column. > Apart from that, well, I don't like the way it indents things > like switch statements (ie. the case x: bits go right underneath the > word switch, instead of being indented a bit, if you see what I mean). That is easy to configure. First of all, there are different indentation styles. You can choose among them with C-c . I believe. Perhaps one of them suits your coding style. If not, then choose the one that's closest, then go to the first line with wrong indentation, use C-c C-o to customize its indentation, then reindent the line to see if it was right. If you find an indentation style that's basically right except that its indentation level is wrong (say it indents 5 inside curlies but you want 3), then you can simply set c-basic-offset, using M-x set-variable RET c-basic-offset RET 42 RET. You can make those changes permanent by writing some small amount of Lisp: (defun nick-c-mode-setup () (c-set-style "bla") (setq c-basic-offset 42) (c-set-offset 'frumple 'foo)) (add-hook 'c-mode-hook 'nick-c-mode-setup) Similar for other modes, such as c++ or java, instead of c. The "bla" comes from the C-c . key. The frumple and foo come from C-c C-o. You can find the right c-set-offset statement by typing C-x ESC ESC and then navigating the history with M-p/M-n. The CC mode info file explains how to customize indentation much better than I can. In any case, imagine how wonderful it would be if you could go to any unreadable bit of source code, merely hit C-x h C-M-\, and then it would be indented the way you like! Kai