emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Daniel Hackney <dan@haxney.org>
To: Nicolas Goaziou <n.goaziou@gmail.com>
Cc: emacs-orgmode@gnu.org
Subject: Re: [BUG] `org-fill-paragraph' doesn't use `fill-prefix'
Date: Sat, 27 Jul 2013 17:15:13 -0400	[thread overview]
Message-ID: <CAMqXDZttbEBAhqewLbbeataCYE4yS04JxLuNEpPmAWURcMSEfg@mail.gmail.com> (raw)
In-Reply-To: <874nbf3f6q.fsf@gmail.com>

Nicolas Goaziou <n.goaziou@gmail.com> wrote:
> Daniel Hackney <dan@haxney.org> writes:
>
>> I proposed a fix [1] for this back in 2010, but it seems to have regressed
>> again. `org-fill-paragraph' no longer makes use of a `fill-prefix', so
>> filling things like email comments no longer works.
>
> It has been discussed on this ML already. Org mode is not Message mode
> and ">" prefix means nothing to it.

It isn't just ">" that behaves this way in `fundamental-mode' and older
versions of org-mode; there are a number of such characters. From a
quick test, in Emacs 24.2,

#+BEGIN_EXAMPLE
-- foo
-- bar
#+END_EXAMPLE

becomes

#+BEGIN_EXAMPLE
-- foo bar
#+END_EXAMPLE

whereas in the current org-mode, it is

#+BEGIN_EXAMPLE
-- foo -- bar
#+END_EXAMPLE

Same with

#+BEGIN_EXAMPLE
! foo
! bar
#+END_EXAMPLE

and

#+BEGIN_EXAMPLE
% foo
% bar
#+END_EXAMPLE

The following also fill to a single line:

#+BEGIN_EXAMPLE
% % foo
% % bar

! ! foo
! ! bar
#+END_EXAMPLE

From a brief look at `fill-paragraph', the relevant code is in
`fill-comment-paragraph'. I might take a closer look at it to see if I
can come up with my own fix.

> Also, it has its own set of special prefixes, which are not found in
> Fundamental mode. For example, you can never have " : " as a fill prefix
> since it creates a fixed-width area.

Of course. Fundamental mode will fill

#+BEGIN_EXAMPLE
- foo
- bar
#+END_EXAMPLE

into a single line, but org-mode never did. I'm not asking for new
behavior, simply the `fill-paragraph' style of org 7.8.11 back.

> Therefore, I don't consider it to be a regression since it's not an
> expected feature in the first place. But I admit it is still
> convenient.

Well, my patch from 2010 /was/ applied [1], so I would consider it an
expected feature :)

> Maybe we can introduce some support for `adaptive-fill-regexp' in
> paragraphs and comments filling. Would you mind testing the following
> patch?

I'll test it later today.

[1] http://article.gmane.org/gmane.emacs.orgmode/22954

--
Daniel Hackney

  reply	other threads:[~2013-07-27 21:15 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-27 18:47 [BUG] `org-fill-paragraph' doesn't use `fill-prefix' Daniel Hackney
2013-07-27 20:45 ` Nicolas Goaziou
2013-07-27 21:15   ` Daniel Hackney [this message]
2013-07-27 23:16   ` Daniel Hackney
2013-07-28  8:20     ` Nicolas Goaziou

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=CAMqXDZttbEBAhqewLbbeataCYE4yS04JxLuNEpPmAWURcMSEfg@mail.gmail.com \
    --to=dan@haxney.org \
    --cc=emacs-orgmode@gnu.org \
    --cc=n.goaziou@gmail.com \
    /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).