From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.help Subject: Re: How to make c-indent-line-region respect indent-tabs-mode when it's already aligned? Date: Sat, 30 May 2015 17:22:10 +0300 Message-ID: <83d21iuovh.fsf@gnu.org> References: <87k2vqii5e.fsf@home.hong.me> NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1432995757 24855 80.91.229.3 (30 May 2015 14:22:37 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 30 May 2015 14:22:37 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sat May 30 16:22:29 2015 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 1Yyhee-0004lM-Mn for geh-help-gnu-emacs@m.gmane.org; Sat, 30 May 2015 16:22:28 +0200 Original-Received: from localhost ([::1]:39612 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Yyhee-0003iz-1C for geh-help-gnu-emacs@m.gmane.org; Sat, 30 May 2015 10:22:28 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:50909) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YyheV-0003ip-0J for help-gnu-emacs@gnu.org; Sat, 30 May 2015 10:22:19 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YyheP-0006u9-Ow for help-gnu-emacs@gnu.org; Sat, 30 May 2015 10:22:18 -0400 Original-Received: from mtaout25.012.net.il ([80.179.55.181]:40601) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YyheP-0006te-Hy for help-gnu-emacs@gnu.org; Sat, 30 May 2015 10:22:13 -0400 Original-Received: from conversion-daemon.mtaout25.012.net.il by mtaout25.012.net.il (HyperSendmail v2007.08) id <0NP6007002B8RM00@mtaout25.012.net.il> for help-gnu-emacs@gnu.org; Sat, 30 May 2015 17:18:03 +0300 (IDT) Original-Received: from HOME-C4E4A596F7 ([87.69.4.28]) by mtaout25.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0NP6002W52E3KS40@mtaout25.012.net.il> for help-gnu-emacs@gnu.org; Sat, 30 May 2015 17:18:03 +0300 (IDT) In-reply-to: <87k2vqii5e.fsf@home.hong.me> X-012-Sender: halo1@inter.net.il X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 80.179.55.181 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:104684 Archived-At: > From: Hong Xu > Date: Sat, 30 May 2015 01:28:13 -0700 > > Currently it seems that c-indent-line-region ignores the value of > indent-tabs-mode. For example, I have the following in a buffer > > int main() > { > int x; > } > > and my indent-tabs-mode is nil. If 8 spaces is what expected, calling > c-indent-line-or-region would do nothing. However, if it's not aligned > > int main() > { > int x; > } > > calling c-indent-line-or-region would correct the tab with appropriate > number of spaces. > > Is there a different line indentation function which respects > indent-tabs-mode even the line is already aligned? You are using the wrong command. You should use untabify to convert tabs to spaces, or tabify to do the opposite.