[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Filling a string?
From: |
Tassilo Horn |
Subject: |
Re: Filling a string? |
Date: |
Fri, 17 Jul 2015 12:58:22 +0200 |
User-agent: |
Gnus/5.130014 (Ma Gnus v0.14) Emacs/25.0.50 (gnu/linux) |
Vaidheeswaran C <vaidheeswaran.chinnaraju@gmail.com> writes:
>>> > so I want part of the buffer to have wrapped lines (preferably at
>>> > word boundaries), and part to have not (like having
>>> > toggle-truncate lines only for a region). I suspect this is not
>>> > possible
>> Can't you just insert unwrapped lines and use `fill-region' on the
>> parts you want to have wrapped?
>
> I have a feeling that he wants the "fill" to be "soft" on certain
> paragraphs of his choosing. The only mode that I know of where in
> Emacs "persists" text properties is "Enriched Mode".
>
> (info "(emacs) Hard and Soft Newlines")
>
> In other words, the user wants to configure right/left margins and
> importantly the width of the text area on per-paragraph basis. In the
> actual file, a paragraph will have no newline at all howsoever it may
> be displayed.
Ah, ok. I think it's possible, too. There are left-margin and
right-margin text properties.
,----[ (info "(elisp)Format Properties") ]
| These text properties affect the behavior of the fill commands. They
| are used for representing formatted text. *Note Filling::, and *note
| Margins::.
|
| [...]
|
| ‘right-margin’
| This property specifies an extra right margin for filling this part
| of the text.
|
| ‘left-margin’
| This property specifies an extra left margin for filling this part
| of the text.
`----
So possibly adding these properties to some paragraphs in your buffer +
`visual-line-mode' might do the trick.
Bye,
Tassilo