[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 |
Hello,
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
function.
I think it is the duty of the caller, here `bad-indent', to align the
tags properly.
Regards,
--
Nicolas Goaziou
- [O] bug#21818: 24.5; org-set-tags-to indentation problems when called programmatically, Eli Zaretskii, 2015/11/03
- [O] bug#21818: 24.5; org-set-tags-to indentation problems when called programmatically, Glenn Morris, 2015/11/04
- Message not available
- Message not available
- [O] bug#21818: 24.5; org-set-tags-to indentation problems when called programmatically, Emanuel Evans, 2015/11/04
- [O] bug#21818: 24.5; org-set-tags-to indentation problems when called programmatically, Nicolas Goaziou, 2015/11/05
- [O] bug#21818: 24.5; org-set-tags-to indentation problems when called programmatically, Nicolas Goaziou, 2015/11/05
- Re: [O] bug#21818: 24.5; org-set-tags-to indentation problems when called programmatically, Emanuel Evans, 2015/11/05
- Re: [O] bug#21818: 24.5; org-set-tags-to indentation problems when called programmatically, Emanuel Evans, 2015/11/16
- Re: [O] bug#21818: 24.5; org-set-tags-to indentation problems when called programmatically,
Nicolas Goaziou <=
- Re: [O] bug#21818: 24.5; org-set-tags-to indentation problems when called programmatically, Emanuel Evans, 2015/11/19
- Re: [O] bug#21818: 24.5; org-set-tags-to indentation problems when called programmatically, Nicolas Goaziou, 2015/11/20
Message not available