all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: jorge.alfaro-murillo@yale.edu (Jorge A. Alfaro-Murillo)
To: emacs-devel@gnu.org
Subject: Re: change soft to hard lines and back
Date: Thu, 14 Dec 2017 18:52:08 -0500	[thread overview]
Message-ID: <876098kguv.fsf@yale.edu> (raw)
In-Reply-To: 87mv2ljuer.fsf@mat.ucm.es

Hi, Uwe.

Uwe Brauer writes:

> 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 [...] 
> 
> 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?

Probably this would work:

#+BEGIN_SRC emacs-lisp
  (defun soften-hardlines ()
    (interactive)
    (save-excursion
      (goto-char (point-min))
      (mail-text)
      (while (search-forward hard-newline nil t)
        (replace-match "\n"))))
#+END_SRC

Best,
-- 
Jorge.




  parent reply	other threads:[~2017-12-14 23:52 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
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 [this message]
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=876098kguv.fsf@yale.edu \
    --to=jorge.alfaro-murillo@yale.edu \
    --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.