unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Uwe Brauer <oub@mat.ucm.es>
To: emacs-devel@gnu.org
Subject: unfill-paragraph (region) and indentation
Date: Mon, 02 Nov 2009 17:45:22 +0100	[thread overview]
Message-ID: <87zl747u59.fsf@mat.ucm.es> (raw)


Hello

I am aware of various un-filling or un-wrapping functions (either for
the region or the paragraph) for example this simple one: 

(defun unfill-paragraph-or-region ()
  (interactive)
  (filladapt-mode nil);this is important, because
                      ;otherwise    the   result  is   distorted  by the
                      ;filladapt function stuff
  (let ((fill-column (point-max)))
    (fill-paragraph-or-region nil)
    (filladapt-mode nil)))              ;on again


However none of these functions unfills paragraphs (or regions) with
indentation

Hello this 
  and this

Will not be changed to 

Hello this   and this


So I wrote up a very simple function which does precisely that: it unfills
paragraphs with indentation. I am not sure whether it is sufficient
efficient. Any comments?

(defun delete-indentation-region (start end)
  "Unfills regions with indentation."
  (interactive "r")
      (save-restriction
        (save-excursion
          (narrow-to-region start end)
          (goto-char (point-min))
		       (while (< (point) (point-max))
          (delete-indentation nil)
		  (forward-line 1)))))


Uwe Brauer 





             reply	other threads:[~2009-11-02 16:45 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-11-02 16:45 Uwe Brauer [this message]
2009-11-02 18:21 ` unfill-paragraph (region) and indentation Lluís
2009-11-02 18:35   ` Lennart Borgman
2009-11-03 10:08     ` Uwe Brauer
2009-11-03 20:02 ` Stefan Monnier
2009-11-04  9:43   ` Uwe Brauer
2009-11-04 18:40     ` Stefan Monnier
2009-11-04 23:12       ` Miles Bader
2009-11-06 10:01       ` unfill-paragraph(region) is different in GNU emacs and xemacs (was: unfill-paragraph (region) and indentation, ) Uwe Brauer
2009-11-06 11:44         ` Stephen J. Turnbull

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=87zl747u59.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 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).