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: Mon, 5 Mar 2018 20:06:17 -0500 Message-ID: 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> <8b94336f-1bb4-84ab-263b-af5ba40bfca4@cs.ucla.edu> 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 1520298300 8778 195.159.176.226 (6 Mar 2018 01:05:00 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 6 Mar 2018 01:05:00 +0000 (UTC) User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 To: Paul Eggert , emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Mar 06 02:04:56 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 1et12F-0001Vh-4l for ged-emacs-devel@m.gmane.org; Tue, 06 Mar 2018 02:04:55 +0100 Original-Received: from localhost ([::1]:52376 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1et14F-0000Ia-Ua for ged-emacs-devel@m.gmane.org; Mon, 05 Mar 2018 20:06:59 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:46777) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1et13d-0000IE-Cg for emacs-devel@gnu.org; Mon, 05 Mar 2018 20:06:22 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1et13c-0003Vv-Hl for emacs-devel@gnu.org; Mon, 05 Mar 2018 20:06:21 -0500 Original-Received: from mail-qk0-x22a.google.com ([2607:f8b0:400d:c09::22a]:36090) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1et13c-0003Vi-BN for emacs-devel@gnu.org; Mon, 05 Mar 2018 20:06:20 -0500 Original-Received: by mail-qk0-x22a.google.com with SMTP id d206so23019405qkb.3 for ; Mon, 05 Mar 2018 17:06:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-language:content-transfer-encoding; bh=CIZ9NWdnj3tKbbgLTuprf87+N0yji9d8L86QtfSF1Xs=; b=QekRtl6S7OQGzF82yoldGuKVrm2kIO5yPiuCHnAj93kzlKqgubSjExrpyf9jslDJ58 LKrya1BTQpoNwh3906KfC2hdXvHdqhv3/sdgU7zpYR5VA58d9yEi9Z/102NxTXuwExUI lq+JMthMBsmSPU4F/St3Cok4/PIP2rSEIShiQFD3j4/Nhh9Oa6Nx/IT/RAA6pK82NMN+ YX01Q1gMJT48uXKtDkXf4xoVVSoAE/ribB+uQzcU8XIeikZrpg4+08WOkoLhg3/05ebJ s053+jeOWOuzjEFRRQfRrralcJMrf8Sg2PFN98MnvHf3fQCryecvX1Ruzc+a+ZmgywRm 2DIQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=CIZ9NWdnj3tKbbgLTuprf87+N0yji9d8L86QtfSF1Xs=; b=OTbvaFLXSbhDakmCKjbMUcUu5jR2w/iR1BPHQWHYRwso5/5B685BHbZPLwy2pOu7+A 8+Zs9uN18pK958TKYOnfOEXRhYS2GKQf9Hs1pNIxp78jhWuVA+kyVwqLNaYIDgfrukqA K9T7BoAyNLAHf9BV3yHFM8Y6mfkDVHZVewiHJIzzPPVcT/7k/AiWQh6TnqJ0F4cGuIPz 0srOv98xdW64T23BZBGfGB1NwY5Ch9R/Q3lfXlgq36GWIvVyJYFaXhMbAILVjIAXDxz2 Z2OhQZ0NUXVAMWC9IkEmhTDtBhJ6VSu91/RA78sjeRYMI/TZL0Uc++HxCY+BJ3lYKhSX 1r3A== X-Gm-Message-State: AElRT7F0MsCEzkHsj+3H40qOFtAu74zntmY07t/q3tLtnlR7dFj8MiCp X3WLoFmVBRGNjBQhN2JWk3jS83WM X-Google-Smtp-Source: AG47ELs6O4qmKo0Ho8Ft/NdK0V0gnMdr9kIHhUzyayrFLMdwen/mtXiaYF9pAbkbPn0Hzb02mdPpPw== X-Received: by 10.55.5.133 with SMTP id 127mr26464370qkf.56.1520298379521; Mon, 05 Mar 2018 17:06:19 -0800 (PST) Original-Received: from ?IPv6:2601:184:4180:66e7:2829:cb05:cef:e671? ([2601:184:4180:66e7:2829:cb05:cef:e671]) by smtp.gmail.com with ESMTPSA id f13sm9916931qtf.15.2018.03.05.17.06.18 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 05 Mar 2018 17:06:18 -0800 (PST) In-Reply-To: <8b94336f-1bb4-84ab-263b-af5ba40bfca4@cs.ucla.edu> Content-Language: en-GB X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400d:c09::22a 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:223313 Archived-At: On 2018-03-05 17:30, Paul Eggert wrote: > On 03/05/2018 12:28 PM, Clément Pit-Claudel wrote: >> Applying this strategy to all lines doesn't work, unfortunately: it >> indents the `pr ()' and `printf (' lines differently, because the >> `in' of `int main' and the `vo' of `void' occupy different widths. > > True, but that's a feature not a defect. The code is easier to read > if every region is indented individually, as opposed to using exactly > the same indenting everywhere in the buffer. Hmm. I hadn't thought of this :) But I'm not entirely convinced yet. Consider this snippet: def x(): with open("A") as f: while y: print(y.v()) or this one in elisp: (when x (if y t (unless p (cl-loop for x in y collect x)))) In variable-pitch mode, each new indentation level has a slightly-different width, instead of a regular progression of 4 spaces (in Python) and 2 spaces (in Elisp) at each level. Beyond this, there's the problem of inline line-up spaces. For an example, consider this, from xdisp.c, which shows "line-up" spaces in full glory: +--------------+ redisplay +----------------+ | Lisp machine |---------------->| Redisplay code |<--+ +--------------+ (xdisp.c) +----------------+ | ^ | | +----------------------------------+ | Block input to prevent this when | called asynchronously! | | note_mouse_highlight (asynchronous) | | X mouse events -----+ | expose_frame (asynchronous) | | X expose events -----+ The same problem pops up with org-mode tables, etc. Clément.