emacs-orgmode
[Top][All Lists]
Advanced

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

Re: [O] [bug, ox-ascii][PATCH] description list and long links


From: Nicolas Goaziou
Subject: Re: [O] [bug, ox-ascii][PATCH] description list and long links
Date: Wed, 28 Jan 2015 13:58:33 +0100

Hello,

Rasmus <address@hidden> writes:

> Consider the following example:
>
> (with-temp-buffer 
>   (require 'ox-ascii)
>   (insert
>    "- 
> [[http://www.npr.org/blogs/monkeysee/2009/03/a_very_long_url_makes_a_very_s.html][A
>  label with a long link]] :: Lorem ipsum dolor sit amet, consectetur 
> adipiscing elit\n")
>   (org-ascii-export-as-ascii nil nil nil t))  
>
> With output:
>
> [A label with a long link]: Lorem
>                             ipsum
>                             dolor
>                             sit
>                             amet,
>                             consectetur
>                             adipiscing
>                             elit
>
>
> [A label with a long link]
> http://www.npr.org/blogs/monkeysee/2009/03/a_very_long_url_makes_a_very_s.html
>
> The reason for the wrong formatting is that org-ascii--current-text-width
> takes that there's is like -28 characters left for lorem ipsum...  It does
> that because it counts link and label.
>
> The patch fixes this by only counting the length of the label.

Thank you. I have applied a slightly different patch.

The formatting is still not optimal, however, as you can end up with
something like

  
[http://www.npr.org/blogs/monkeysee/2009/03/a_very_long_url_makes_a_very_s.html]:
 Lorem
                                                                                
    ipsum
                                                                                
    dolor
                                                                                
    sit
                                                                                
    amet,
                                                                                
    consectetur
                                                                                
    adipisicing
                                                                                
    elit

A proper formatting would be, for example,

  
[http://www.npr.org/blogs/monkeysee/2009/03/a_very_long_url_makes_a_very_s.html]:

        Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do
        eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut
        enimad minim veniam, quis nostrud exercitation ullamco laboris


I guess a threshold would then be needed, though, as the following is
still nice and probably desirable

  lorem: Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed
         do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut
         enimad minim veniam, quis nostrud exercitation ullamco laboris nisi

But I'm not sure if it is common to have such long tags in description
lists.


Regards,

-- 
Nicolas Goaziou



reply via email to

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