[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] bug#21818: 24.5; org-set-tags-to indentation problems when calle

From: Nicolas Goaziou
Subject: Re: [O] bug#21818: 24.5; org-set-tags-to indentation problems when called programmatically
Date: Thu, 19 Nov 2015 09:36:13 +0100


Emanuel Evans <address@hidden> writes:

> Hi! It looks like it's fixed for `org-insert-link', but I ran across a
> similar bug with `org-element-interpret-data' that seems to be not
> entirely fixed:
> (defun good-indent ()
>   (interactive)
>   (insert (org-element-interpret-data
>            `(headline (:level 1
>                               :title "something"
>                               :tags ("foo"))))))
> (defun bad-indent ()
>   (interactive)
>   (insert (org-element-interpret-data
>            `(headline (:level 1
>                               :title ((link (:raw-link 
> "http://www.example.com/foo/bar/baz/qux/abc123f56789";)
>                                             "something"))
>                               :tags ("foo"))))))
> `good-indent' looks like:
> * something                                                             :foo:
> With org-mode 8.2.10, `bad-indent' looks like:
> * something    :foo:
> With the latest master version of org-mode (d6aafd7), `bad-indent' looks
> like:
> * something                                                      :foo:
> (i.e., "almost but still not quite right").
> I'm not very familiar with the org-element internals, but is there any
> way to work around this for 8.2.10? (I'm writing a library that I'd like
> to be compatible with Emacs 24.5.)

I don't consider it to be a bug.

`org-element-interpret-data' produces a string, which is expected to be
syntactically correct, but doesn't guarantee aesthetics. In particular,
`org-element-headline-interpreter' tries to align tags as accurately as
possible, but, in this case, fails to succeed as it would require to
introduce fontification in the process. This is out of the scope of the

I think it is the duty of the caller, here `bad-indent', to align the
tags properly.


Nicolas Goaziou

reply via email to

[Prev in Thread] Current Thread [Next in Thread]