From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Ergus Newsgroups: gmane.emacs.devel Subject: Re: Supporting tabs for indentation, spaces for alignment Date: Fri, 12 Apr 2019 19:00:44 +0200 Message-ID: <20190412170044.4b3rticymd36qkox@Ergus> References: <20190411090223.GA5183@ACM> <20190411102405.vcwdygrz36cjt3ld@Ergus> <20190412155442.GD4588@ACM> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="221255"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: NeoMutt/20180716 Cc: emacs-devel@gnu.org To: Alan Mackenzie Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Apr 12 19:04:39 2019 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hEzbT-000vOg-8Y for ged-emacs-devel@m.gmane.org; Fri, 12 Apr 2019 19:04:39 +0200 Original-Received: from localhost ([127.0.0.1]:40194 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hEzbS-0001ZI-5t for ged-emacs-devel@m.gmane.org; Fri, 12 Apr 2019 13:04:38 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:56101) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hEzXq-000737-B6 for emacs-devel@gnu.org; Fri, 12 Apr 2019 13:00:55 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hEzXp-0006W0-5s for emacs-devel@gnu.org; Fri, 12 Apr 2019 13:00:54 -0400 Original-Received: from sonic307-54.consmr.mail.ir2.yahoo.com ([87.248.110.31]:45029) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hEzXo-00068A-KG for emacs-devel@gnu.org; Fri, 12 Apr 2019 13:00:53 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aol.com; s=a2048; t=1555088449; bh=YoqpTa7114wEpSW7vu9kzxGd3YnF2X31O6Wi5AljnAA=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From:Subject; b=oAHOIdgs/wnMg2kOp1YdCY3dgN/++DxDcTUHqAxEz95qDfbqL3LzDyROXqvbxEjaaBfUmQcfX+d0+dvBA98fgycWlkv0J6BKPxK1jnUDylJBMlYte+Pd9X2EMyrOy+aGvtb6qm9I9QeHESHQzwii4KdNKI5VsI96Nt8eblzBUTi87sYgw1L1+ZmBdf6jZVv4dGINW/ntsG0+pBCuh3rwdrOmRywFBHpDeEioticjjCX3QGlHuPHZbeOb5mJ5qBcFawDMn2K0TIciDLARKIR179J7DjSn7TwS5GE8XPqdvm6z8idE/cfpOtFJQEPg8kKhO8NVn+CnZGAuQKRbNWvwow== X-YMail-OSG: 18q3ivEVM1kr0FxLG.fB2RXz3imXP55XLDp91NwFBSiUVBGvI1xlCz72xm5Ckbt KJGhE0kLtyr.gtPsThZxr874Rl15NzFVpqbc.nzHe1X_66bMEtIqTpLwixfW96ZKAZQpGOVeaeSv OxbIACFSPBQmLP0fn5WB7U5JUkMOtyTaj_m78Jvpg0KXTsFK2icLfqBdbTHHvopxrTgeZfVIR5nV YnVObvL.otPS6jukH.TKMIxMNnI7iZ17NoKBWMv9tS7Jxl4AwCa8SrlpKuXmyAcWYWhzM1DWlegl EzVp4pPrT2vQanckk49Ox7Rtvd_iyAXSlgJd7t96baSLIMS5oJJy54Ny7CGe0dHejnSGm5hDnON5 lrPv6gfuGTwfIy2t9LdWvJ_SKaEt.4wJXBHrdIFa668dE1eHkbU.de5wsyDW2P3OH9gkAaJY65ZI IEdxpWacrm2phvLSZtstiCIsnD45kwRT3MI0XCuO4otzoMZslQYaW.OAulT.rye12fHyPNvtlk6E 9lcBgmSmef7Z_j6AoIEtLqzaOnqiPUZGmguer5ytoQdzogRErlR1sJ0D5v.w8vBCyIg0jjMy5u3C qWN2u.uP1jjN6GvhMhS8zYvrRvxqzaNpGa.hQ4kSebdT28vejq7eFVgkckx9SsceDMJx3Mf7k0gS 4vJmF_Vpz4l_WTUFMbqWmTZm2zyyZex.LLdzC..yilnS4iSj1nxzx5Wb4VhxPsPaOKrex1cXPLNE cevYslbGPnQkVdJd0pBZ4G0qP6YbsALXDnrO2aKzStwmWGKXf.ZTMX9GKxjkMuuTjM12ZagccpK5 cYG9L8_8kJW0_EXYxZTmYavcKy7cll_mTGLS7VT1vn Original-Received: from sonic.gate.mail.ne1.yahoo.com by sonic307.consmr.mail.ir2.yahoo.com with HTTP; Fri, 12 Apr 2019 17:00:49 +0000 Original-Received: from 84.88.50.33 (EHLO Ergus) ([84.88.50.33]) by smtp405.mail.ir2.yahoo.com (Oath Hermes SMTP Server) with ESMTPA ID 8b6f18fc435d52fa748ab2577ccd418b; Fri, 12 Apr 2019 17:00:47 +0000 (UTC) Content-Disposition: inline In-Reply-To: <20190412155442.GD4588@ACM> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 87.248.110.31 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:235354 Archived-At: On Fri, Apr 12, 2019 at 03:54:42PM +0000, Alan Mackenzie wrote: Hi again: >Hello, Ergus. > >On Thu, Apr 11, 2019 at 12:24:05 +0200, Ergus wrote: > >All of what you have just written is far more vague and abstract than >your previous posts. > >Getting concrete again, my understanding (please correct me if I am >wrong) of what you are suggesting is: "continuation" CC Mode source >lines should be indented with tabs up to the indent position of the >"main" line, and spaces after that. For some value of "continuation" >and "main" (see below). > Yes, I have seen only 3 alternatives so far (in my short experience) which are: 1) The actual emacs default. 2) Add an extra tab to continuation lines and no align with spaces at all (some projects don't like to mix tabs with spaces, so they prefer to ignore align) 3) Indent-with-tabs align with spaces. >This might not be all that difficult to implement. First the >"continuation" CC Mode syntactic symbols (e.g. arglist-cont-nonempty) >will need to be firmly identified, and a list made of them, say >c-continuation-syntactic-symbols. > Ok, there are not too many right? For C++ I only remember arglist-cont-nonempty, stream-op and template-args-cont. >Then the writer of the CC Mode style will need to set a flag (which >might be called c-limit-indentation-tabs or something like that) to >non-nil in the style. Also she will need to set indent-tabs-mode to >non-nil. > Could we just add special values to indent-tabs-mode? So t is the default (like now) and "limit-indentation-tabs" (or similar) will be this policy? So for other possible future policies we just need to add other values right? As it is buffer local should not affect other modes. >At run time, if the main symbol in the syntactic context is a member of >c-continuation-syntactic-symbols, the column number of its anchor >position will be determined. This is what is not clear to me how to do it right. For example in case of using templates. >The CC Mode indenting function will not >permit the initial sequence of tabs to extend beyond this anchor >position, replacing such tabs with spaces beyond that point. > >> So the users could find their needs without writing 40 lisp lines and >> read 20 manual pages full of therms that makes sense only after reading >> 1000 previous pages. Or needing to install an external package that >> potentially gets abandon. > >I think you're exaggerating just a little bit; it was only 27 lines of >Lisp. ;-) But I take the point. That workaround was only really >suitable for a Lisp hacker. > Yes, maybe a little bit, I am from Latin America so it is normal for us. We also use to write long emails and talk a lot :P >Have you any views on my above proposed strategy? > If you give me the hints where in the code to implement the changes (As Eli did for display-fill-column), maybe I can start with a draft version. It will take a while because am not very lispy :(. But I think these small features are very important and make the difference. >-- >Alan Mackenzie (Nuremberg, Germany). Very thanks for replying. Ergus.