emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

unfill-paragraph (region) and indentation


From: Uwe Brauer
Subject: unfill-paragraph (region) and indentation
Date: Mon, 02 Nov 2009 17:45:22 +0100
User-agent: Gnus/5.110011 (No Gnus v0.11) XEmacs/21.4.21 (linux)

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 via email to

[Prev in Thread] Current Thread [Next in Thread]