From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Alan Mackenzie Newsgroups: gmane.emacs.devel Subject: Re: Supporting tabs for indentation, spaces for alignment Date: Sat, 13 Apr 2019 13:54:46 +0000 Message-ID: <20190413135446.GD13636@ACM> References: <20190411090223.GA5183@ACM> <20190411102405.vcwdygrz36cjt3ld@Ergus> <20190412155442.GD4588@ACM> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="160916"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Mutt/1.10.1 (2018-07-13) Cc: emacs-devel@gnu.org To: "Herring, Davis" Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Apr 13 15:55:01 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 1hFJ7U-000ffP-K8 for ged-emacs-devel@m.gmane.org; Sat, 13 Apr 2019 15:55:01 +0200 Original-Received: from localhost ([127.0.0.1]:52024 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hFJ7T-0004sc-BN for ged-emacs-devel@m.gmane.org; Sat, 13 Apr 2019 09:54:59 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:60795) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hFJ7M-0004sW-JW for emacs-devel@gnu.org; Sat, 13 Apr 2019 09:54:53 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hFJ7K-0002Kp-KR for emacs-devel@gnu.org; Sat, 13 Apr 2019 09:54:51 -0400 Original-Received: from colin.muc.de ([193.149.48.1]:53501 helo=mail.muc.de) by eggs.gnu.org with smtp (Exim 4.71) (envelope-from ) id 1hFJ7I-0002Hx-JN for emacs-devel@gnu.org; Sat, 13 Apr 2019 09:54:50 -0400 Original-Received: (qmail 64858 invoked by uid 3782); 13 Apr 2019 13:54:47 -0000 Original-Received: from acm.muc.de (p2E5D5F4C.dip0.t-ipconnect.de [46.93.95.76]) by colin.muc.de (tmda-ofmipd) with ESMTP; Sat, 13 Apr 2019 15:54:46 +0200 Original-Received: (qmail 25297 invoked by uid 1000); 13 Apr 2019 13:54:46 -0000 Content-Disposition: inline In-Reply-To: X-Delivery-Agent: TMDA/1.1.12 (Macallan) X-Primary-Address: acm@muc.de X-detected-operating-system: by eggs.gnu.org: FreeBSD 9.x [fuzzy] X-Received-From: 193.149.48.1 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:235395 Archived-At: Hello, Davis. On Fri, Apr 12, 2019 at 16:39:16 +0000, Herring, Davis wrote: > [Sent off-list because I don't know whether my DMARC issues have been > addressed. Feel free to share it there if you'd like to make a public > reply.] I'm doing this. I believe these mail issues, as they interact with mailing lists, are a Hard Problem. I'm not sure how much progress has been made on this by the admins, but they certainly haven't been disregarding the problem. > > 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). > I'm not saying your description in terms of CC Mode internals was > incorrect, but I'd like to provide an implementation-independent > description that can be easily verified. (Also, in case it hasn't > been posted recently, the Emacs Wiki discusses this idea in some depth > .) Thanks, I've read that. I've also downloaded the pertinent Elisp file. I'm not quite sure how smart-tabs-mode works, yet, so I'm also not sure what a secific CC Mode implementation could add. > The definition of "continuation" is simply that tabs are used whenever > the user chooses the width of indentation and spaces are used whenever > the editor chooses it (by comparing column positions in the text). So, roughly speaking, if a CC Mode "offset" is + or ++, then tabs would be appropriate, otherwise spaces. > There is a tacit assumption here that the amounts of indentation > chosen by the user are expressed in units of tabs. Conveniently, CC > Mode already defines indentation in terms of levels, so this just > means that a level equals a tab--i.e., that c-basic-offset and > tab-width are not independent. It probably makes sense to, when this > style is engaged, (setq tab-width c-basic-offset) after computing the > latter from whatever other style information since it is more specific > than any global setting of tab-width. Yes. I'll work out the precise details. But I'm now wondering why I should want to write a CC Mode specific implementation. > Hope this helps, Very much so, thanks! > Davis -- Alan Mackenzie (Nuremberg, Germany).