emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* [BUG]? \\ and `fill-paragraph'
@ 2012-01-30 15:50 Yu
  2012-01-30 22:18 ` Nicolas Goaziou
  0 siblings, 1 reply; 2+ messages in thread
From: Yu @ 2012-01-30 15:50 UTC (permalink / raw)
  To: org-mode mailing list

Hello!

When using "\\" to force linebreaks, these potentially get lost when
reformatting the paragraph with Alt+Q (fill paragraph).

Given an input

  :  - long sentence long sentence
  :    long sentence long sentence
  :    long sentence long sentence
  :    long sentence: \\
  :    Next line.

pressing Alt+Q (`fill-paragraph') I'd expect to get

  :  - long sentence long sentence long sentence long sentence long
  :    sentence long sentence long sentence: \\
  :    Next line.

but what I get is

  :  - long sentence long sentence long sentence long sentence long
  :    sentence long sentence long sentence: \\ Next line.

This is a problem especially as a "\\" anywhere but at the end of the
line is exported literally (i.e. `fill-paragraph' changes both the
appearance in emacs and in exported formats).

The Problem occurs in the opposite direction too: If a "\\" is  m e a
n t  to occur literally it can end up at the end of a line and thus be
interpreted as a line break.

The problem can be partially avoided by marking each "line" and /then/
pressing Alt+Q, but it is inconvinient and hinders fille-wide
reformatting (e.g. when the variable `fill-column' has changed).

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [BUG]? \\ and `fill-paragraph'
  2012-01-30 15:50 [BUG]? \\ and `fill-paragraph' Yu
@ 2012-01-30 22:18 ` Nicolas Goaziou
  0 siblings, 0 replies; 2+ messages in thread
From: Nicolas Goaziou @ 2012-01-30 22:18 UTC (permalink / raw)
  To: Yu; +Cc: org-mode mailing list

Hello,

Yu <yu_icq@gmx.at> writes:

> When using "\\" to force linebreaks, these potentially get lost when
> reformatting the paragraph with Alt+Q (fill paragraph).
>
> Given an input
>
>   :  - long sentence long sentence
>   :    long sentence long sentence
>   :    long sentence long sentence
>   :    long sentence: \\
>   :    Next line.
>
> pressing Alt+Q (`fill-paragraph') I'd expect to get
>
>   :  - long sentence long sentence long sentence long sentence long
>   :    sentence long sentence long sentence: \\
>   :    Next line.
>
> but what I get is
>
>   :  - long sentence long sentence long sentence long sentence long
>   :    sentence long sentence long sentence: \\ Next line.

Yes, this is a problem. I'll take a look at it in a few days. I wanted
to provide a better filling mechanism backed up with Org elements,
anyway.

> The Problem occurs in the opposite direction too: If a "\\" is  m e a
> n t  to occur literally it can end up at the end of a line and thus be
> interpreted as a line break.

I've committed a patch that should prevent auto-fill from creating Org
line breaks.


Regards,

-- 
Nicolas Goaziou

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2012-01-30 22:21 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-01-30 15:50 [BUG]? \\ and `fill-paragraph' Yu
2012-01-30 22:18 ` Nicolas Goaziou

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).