From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id 70iJAaarYl8sKQAA0tVLHw (envelope-from ) for ; Thu, 17 Sep 2020 00:19:50 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id AIt4OKWrYl+rRAAA1q6Kng (envelope-from ) for ; Thu, 17 Sep 2020 00:19:49 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id C00879402A2 for ; Thu, 17 Sep 2020 00:19:48 +0000 (UTC) Received: from localhost ([::1]:54314 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kIheN-0000ex-Pf for larch@yhetil.org; Wed, 16 Sep 2020 20:19:47 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:45768) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kIhde-0000en-Ql for emacs-orgmode@gnu.org; Wed, 16 Sep 2020 20:19:02 -0400 Received: from coral.adamspiers.org ([2001:ba8:1f1:f27f::2]:38692) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kIhdc-0003qq-MA for emacs-orgmode@gnu.org; Wed, 16 Sep 2020 20:19:02 -0400 Received: from localhost (243.103.2.81.in-addr.arpa [81.2.103.243]) by coral.adamspiers.org (Postfix) with ESMTPSA id EF5DD2E64F; Thu, 17 Sep 2020 01:18:57 +0100 (BST) Date: Thu, 17 Sep 2020 01:18:57 +0100 From: Adam Spiers To: Jeff Filipovits Subject: Re: variable-pitch-mode misaligns org-mode heading tags Message-ID: <20200917001857.ry2ie6vjvon5b63h@ionian.linksys.moosehall> X-OS: GNU/Linux References: <87wo1483r5.fsf@protesilaos.com> <87v9gnl4on.fsf@gnu.org> <87mu1znrf1.fsf@ucl.ac.uk> <87eenbj9p2.fsf@gnu.org> <878sdblyz3.fsf@gmail.com> <20200916162143.xyg7j5rg6xalmv2j@ionian.linksys.moosehall> <87mu1pa6jd.fsf@gmail.com> <20200916225553.hrtxitzt46dzln7i@ionian.linksys.moosehall> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline In-Reply-To: <20200916225553.hrtxitzt46dzln7i@ionian.linksys.moosehall> Received-SPF: pass client-ip=2001:ba8:1f1:f27f::2; envelope-from=orgmode@adamspiers.org; helo=coral.adamspiers.org X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Protesilaos Stavrou , emacs-orgmode@gnu.org, Eric S Fraga Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Scanner: scn0 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=fail reason="SPF not aligned (relaxed), No valid DKIM" header.from=adamspiers.org (policy=none); spf=pass (aspmx1.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org X-Spam-Score: -0.91 X-TUID: 1jgHG5cvKqHY On Wed, Sep 16, 2020 at 11:55:53PM +0100, Adam Spiers wrote: >I've actually managed it get it working now! See the attached patch. >However unfortunately it is not ready to be merged yet. Firstly, it >breaks `test-org/tag-align'. Secondly, since this changes the method >of alignment from simply using raw spaces to using a single space with >a display text property, when the file is saved and reloaded, it just >displays a single space and the alignment is lost. Another >unfortunate side-effect is that if the file is simultaneously >displayed in a graphical window and a text window via the same emacs >server (e.g. via emacsclient -t), then one of the two windows will >have incorrect alignment. > >So I think the correct fix will be to keep the original number of >spaces, but use a display text property to redisplay those spaces as a >single space with the given width. I'm guessing that the display text >property will be ignored on text-only (tty) windows, fixing both >problems in one go. > >So I'll take another stab at this soon, if Bastien or some other Org >guru can confirm I'm on the right track. Hrm, no this isn't good enough. For graphical windows we still need to set the display text properties to align all tags when the buffer initially loads. AFAICS there's currently no code to trigger this, so it would need to be added, and for large files this might actually cause problems with file loading time unless it was done in the background (a bit like fontification can be done). Advice on how to handle this best is very welcome.