From: "Hinrik Örn Sigurðsson" <hinrik.sig@gmail.com>
To: emacs-devel@gnu.org
Subject: Re: change soft to hard lines and back
Date: Thu, 14 Dec 2017 15:18:55 +0100 [thread overview]
Message-ID: <CAA1iZcfGKM04VPmESe3G9de=UwOgtER_PxLnq_7az32OLCzk4w@mail.gmail.com> (raw)
In-Reply-To: <87mv2ljuer.fsf@mat.ucm.es>
[-- Attachment #1: Type: text/plain, Size: 1348 bytes --]
You can use the function set-hard-newline-properties to mark all newlines
in some range as hard. For the inverse you can remove the 'hard property
with (remove-text-property START END '(hard nil)).
On Thu, Dec 14, 2017 at 2:44 PM, Uwe Brauer <oub@mat.ucm.es> wrote:
> Hi
>
> For email I start to use messages-are-flowing.el (for example in this
> message) which insert and display hardlines. (This is useful when sending
> message to devices with small screens since then the line ending is better
> displayed).
>
> However sometimes it is a bit too much. So I still have a function which
> replaces softline by hardlines, namely
>
> (defun harden-newlines () (interactive) (save-excursion ; (goto-char
> (point-min)) (mail-text) (while (search-forward "\n" nil t)
> (put-text-property (1- (point)) (point) 'hard t))))
> So I thought the inverse operation could be
> (defun soften-newlines () (interactive) (save-excursion ; (goto-char
> (point-min)) (mail-text) (while (search-forward "\n" nil t)
> (put-text-property (1- (point)) (point) 'soft t))))
> But unfortunately this did not work out. I tried to google for the
> put-text-property function but did not find anything useful.
>
> Somebody has an idea how to do that, replace hardlines again by softlines?
>
> Thanks
>
> Uwe Brauer
>
>
[-- Attachment #2: Type: text/html, Size: 5312 bytes --]
next prev parent reply other threads:[~2017-12-14 14:18 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-12-14 13:44 change soft to hard lines and back Uwe Brauer
2017-12-14 14:18 ` Hinrik Örn Sigurðsson [this message]
2017-12-14 15:18 ` Uwe Brauer
2017-12-14 15:54 ` Michael Heerdegen
2017-12-14 18:04 ` Uwe Brauer
2017-12-15 2:15 ` Stefan Monnier
2017-12-15 10:19 ` Uwe Brauer
2017-12-14 23:52 ` Jorge A. Alfaro-Murillo
2017-12-15 10:20 ` Uwe Brauer
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.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CAA1iZcfGKM04VPmESe3G9de=UwOgtER_PxLnq_7az32OLCzk4w@mail.gmail.com' \
--to=hinrik.sig@gmail.com \
--cc=emacs-devel@gnu.org \
/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.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).