all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Uwe Brauer <oub@mat.ucm.es>
To: emacs-devel@gnu.org
Subject: change soft to hard lines and back
Date: Thu, 14 Dec 2017 14:44:44 +0100	[thread overview]
Message-ID: <87mv2ljuer.fsf@mat.ucm.es> (raw)


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 




             reply	other threads:[~2017-12-14 13:44 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-14 13:44 Uwe Brauer [this message]
2017-12-14 14:18 ` change soft to hard lines and back Hinrik Örn Sigurðsson
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

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87mv2ljuer.fsf@mat.ucm.es \
    --to=oub@mat.ucm.es \
    --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 external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.