From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: =?UTF-8?Q?Cl=c3=a9ment_Pit-Claudel?= Newsgroups: gmane.emacs.devel Subject: Re: Variable-width font indentation Date: Tue, 6 Mar 2018 16:47:51 -0500 Message-ID: <4742f0ae-86b5-48f9-4601-4dbba9e6380d@gmail.com> References: <87inaiss6l.fsf@web.de> <6FCF6ACA-4F29-4B6B-BE9D-D7130C6E9495@gnu.org> <87fu5moe4c.fsf@web.de> <877eqyocro.fsf@web.de> <83zi3uz4nb.fsf@gnu.org> <0b1dd3fa-e0b0-ed20-a256-dd92d1c1826f@dancol.org> <8bc3c4c7-dfc7-987a-95e7-bd309e2326c6@cs.ucla.edu> <03118DC0-39DA-4AB5-980E-A33809B9A5EE@raeburn.org> <83vaeas8uz.fsf@gnu.org> <83lgf6s3aa.fsf@gnu.org> <838tb5rxoe.fsf@gnu.org> <83lgf5q73p.fsf@gnu.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: blaine.gmane.org 1520372797 22513 195.159.176.226 (6 Mar 2018 21:46:37 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 6 Mar 2018 21:46:37 +0000 (UTC) User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 Cc: eggert@cs.ucla.edu, emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Mar 06 22:46:32 2018 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1etKPn-00051T-6a for ged-emacs-devel@m.gmane.org; Tue, 06 Mar 2018 22:46:31 +0100 Original-Received: from localhost ([::1]:58483 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1etKRp-000360-RR for ged-emacs-devel@m.gmane.org; Tue, 06 Mar 2018 16:48:37 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:48362) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1etKRC-00034e-If for emacs-devel@gnu.org; Tue, 06 Mar 2018 16:47:59 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1etKR8-0000hQ-Jj for emacs-devel@gnu.org; Tue, 06 Mar 2018 16:47:58 -0500 Original-Received: from mail-io0-x230.google.com ([2607:f8b0:4001:c06::230]:39577) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1etKR8-0000hB-EG; Tue, 06 Mar 2018 16:47:54 -0500 Original-Received: by mail-io0-x230.google.com with SMTP id b34so664401ioj.6; Tue, 06 Mar 2018 13:47:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=mZnrUyHGAu2QFJydtpgUR8sHLlL8e9Qt1hXu7nyubaA=; b=AaFSu9DLzlVWlmBkOCD8E+GBfDQFvGRdDCI2RKmPGFXPzdQXYdoag81Cuc+Cmb7Mws TcUtZcbotZ2dcjINVUolaXtNjHqjZfBj60jI4PHhraCYnYy9XMbolYKoav9QWTWndrdj eBKKi/Qfq9TTymFgZ6Asuwz7O5unvQrq15aJOiSWx1MxZpmAcG/51nNkrC15xBicn3ro KZraKOJALz0iewHqHoOda6+KNLq99qAydoQK/8qJYplWslc/vnqaNWjRF9uNgeD02SoR KALX1OOmBTCqNVd8pG92/MtpkWpewYTLJo0bcPBTYCLVEurL8fFj1BnoT9rOrXXqqY1T l7Ow== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=mZnrUyHGAu2QFJydtpgUR8sHLlL8e9Qt1hXu7nyubaA=; b=qncTMdBWXqIs3QH6/fy4jh3U1dD2LOIH+rLCtHpBsYh0nI5kNDQ74oqPb1lGDvmScm ogSEMOXBhb1sDYBGbV8Ako7GSVTTLuvALMgBnOWUHyWJ1Qb1+lRhErsnREQNgwKTr7YQ yjqbwYr6virbVn2xHcRQEa+lyF16KLPeeluvSVC4i9MtYV9SMXaeUUS4kOExc53/KvzO 5+sLOBN8Q1kNpUHcH1naa6u4y7e1tw8hKxnPLxQuGGr5dJT4fwXgQ5JWpLk3w9rnnLuA tMlfXqDeJaSAP7LlKDpeCNxSWaecolo0Q5AfkZ80ECkQUWuG8tVD5TBxQeuGLTaQQd55 UPxg== X-Gm-Message-State: AElRT7Gh+1O50TvryI/vx+6/xOTzaniz31c0QAsELkjf02koXs+Iw498 VbF4gXLV0TJg924P5guJpLA= X-Google-Smtp-Source: AG47ELu3LVeFZ8kyY+Tp5IoZQ5yqhMpXZpb5vxZgKWv+/eWR6Ei3oA+dh438AHvvg23aBHwgAwSoaA== X-Received: by 10.107.170.158 with SMTP id g30mr4041918ioj.31.1520372873456; Tue, 06 Mar 2018 13:47:53 -0800 (PST) Original-Received: from [18.26.2.123] (26-2-123.dynamic.csail.mit.edu. [18.26.2.123]) by smtp.gmail.com with ESMTPSA id r139sm7337184itc.34.2018.03.06.13.47.52 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 06 Mar 2018 13:47:52 -0800 (PST) In-Reply-To: <83lgf5q73p.fsf@gnu.org> Content-Language: en-GB X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4001:c06::230 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:223387 Archived-At: On 2018-03-06 15:31, Eli Zaretskii wrote: >> Cc: emacs-devel@gnu.org, eggert@cs.ucla.edu >> From: Clément Pit-Claudel >> Date: Tue, 6 Mar 2018 14:59:21 -0500 >> >> * Paul and I have been discussing an language-agnostic heuristic to preserve alignment when changing from monospace to variable-pitch faces. This intends to preserve the original indentation of the code, by inferring what it would have been if the logic originally used to indent the document had been aware of variable-pitch faces. > > I don't see a need for such a feature, sorry. We have indentation > already; its only problem is that it doesn't work well with variable > pitch fonts. That's what we need to try to fix, if we care about the > capability of displaying program code with such fonts. I'm thoroughly confused: doesn't the algorithm that Paul proposed, and that I show an implementation of, do exactly that? Do you want to get the indentation code involved because the heuristic isn't perfect? >> * You're describing a language-specific way to get a nice-looking variable-pitch rendering of a document; your way is to reindent the document, essentially. > > I was describing a way of teaching the existing indentation code > handle variable-pitch fonts. Right, which is where we differ: the solution Paul and I have been thinking is designed not to rely on exiting indentation facilities. In your world, concretely, what happens when I open xdisp.c and press M-x variable-pitch-mode? Does everything look misaligned until I M-x indent-region the whole file? What about a file from a different project that uses a different indenting convention? Thanks, Clément.