emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Jeff Filipovits <jrfilipovits@gmail.com>
To: Adam Spiers <orgmode@adamspiers.org>
Cc: Protesilaos Stavrou <info@protesilaos.com>,
	emacs-orgmode@gnu.org, Eric S Fraga <e.fraga@ucl.ac.uk>
Subject: Re: variable-pitch-mode misaligns org-mode heading tags
Date: Wed, 16 Sep 2020 15:03:02 -0400	[thread overview]
Message-ID: <87mu1pa6jd.fsf@gmail.com> (raw)
In-Reply-To: <20200916162143.xyg7j5rg6xalmv2j@ionian.linksys.moosehall>


Thanks. You are right of course and I realized the right-align 
issue right after I sent my email. 

Adam Spiers <orgmode@adamspiers.org> 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 
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’s 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’s no space between the two, I don’t 
think it’ll insert one. Probably not the best way as it was thrown 
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’s getting pretty messy. 

Jeff Filipovits
Spears & Filipovits, LLC
1126 Ponce de Leon Avenue
Atlanta, GA 30306
678.237.9302 (direct)

All emails confidential to the fullest extent of the law.

  reply	other threads:[~2020-09-16 19:05 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-08 19:31 variable-pitch-mode misaligns org-mode heading tags Protesilaos Stavrou
2020-09-09  8:44 ` Bastien
2020-09-09 11:03   ` Eric S Fraga
2020-09-09 14:39     ` Bastien
2020-09-15 17:41       ` Jeff Filipovits
2020-09-16 16:21         ` Adam Spiers
2020-09-16 19:03           ` Jeff Filipovits [this message]
2020-09-16 21:14             ` Samuel Wales
2020-09-16 22:55             ` Adam Spiers
2020-09-17  0:18               ` Adam Spiers
2020-09-17  2:03               ` Jeff Filipovits
2020-09-17 15:36                 ` Jeff Filipovits
2020-09-18 12:49                 ` Ihor Radchenko
2021-04-27 19:41           ` Bastien

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87mu1pa6jd.fsf@gmail.com \
    --to=jrfilipovits@gmail.com \
    --cc=e.fraga@ucl.ac.uk \
    --cc=emacs-orgmode@gnu.org \
    --cc=info@protesilaos.com \
    --cc=orgmode@adamspiers.org \


* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).