From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nicolas Goaziou Subject: Re: [bug, ox-ascii][PATCH] description list and long links Date: Wed, 28 Jan 2015 13:58:33 +0100 Message-ID: <87r3uf2hae.fsf@nicolasgoaziou.fr> References: <87twzbsq5g.fsf@gmx.us> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:52310) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YGSBd-0007zK-Eo for emacs-orgmode@gnu.org; Wed, 28 Jan 2015 07:57:40 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YGSBX-0000lo-Ik for emacs-orgmode@gnu.org; Wed, 28 Jan 2015 07:57:37 -0500 Received: from relay5-d.mail.gandi.net ([2001:4b98:c:538::197]:54174) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YGSBX-0000lW-C6 for emacs-orgmode@gnu.org; Wed, 28 Jan 2015 07:57:31 -0500 In-Reply-To: <87twzbsq5g.fsf@gmx.us> (rasmus@gmx.us's message of "Wed, 28 Jan 2015 01:30:19 +0100") List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Rasmus Cc: emacs-orgmode@gnu.org Hello, Rasmus 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