unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* change soft to hard lines and back
@ 2017-12-14 13:44 Uwe Brauer
  2017-12-14 14:18 ` Hinrik Örn Sigurðsson
  2017-12-14 23:52 ` Jorge A. Alfaro-Murillo
  0 siblings, 2 replies; 9+ messages in thread
From: Uwe Brauer @ 2017-12-14 13:44 UTC (permalink / raw)
  To: emacs-devel


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 




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

end of thread, other threads:[~2017-12-15 10:20 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-12-14 13:44 change soft to hard lines and back Uwe Brauer
2017-12-14 14:18 ` 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

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