From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Hong Xu 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 15:48:42 -0700 Message-ID: <874mmty94l.fsf@topbug.net> References: <87k2vqii5e.fsf@home.hong.me> <83d21iuovh.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha1; protocol="application/pgp-signature" X-Trace: ger.gmane.org 1433037330 14654 80.91.229.3 (31 May 2015 01:55:30 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 31 May 2015 01:55:30 +0000 (UTC) Cc: help-gnu-emacs@gnu.org To: Eli Zaretskii Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sun May 31 03:55:22 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 1YysTB-0000VK-DE for geh-help-gnu-emacs@m.gmane.org; Sun, 31 May 2015 03:55:21 +0200 Original-Received: from localhost ([::1]:40925 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YysTA-0005HX-EC for geh-help-gnu-emacs@m.gmane.org; Sat, 30 May 2015 21:55:20 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:60535) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YypYk-0002uK-C6 for help-gnu-emacs@gnu.org; Sat, 30 May 2015 18:48:55 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YypYj-0003s2-Cy for help-gnu-emacs@gnu.org; Sat, 30 May 2015 18:48:54 -0400 Original-Received: from sender163-mail.zoho.com ([74.201.84.163]:25479) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YypYd-0003re-Qb; Sat, 30 May 2015 18:48:47 -0400 Original-Received: from localhost (usc-secure-wireless-207-070.usc.edu [68.181.207.70]) by mx.zohomail.com with SMTPS id 1433026125536412.6835590721878; Sat, 30 May 2015 15:48:45 -0700 (PDT) In-reply-to: <83d21iuovh.fsf@gnu.org> X-Zoho-Virus-Status: 1 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x X-Received-From: 74.201.84.163 X-Mailman-Approved-At: Sat, 30 May 2015 21:55:09 -0400 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:104694 Archived-At: --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Eli Zaretskii writes: >> From: Hong Xu >> Date: Sat, 30 May 2015 01:28:13 -0700 >>=20 >> Currently it seems that c-indent-line-region ignores the value of >> indent-tabs-mode. For example, I have the following in a buffer >>=20 >> int main() >> { >> int x; >> } >>=20 >> 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 >>=20 >> int main() >> { >> int x; >> } >>=20 >> calling c-indent-line-or-region would correct the tab with appropriate >> number of spaces. >>=20 >> 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. Thanks. Is there a single command to do formatting though? I think people want to format the line more than simply "indent" the line. Hong --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBAgAGBQJVaj5KAAoJECZsfTOCL4R4nugQAMMH61niNcl8RsgfYHuHHdfI vsDluuTQmHsqbH4ynhXGX5bBRAlgF3+sRaOKYqWcrfmE0i98TYkLKnBJNvinkerA Qvy2YAGaT8ePxZYOxuYFuF2ISguraDQNXTL056HBiQywHq4ibJAFjIyHdUN93FPX FpRhF3a/OtijZIi+h/y9hHhqdwL+N6Hag7s+oFdLT8qZM1ONjwhyDl7DmuUYKEuc +UIGNWoaEopRpkLTltVGEdnJzHKD//x/wI63RQuEBmsBq0EUjof/6R9CTZzr0eeH H+5HPQxGy6A6o+x3VfIP3Ka9h0FAZ5udNC3eYuUZ2VoY9+ZEN0V7BR6vuoK+zrhh LesUcE6gE/VDxTwRaRB6SdfsiQ1FJCweNTPHBILlN+qkFjQgNFcYlz4PCVtOcA2d uQIoX4dhdSkX4H2zPgxv7if3IyP2MxgrUQ2NTg/Kw3+VZSTTRdc7Ma2viRFc0f8s EPn8OUoQJew6XTImnD70Ois3oseiydbx7D6xPhxTIY0qHUPzN3PgvpSAccxltOWY PghwlapcL/yHV2KWkkLietOM5IsPb6AyJRPL2hYP6ATnO19ymcOWl34EuYIg+IAS 6RafgP2scfmEHSx+GE2nDEsZ1ijGcFHRXDJmagFBYrCrc32fHHexKEH+EDw06cXQ WlIncLTg1hNtjX1LqGX0 =PE9Y -----END PGP SIGNATURE----- --=-=-=--