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: highlight-indent-guides in display engine Date: Mon, 15 Jul 2019 16:11:07 +0200 Message-ID: <20190715141107.sygnfsikmyeuzg3w@Ergus> References: <83tvbr3fl7.fsf@gnu.org> <20190712095841.qn5rlgxxgqjllz4k@Ergus> <83h87r2wpk.fsf@gnu.org> <20190712185100.omyyovxh5hqzpk5z@Ergus> <83v9w61ktg.fsf@gnu.org> <878st249o1.fsf@fastmail.fm> <83ims61g80.fsf@gnu.org> <87o91xfwfo.fsf@fastmail.fm> <20190714125618.wlmansy26d6nstmy@Ergus> 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="24518"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: NeoMutt/20180716 Cc: Joost Kremers , emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Jul 15 16:11:26 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.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1hn1hM-0006Ex-4E for ged-emacs-devel@m.gmane.org; Mon, 15 Jul 2019 16:11:24 +0200 Original-Received: from localhost ([::1]:39174 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hn1hK-0005kC-Sc for ged-emacs-devel@m.gmane.org; Mon, 15 Jul 2019 10:11:22 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:57858) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hn1hI-0005k3-6k for emacs-devel@gnu.org; Mon, 15 Jul 2019 10:11:21 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hn1hH-00041b-1d for emacs-devel@gnu.org; Mon, 15 Jul 2019 10:11:20 -0400 Original-Received: from sonic307-54.consmr.mail.ir2.yahoo.com ([87.248.110.31]:42674) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hn1hG-00040h-MW for emacs-devel@gnu.org; Mon, 15 Jul 2019 10:11:18 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aol.com; s=a2048; t=1563199876; bh=LZau9bbpLrSsxTR2cFKggksHpImFVt8ATCq3Gu2QwVw=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From:Subject; b=DuIAh0G0gP27tOwKwVxdwFDyoswJ9zQ/nGnezjkZlpakeDkQf7N4qMKlsqtT+wy4RyV2u/wz+g0JKIHcAOHejgkbD6a+GufE/6huG7LLW+rlLmtKWM+BBm4wHj9aNUcyHuZ5sfrx2uJhpHW+Q1YF7OEZgRZqXGtRwKuGg2KGdjTAMnDrRLU1CUlfv7F0HdfMAB4XuCnHF1LiYj6rZ7/oUO7UjNqzhPP6dCBmxaNzniD0durVPvsLSK6T62Yge8tziyOSRvtrDcW0PJFmGvPmaKY0vkUznNZjsWWpK0J4gva5QeuzSsbiEZUC3i0/ru3bDld+X+CWgn4LM9sHULK3nw== X-YMail-OSG: 7alpPRcVM1lBqPxx3hhkFSMFwRvESKo.mFiIPwsq49tC1fMfW6KJGNeQwUcM_wT WTiCVQmaVD6o8AlohMhDI_7cq7IOQvZ4U4aZepsU9fCj6y.t1pqC90rHcFrkVqc9pc5QCEjGAQQ4 NIiXXqwIqgy0gU15QDQ38l8SbVvq58GS6Q5WCwPQhSTvo2MED8hPQcq_forTakcUbN_pctaulqQ5 NyQwOrhABQC0lHNR369dGZbq9fWIogQ6s7bzI14TQ44Nw4woznfxQpvNP9OC8QEkY_lGEqkTBuWR xJzT0CyqKkD.tvVNaSDXnVkXbGFraf.bX8AUx58GdQNW0FRcPJmOazovMNqVkAnX9bhEULLw_FhO zId4c.vtSpd1lbe_pqnCnGj2lISC9NVMnWjXQlgFSi8xrq.75nkpMP0djMxaV7Z2aALv7MwtnWgp HSL1HYgvLYNOnQcXW2JENkkSeyaj2MEYEwXnygniAaXAlg3fg1fnI6ro9Uzvfl6BwgS3qBCnbEgF OkK__ReKCQ0pbsjh3M1UOGET0KgfbpJ_WJy4fQOZQzhC98pxtMWbO64EkiZpqC9yIR5EI0K4iAbd MDqmuB1eX07yY9rV4uFbNTxbfq2oKtJuSwj0FMKca9LhZoSQ.gPcYS1jNG4TorzobJTWP7.ka9AL .jAvnwjDLo.svVMM7Njd6qe7xbrYJgilaWjgs1plyjYg1TejYTnKkxduaBzXqdyFN8zICLUIJwTM sQpHJ0.lhB63ANpwJrrpZ5A5g7UJFQJGnQbeFLE2k1IjLXzKGegQJWdX0ogqQhxSdEG9xNacraMu oYGdjneIOaVt8YVArnf1sg_46S2LKAu2qa6tYONGYc Original-Received: from sonic.gate.mail.ne1.yahoo.com by sonic307.consmr.mail.ir2.yahoo.com with HTTP; Mon, 15 Jul 2019 14:11:16 +0000 Original-Received: by smtp411.mail.ir2.yahoo.com (Oath Hermes SMTP Server) with ESMTPA ID 6260d89b9ac421359b51917e5e1abb5c; Mon, 15 Jul 2019 14:11:15 +0000 (UTC) Content-Disposition: inline In-Reply-To: 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.23 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:238595 Archived-At: On Mon, Jul 15, 2019 at 08:58:00AM -0400, Stefan Monnier wrote: >> But with this minimal support at least there will be something "good >> enough" for C and all the derived from cc-mode (Java, C++, Ruby, Perl, >> Lua) plus Python, Latex, Makefiles, Bash, Tcl, SQL, Assembly, Rust. So, >> many users will be benefited... I think it is still a good deal right?. > Hi Stefan: First, what I propose is not a general solution for all the cases, actually it is VERY restrictive, but we don't have anything better and efficient enough. Your example is a typical example of indent + align and the emacs align policy to mix spaces and tabs is actually the worst possible (in my very modest opinion) I suppose there is an historical reason for it... But I won't argue about it (there is a recent thread I started about that and Alan gave a nice workaround (which for me should be like the default when using tabs)). In the general situation the indent will be a fix number of spaces >=2 || a tab. And no lines will start, for example, in the half of the indentation which in lisp happens very often (for example when there are two opening parenthesis together). Your example actually breaks very short lines into pieces, but it will look like this more or less: int main () { sfgasfgasfg(tot(x | | | | | |+ 3), | | | | |y); } But even in this way it is better than nothing and it is not much different than what most of the other editors do right now. And in python it is specially useful because a typical error is to mix spaces with tabs due to opening a file edited somewhere else. But also there are some people doing the same just setting: whitespace-style '(face tabs tab-mark trailing) whitespace-display-mappings '((tab-mark 9 [?\u2502 9] [?\u2502 9]))) In whitespace mode, because it works and don't kills performance. In any case, I just made a proposal, any improvement you think works better is very very welcome. Thanks for putting some interest on this, Ergus >I'm not sure I understand the problem that makes it work for those modes >but not for Lisp. > >E.g. in C mode by default we get indentation of this form: > > int main () > { > sfgasfgasfg(tot(x > + 3), > y); > } > >How is this fundamentally different from what happens in Lisp? > > > Stefan >