unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* unfill-paragraph (region) and indentation
@ 2009-11-02 16:45 Uwe Brauer
  2009-11-02 18:21 ` Lluís
  2009-11-03 20:02 ` Stefan Monnier
  0 siblings, 2 replies; 10+ messages in thread
From: Uwe Brauer @ 2009-11-02 16:45 UTC (permalink / raw)
  To: emacs-devel


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 





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

end of thread, other threads:[~2009-11-06 11:44 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-11-02 16:45 unfill-paragraph (region) and indentation Uwe Brauer
2009-11-02 18:21 ` 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

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