From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id qNC/JhNiYl/YQwAA0tVLHw (envelope-from ) for ; Wed, 16 Sep 2020 19:05:55 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id uK2QIhNiYl+aMgAAbx9fmQ (envelope-from ) for ; Wed, 16 Sep 2020 19:05:55 +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 A08899401D0 for ; Wed, 16 Sep 2020 19:05:54 +0000 (UTC) Received: from localhost ([::1]:33850 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kIckZ-0007eG-NH for larch@yhetil.org; Wed, 16 Sep 2020 15:05:51 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:39984) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kIchw-0006Ru-E0 for emacs-orgmode@gnu.org; Wed, 16 Sep 2020 15:03:08 -0400 Received: from mail-qt1-x843.google.com ([2607:f8b0:4864:20::843]:39601) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kIcht-00066e-MQ for emacs-orgmode@gnu.org; Wed, 16 Sep 2020 15:03:08 -0400 Received: by mail-qt1-x843.google.com with SMTP id h6so7015709qtd.6 for ; Wed, 16 Sep 2020 12:03:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=references:user-agent:from:to:cc:subject:in-reply-to:date :message-id:mime-version:content-transfer-encoding; bh=413ifVlFom+LGG0NZY7kKiPPm5Btybr+uiEt4WCyZos=; b=kJIftmTU/rCJyGCv+giM3lD1KJTyV7lk4cwhOnuJSNnMTVcNiak83ksSUoOecq1CNQ iTUV8H1tlRDbTWRXyrNHFtl5+EVblYpKn7Awg35tJ4qU8c8SyyqhyZBvgzWk1A30HUbh Hfq4LuKYJovednlbJDwLVW09lw7dfDO2cNpkOuogGqQJXQRZYS7qECbvE4YPu9OQkUtg px9UK+oAWiOjXp8ziW4bDAQdmrIZPd3+sbTi4dYSWbrzHgIkXdzvdQ0B2B5QnNcghUB4 NJ2uYyd0v6zfKkB3XAsWwCLpLwul5vDpTTGYKYSHZxmPyvG7kjTTaKukMK1uimZ0X7Nk wRRQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:references:user-agent:from:to:cc:subject :in-reply-to:date:message-id:mime-version:content-transfer-encoding; bh=413ifVlFom+LGG0NZY7kKiPPm5Btybr+uiEt4WCyZos=; b=GQ22grRt2fhtiHUBzmTzRRv7rQLLPG4h30s1aMTweT5XA8TfILKNWb20LQ+ZctY+02 ZMavbucvgqkUEcTTLGY8QCBmZp58+EiiJUw81hA3keWitazEGTWdBp6EZZGefAWSliwb P9n+c9Zaxbinx1fR3ZK3nKj2F26mGiBcR4hEwRGN3aj38k+EPgEUF6ZXT9ujGj3Rv/6d iHtdMQ1du+ANNGY2qkUsNys40MZ2HdttXEZ3ImOoC5rSAWOQ+KPyYHp6ze+3qt1m96ER 8CqoMmstCpEmeKIkiN8MqJIrv1PhbDVSFAa44iO+uZM8ToR1jlL9pZ3z0BX7Gaqr/hC6 jnHQ== X-Gm-Message-State: AOAM532Ngf8UZTVJMuy7OUZLTqTyGztjlSsCqI4s0y1UoHKKEg2/1Ysf x3Goj5w1+gVJmsdg/MCHN+I= X-Google-Smtp-Source: ABdhPJzKTid7EP370XYNO1JxVp4xNyrdlDUMhRDh3JQhVGAFQYPu4DKmfP68WAxAItlIss4X3ZJO0g== X-Received: by 2002:ac8:7309:: with SMTP id x9mr5869426qto.302.1600282983601; Wed, 16 Sep 2020 12:03:03 -0700 (PDT) Received: from jtop (c-76-20-248-106.hsd1.ga.comcast.net. [76.20.248.106]) by smtp.gmail.com with ESMTPSA id 18sm19963924qkd.120.2020.09.16.12.03.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 16 Sep 2020 12:03:02 -0700 (PDT) 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> User-agent: mu4e 1.2.0; emacs 28.0.50 From: Jeff Filipovits To: Adam Spiers Subject: Re: variable-pitch-mode misaligns org-mode heading tags In-reply-to: <20200916162143.xyg7j5rg6xalmv2j@ionian.linksys.moosehall> Date: Wed, 16 Sep 2020 15:03:02 -0400 Message-ID: <87mu1pa6jd.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: quoted-printable Received-SPF: pass client-ip=2607:f8b0:4864:20::843; envelope-from=jrfilipovits@gmail.com; helo=mail-qt1-x843.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, 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=fail (rsa verify failed) header.d=gmail.com header.s=20161025 header.b=kJIftmTU; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (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.09 X-TUID: gmc1Qiwuk0XM Adam, Thanks. You are right of course and I realized the right-align=20 issue right after I sent my email.=20 Adam Spiers writes: > But the whole point of this exercise is to support=20 > variable-width > fonts. In this case, the correct position for the end of the=20 > single > space is most likely not even a multiple of the fixed column=20 > width, so > it would probably need to be measured in pixels rather than > columns. And in order to calculate it, it is first necessary to > calculate the exact width in pixels of the colon-delimited list=20 > of > tags. As I mentioned in the comment linked above, I searched for=20 > a way > of calculating the pixel width of the tag list, and the best I=20 > could > find was `pos-visible-in-window-p' which has some issues which I > mentioned there. If you have thoughts on whether I'm right=20 > about > those, and if so how to solve them, I'd love to hear! Cheers, > Adam It looks like (window-text-pixel-size) could be used to calculate=20 the pixel length of the tags list? I am having trouble deciphering=20 the manual=20 (https://www.gnu.org/software/emacs/manual/html_node/elisp/Pixel-Specificat= ion.html#Pixel-Specification)=20 for pixel specification for spaces, though. The right alignment=20 specification for some reason sends the tags to the next line, as=20 do most other solutions that I would expect to align the text to=20 the right side of the window.=20 I can experiment more in a couple days, but in the meantime maybe=20 someone smarter than me give some hints on how to use the pixel=20 specification properties.=20 > BTW I tried your code and for some reason it didn't insert any=20 > space > for me, but I didn't look into that yet. The way it=E2=80=99s written it would only reduce the gap between the=20 headline and tags to a space, and it assumes there are multiple=20 spaces there already. If there=E2=80=99s no space between the two, I don=E2= =80=99t=20 think it=E2=80=99ll insert one. Probably not the best way as it was thrown= =20 together to test the text property fix.=20 I accepted long ago that the solution to using a variable pitch=20 font for org headings was that the tags would not be aligned to=20 the right and never looked back, so maybe this is not worth the=20 price of fixing it if it is messy. And diving down to calculating=20 the pixel width of text seems like it=E2=80=99s getting pretty messy.=20 --=20 Jeff Filipovits Spears & Filipovits, LLC 1126 Ponce de Leon Avenue Atlanta, GA 30306 678.237.9302 (direct) jrfilipovits@gmail.com All emails confidential to the fullest extent of the law.