From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Suvayu Ali Newsgroups: gmane.emacs.help Subject: Re: change spaces indent in text mode? Date: Sat, 06 Feb 2010 23:23:09 -0800 Message-ID: <4B6E6A5D.9060006@gmail.com> References: <87wrz0ittg.fsf@mithlond.arda> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1265527480 23321 80.91.229.12 (7 Feb 2010 07:24:40 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 7 Feb 2010 07:24:40 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sun Feb 07 08:24:36 2010 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Ne1VQ-0001so-3T for geh-help-gnu-emacs@m.gmane.org; Sun, 07 Feb 2010 08:24:32 +0100 Original-Received: from localhost ([127.0.0.1]:37819 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Ne1VO-0005At-2C for geh-help-gnu-emacs@m.gmane.org; Sun, 07 Feb 2010 02:24:30 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Ne1UL-0005Ao-Sq for help-gnu-emacs@gnu.org; Sun, 07 Feb 2010 02:23:25 -0500 Original-Received: from [199.232.76.173] (port=34305 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Ne1UG-0005Ag-Ld for help-gnu-emacs@gnu.org; Sun, 07 Feb 2010 02:23:21 -0500 Original-Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1Ne1UA-00035i-4o for help-gnu-emacs@gnu.org; Sun, 07 Feb 2010 02:23:20 -0500 Original-Received: from mail-pz0-f183.google.com ([209.85.222.183]:34573) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Ne1U9-00035O-Ou for help-gnu-emacs@gnu.org; Sun, 07 Feb 2010 02:23:13 -0500 Original-Received: by pzk13 with SMTP id 13so3052004pzk.24 for ; Sat, 06 Feb 2010 23:23:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:sender:message-id:date:from :user-agent:mime-version:to:subject:references:in-reply-to :content-type:content-transfer-encoding; bh=L2YWlDTkAnWeZZ9xQyYGb8uYocDMlhBzlvES7MRo+cQ=; b=aSccUZmJ1awhwDptEwoa2HuO9bdbXwWFFJaOZ9yWeCQftnEZ7NRP8PRDeLCxeySOAW KFU4TQ0GzyFfrxBtGWlu9xrLJH6u9fbGQo2QtY4DfuQCteJdzMV/AdAeu3eXLZAtJXco IE6MoC5zZMuAouJwkdrwG3Feadu7Upkw+luzs= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=sender:message-id:date:from:user-agent:mime-version:to:subject :references:in-reply-to:content-type:content-transfer-encoding; b=Ag5FYZG3PRNBsjCeNv5mB4usD8BkJALmhYT8q3mVpr1fpdt95deJe5vj4l51NdxkIp PJ7Niu4usWip4Hk0T3eJGDiO4M6cev89y0yC5uLq0CTbbFdHh9XBbfah++ztDJelPahq eimv8hZGBG61i5ut5JaXoAifh4dDFKT1/OEaQ= Original-Received: by 10.115.103.6 with SMTP id f6mr3357039wam.79.1265527391373; Sat, 06 Feb 2010 23:23:11 -0800 (PST) Original-Received: from bhishma.kuru (d216-232-0-68.bchsia.telus.net [216.232.0.68]) by mx.google.com with ESMTPS id 22sm1514161pzk.14.2010.02.06.23.23.09 (version=TLSv1/SSLv3 cipher=RC4-MD5); Sat, 06 Feb 2010 23:23:10 -0800 (PST) User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.7) Gecko/20100120 Fedora/3.0.1-1.fc11 Lightning/1.0b2pre Thunderbird/3.0.1 In-Reply-To: X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) 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: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:71723 Archived-At: On Saturday 06 February 2010 12:21 AM, Jorgen Grahn wrote: > On Sun, 2010-01-31, Suvayu Ali wrote: >> Hi, >> >> On Friday 29 January 2010 11:39 AM, Teemu Likonen wrote: >>> * 2010-01-29 11:28 (-0800), Brendan Miller wrote: >>> >>>> When I hit tab in text mode, it indents by 5 spaces. How do I change >>>> that? Setting tab-width doesn't seem to do the right thing. >>> >>> TAB key in text-mode indents to the columns of previous line's words. If >>> you want to go to next tab stop, as defined in tab-stop-list variable, >>> use M-i. For example, first write a line like this: >>> >>> Here are some words. >>> >>> Then press TAB key a couple of times on the next line. Then go to the >>> beginning of line and press M-i a couple of times. You should see the >>> difference. >> >> Maybe this is a little off-topic, but is their anyway to have that >> behaviour of the TAB key with source code, say C++ or Python? I would >> like to align various similar consecutive lines to make them easy to >> read. Thanks for any suggestions. > > Do you have any examples where the default Emacs indentation for C++ > and Python isn't readable enough? I'm asking because "align various > similar consecutive lines" is one of the things those indentation > modes do already. I work with a data analysis framework based on C++ libraries dynamically loaded by various python scripts. It often has code like this, Python: > if rec.doCalo: > ## Import CaloCluster Tool > from DataQualityTools.DataQualityToolsConf import DQTCaloClusterTool > DQTCaloClusterTool = DQTCaloClusterTool(name = 'DQTCaloClusterTool', > histoPathBase = "/GLOBAL/DQTCaloCluster", > doRunCosmics = isCosmics, > doRunBeam = isBeam, > doOfflineHists = isOffline, > doOnlineHists = isOnline > ); > > ToolSvc += DQTCaloClusterTool; > ManagedAthenaGlobalMon.AthenaMonTools += [ DQTCaloClusterTool ]; or C++: > failure = failure | registerHist(fullPathMuons, m_trkeffvsLumi = new TProfile("m_trk_trkeffvsLumi", "Trk eff per Lumi block", 1000, 0, 1000, 0, 1)).isFailure(); > failure = failure | registerHist(fullPathMuons, m_fwdetatrkeffvsLumi = new TProfile("m_trk_fwdetatrkeffvsLumi", "Forward Eta eff per Lumi block", 1000, 0, 1000, 0, 1)).isFailure(); > failure = failure | registerHist(fullPathMuons, m_bkwdetatrkeffvsLumi = new TProfile("m_trk_bkwdetatrkeffvsLumi", "Backward Eta eff per Lumi block", 1000, 0, 1000, 0, 1)).isFailure(); As you can see, because of the long and wieldy names, aligning them with the previous line often helps improve the readability. > As a source code reader (and maintainer) I appreciate when the > indentation I see follows one of the built-in styles (and > indent-widths) so I can edit it without having to manually tweak my > indentation to keep in style. Would you do this some other way? Thanks for any suggestions, I appreciate it. > /Jorgen > -- Suvayu Open source is the future. It sets us free.