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 UIv8HV2AYl9TSQAA0tVLHw (envelope-from ) for ; Wed, 16 Sep 2020 21:15:09 +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 +MIbGl2AYl+BNAAA1q6Kng (envelope-from ) for ; Wed, 16 Sep 2020 21:15:09 +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 E9B709401D0 for ; Wed, 16 Sep 2020 21:15:08 +0000 (UTC) Received: from localhost ([::1]:37560 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kIele-0001wI-24 for larch@yhetil.org; Wed, 16 Sep 2020 17:15:06 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:40834) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kIel2-0001w0-Pf for emacs-orgmode@gnu.org; Wed, 16 Sep 2020 17:14:28 -0400 Received: from mail-pl1-x643.google.com ([2607:f8b0:4864:20::643]:37068) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kIel1-0007Dr-3J for emacs-orgmode@gnu.org; Wed, 16 Sep 2020 17:14:28 -0400 Received: by mail-pl1-x643.google.com with SMTP id u9so3870303plk.4 for ; Wed, 16 Sep 2020 14:14:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=gXkoDgx8X/saJqxl581yyNf9lk7j4RqkZBAocN2n2fk=; b=Xu1oQPsdljy9f2gFlPsi5EulY1WUYpWZP0+oqhFcolqkamzlDMUDZs297NaiaPyXV3 Ce4sZ2xDUfPJStiXVAL4rVciKFwolf667iUvXSda27yrCr2+cuz8ZbmtYQrjCXksaWCV ELac0lSOhcuCYb41l0KLxpR3nFiR58Gv+/6spIUsu7il1htKpxBxANUn+S6Vjz2C7hYv e0A/tsezxNMvhzk8H/MXXudIPH4yh3OM1HBfGmvPkwmh7lT2A1nCPzQxQfepJ8/avbXI eSagNo0oakuxRdPSHAUqx+vt/6bW3+p7ATzAZpyDRYpF8VcYpvTTWwXbnTjlxAQeSnfL GNOg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=gXkoDgx8X/saJqxl581yyNf9lk7j4RqkZBAocN2n2fk=; b=C7wqENumelduCNgjzYJuJRXFYR4YMGVLR6frL7aNBtmmuHzWBEGdt+4xAInAuh7Ip8 mLH1ELpeI0YkuKLlVc2YDUwF8/kZnQGlK8UdpRAQjSJVQIX8myRqPxAUx/pTwQeuKg9X eoYYe1VjpOGZKbvT9598FgoQ12fT3ql32sHKLCUfJftZdKPpLgCddlggEEhXQrp12wTv jOrl5sL9DVouC+SWcJJyzjfUp71LTn9kiCqtfAYttXWi4n50leXERD9kuRgSnaqUemoC mxgEGL6r37PwIfVww7TPnZmklSEbZS1/9FFzVgHAJr/vMR/NFfeN4yv1nZxrxYZhvP3U qwMA== X-Gm-Message-State: AOAM533vVFMFDKBHiR30gJJCdkpNg/L8ZsLwVmcrB1sWhSPfSh2ayvMv 1X2MhM1mKrwQU8U+rMIZOP5cTt/tGpY7i3xRq6M= X-Google-Smtp-Source: ABdhPJzPDLIoNGh09N9OW+1g7gzEhOI418uhBwqj5m2FCZxgc6cwj8WCGa8FvqupTvFhIFHbhVa45CtElCuwah7gRcM= X-Received: by 2002:a17:90a:930c:: with SMTP id p12mr5722027pjo.72.1600290865249; Wed, 16 Sep 2020 14:14:25 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a05:6a10:8371:0:0:0:0 with HTTP; Wed, 16 Sep 2020 14:14:24 -0700 (PDT) In-Reply-To: <87mu1pa6jd.fsf@gmail.com> 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> From: Samuel Wales Date: Wed, 16 Sep 2020 14:14:24 -0700 Message-ID: Subject: Re: variable-pitch-mode misaligns org-mode heading tags To: Jeff Filipovits Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass client-ip=2607:f8b0:4864:20::643; envelope-from=samologist@gmail.com; helo=mail-pl1-x643.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: -10 X-Spam_score: -1.1 X-Spam_bar: - X-Spam_report: (-1.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, FREEMAIL_REPLY=1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no 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=Xu1oQPsd; 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: QrUo6h1kdSQS can emacs supply tools that would be useful? On 9/16/20, Jeff Filipovits wrote: > > Adam, > > Thanks. You are right of course and I realized the right-align > issue right after I sent my email. > > Adam Spiers writes: > >> But the whole point of this exercise is to support >> variable-width >> fonts. In this case, the correct position for the end of the >> single >> space is most likely not even a multiple of the fixed column >> 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 >> of >> tags. As I mentioned in the comment linked above, I searched for >> a way >> of calculating the pixel width of the tag list, and the best I >> 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 >> 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 > the pixel length of the tags list? I am having trouble deciphering > the manual > (https://www.gnu.org/software/emacs/manual/html_node/elisp/Pixel-Specific= ation.html#Pixel-Specification) > > for pixel specification for spaces, though. The right alignment > specification for some reason sends the tags to the next line, as > do most other solutions that I would expect to align the text to > the right side of the window. > > I can experiment more in a couple days, but in the meantime maybe > someone smarter than me give some hints on how to use the pixel > specification properties. > >> BTW I tried your code and for some reason it didn't insert any >> 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 > headline and tags to a space, and it assumes there are multiple > spaces there already. If there=E2=80=99s no space between the two, I don= =E2=80=99t > think it=E2=80=99ll insert one. Probably not the best way as it was throw= n > together to test the text property fix. > > I accepted long ago that the solution to using a variable pitch > font for org headings was that the tags would not be aligned to > the right and never looked back, so maybe this is not worth the > price of fixing it if it is messy. And diving down to calculating > the pixel width of text seems like it=E2=80=99s getting pretty messy. > > -- > 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. > > --=20 The Kafka Pandemic Please learn what misopathy is. https://thekafkapandemic.blogspot.com/2013/10/why-some-diseases-are-wronged= .html