From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Uwe Brauer Newsgroups: gmane.emacs.devel Subject: unfill-paragraph (region) and indentation Date: Mon, 02 Nov 2009 17:45:22 +0100 Message-ID: <87zl747u59.fsf@mat.ucm.es> Reply-To: Uwe Brauer NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1257180368 4201 80.91.229.12 (2 Nov 2009 16:46:08 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 2 Nov 2009 16:46:08 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Nov 02 17:46:00 2009 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1N502Z-0005TP-NG for ged-emacs-devel@m.gmane.org; Mon, 02 Nov 2009 17:45:59 +0100 Original-Received: from localhost ([127.0.0.1]:47428 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1N502Z-0000Q2-78 for ged-emacs-devel@m.gmane.org; Mon, 02 Nov 2009 11:45:59 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1N502T-0000No-7M for emacs-devel@gnu.org; Mon, 02 Nov 2009 11:45:53 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1N502O-0000Gk-Cm for emacs-devel@gnu.org; Mon, 02 Nov 2009 11:45:52 -0500 Original-Received: from [199.232.76.173] (port=39812 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1N502O-0000GZ-A6 for emacs-devel@gnu.org; Mon, 02 Nov 2009 11:45:48 -0500 Original-Received: from lo.gmane.org ([80.91.229.12]:33496) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1N502N-0000HB-Su for emacs-devel@gnu.org; Mon, 02 Nov 2009 11:45:48 -0500 Original-Received: from list by lo.gmane.org with local (Exim 4.50) id 1N502K-0005KO-NH for emacs-devel@gnu.org; Mon, 02 Nov 2009 17:45:44 +0100 Original-Received: from maportatil12.quim.ucm.es ([147.96.6.137]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 02 Nov 2009 17:45:44 +0100 Original-Received: from oub by maportatil12.quim.ucm.es with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 02 Nov 2009 17:45:44 +0100 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 44 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: maportatil12.quim.ucm.es X-Hashcash: 1:20:091102:gmane.emacs.devel::1mDl4xBi2dV20kcw:0000000000000000000000000000000000000000000015LG User-Agent: Gnus/5.110011 (No Gnus v0.11) XEmacs/21.4.21 (linux) Cancel-Lock: sha1:yGWhS+fostu2YNkerQSVWKVzaiw= X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:116581 Archived-At: 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