emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Nicolas Goaziou <mail@nicolasgoaziou.fr>
To: Rasmus <rasmus@gmx.us>
Cc: emacs-orgmode@gnu.org
Subject: Re: [bug, ox-ascii][PATCH] description list and long links
Date: Wed, 28 Jan 2015 13:58:33 +0100	[thread overview]
Message-ID: <87r3uf2hae.fsf@nicolasgoaziou.fr> (raw)
In-Reply-To: <87twzbsq5g.fsf@gmx.us> (rasmus@gmx.us's message of "Wed, 28 Jan 2015 01:30:19 +0100")

Hello,

Rasmus <rasmus@gmx.us> 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	other threads:[~2015-01-28 12:57 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-28  0:30 [bug, ox-ascii][PATCH] description list and long links Rasmus
2015-01-28 12:58 ` Nicolas Goaziou [this message]
2015-01-28 13:48   ` Rasmus

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=87r3uf2hae.fsf@nicolasgoaziou.fr \
    --to=mail@nicolasgoaziou.fr \
    --cc=emacs-orgmode@gnu.org \
    --cc=rasmus@gmx.us \
    /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).