From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Lennart Borgman Newsgroups: gmane.emacs.devel Subject: Re: unfill-paragraph (region) and indentation Date: Mon, 2 Nov 2009 19:35:53 +0100 Message-ID: References: <87zl747u59.fsf@mat.ucm.es> <86bpjkn5y2.wl%lluis@ginnungagap.pc.ac.upc.edu> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1257187044 28667 80.91.229.12 (2 Nov 2009 18:37:24 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 2 Nov 2009 18:37:24 +0000 (UTC) Cc: Uwe Brauer , emacs-devel@gnu.org To: =?UTF-8?B?TGx1w61z?= Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Nov 02 19:37:17 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 1N51mC-00035m-EU for ged-emacs-devel@m.gmane.org; Mon, 02 Nov 2009 19:37:12 +0100 Original-Received: from localhost ([127.0.0.1]:54962 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1N51mB-0008VL-T0 for ged-emacs-devel@m.gmane.org; Mon, 02 Nov 2009 13:37:11 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1N51lL-0007bl-9f for emacs-devel@gnu.org; Mon, 02 Nov 2009 13:36:19 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1N51lG-0007YF-8a for emacs-devel@gnu.org; Mon, 02 Nov 2009 13:36:18 -0500 Original-Received: from [199.232.76.173] (port=45862 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1N51lG-0007Y9-3m for emacs-devel@gnu.org; Mon, 02 Nov 2009 13:36:14 -0500 Original-Received: from mail-yw0-f194.google.com ([209.85.211.194]:59434) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1N51lF-0008Nc-PP for emacs-devel@gnu.org; Mon, 02 Nov 2009 13:36:13 -0500 Original-Received: by ywh32 with SMTP id 32so5012311ywh.14 for ; Mon, 02 Nov 2009 10:36:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:cc:content-type :content-transfer-encoding; bh=HSEabKJtAuViE/FQIuYkefpizqKEgn6qocfv1kx4CEQ=; b=Rei02Kl0bV8NfzHeJ/wHbTyigJ5O6mqE3R6knqhVx2g9vAE9aIbNqzp6YTB81EF0ML OY92l697Nm4I1RsOpBxae3a4zfMqToGvrcD4sqe7vMm+/1mgnYOnxnyiZkqwWg5W467C HzPBhSE77InZfKYv4Pt5005KpHwkLwVz+qbNg= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type:content-transfer-encoding; b=LFAJNyS2ts/V8j31gjld8Ddfpqotrct0J6zOKPu/y/Bbc2ZyRmOZj2AJpHiRmHGo6b tf3rzRWlgxX1S6W8AGXddUUkF/SX90FKQn5/sHhKCCf7YgO6SnwfpjJa6vXLv+cL36yG gheBun0Jmn72Z94ouyyalkrwJ5RNEHUukYN2U= Original-Received: by 10.101.130.18 with SMTP id h18mr2756844ann.80.1257186973186; Mon, 02 Nov 2009 10:36:13 -0800 (PST) In-Reply-To: <86bpjkn5y2.wl%lluis@ginnungagap.pc.ac.upc.edu> X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) 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:116583 Archived-At: On Mon, Nov 2, 2009 at 7:21 PM, Llu=C3=ADs wrote: > `fill-paragraph-or-region' has been conflated with `fill-paragraph' [1] (= don't know in which > version), so your code should be something like: > > (defun unfill-paragraph-or-region () > =C2=A0(interactive) > =C2=A0(filladapt-mode nil);this is important, because > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0;otherwise =C2=A0 =C2=A0the =C2=A0 result =C2=A0is =C2=A0 distorted =C2= =A0by the > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0;filladapt function stuff > =C2=A0(let ((fill-column (point-max))) > =C2=A0 =C2=A0(fill-paragraph nil) > =C2=A0 =C2=A0(filladapt-mode nil))) =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0;on again > > Note that this will not work with a region containing multiple paragraphs= . I think I have sent something like those very simple functions below a couple of times here (they are part of nXhtml): ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;; Unfilling ;; ;; The idea is from ;; http://interglacial.com/~sburke/pub/emacs/sburke_dot_emacs.config ;;;###autoload (defun unfill-paragraph () "Unfill the current paragraph." (interactive) (with-unfilling 'fill-paragraph)) ;;(defalias 'unwrap-paragraph 'unfill-paragraph) ;;;###autoload (defun unfill-region () "Unfill the current region." (interactive) (with-unfilling 'fill-region)) ;;(defalias 'unwrap-region 'unfill-region) ;;;###autoload (defun unfill-individual-paragraphs () "Unfill individual paragraphs in the current region." (interactive) (with-unfilling 'fill-individual-paragraphs)) ;;(defalias 'unwrap-individual-paragraphs 'unfill-individual-paragraphs) (defun with-unfilling (fn) "Unfill using the fill function FN." (let ((fill-column 10000000)) (call-interactively fn)))