emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Adam Spiers <orgmode@adamspiers.org>
To: Jeff Filipovits <jrfilipovits@gmail.com>
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: Thu, 17 Sep 2020 01:18:57 +0100	[thread overview]
Message-ID: <20200917001857.ry2ie6vjvon5b63h@ionian.linksys.moosehall> (raw)
In-Reply-To: <20200916225553.hrtxitzt46dzln7i@ionian.linksys.moosehall>

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. 


  reply	other threads:[~2020-09-17  0:19 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
2020-09-16 21:14             ` Samuel Wales
2020-09-16 22:55             ` Adam Spiers
2020-09-17  0:18               ` Adam Spiers [this message]
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:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  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=20200917001857.ry2ie6vjvon5b63h@ionian.linksys.moosehall \
    --to=orgmode@adamspiers.org \
    --cc=e.fraga@ucl.ac.uk \
    --cc=emacs-orgmode@gnu.org \
    --cc=info@protesilaos.com \
    --cc=jrfilipovits@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* 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

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

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).