From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eike Kettner Newsgroups: gmane.emacs.help Subject: Re: fill-paragraph from elisp Date: Sat, 11 Oct 2014 21:52:01 +0200 Message-ID: <87fveupeim.fsf@ithaka.home> References: <87iojqpmic.fsf@ithaka.home> <1e855312-d62b-4385-89a9-c778e88b6e03@default> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1413057521 8467 80.91.229.3 (11 Oct 2014 19:58:41 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 11 Oct 2014 19:58:41 +0000 (UTC) Cc: help-gnu-emacs@gnu.org To: Drew Adams Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sat Oct 11 21:58:34 2014 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Xd2oC-0005zz-DW for geh-help-gnu-emacs@m.gmane.org; Sat, 11 Oct 2014 21:58:32 +0200 Original-Received: from localhost ([::1]:55141 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xd2oC-0001Hj-4x for geh-help-gnu-emacs@m.gmane.org; Sat, 11 Oct 2014 15:58:32 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:49016) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xd2nw-0001Fl-2H for help-gnu-emacs@gnu.org; Sat, 11 Oct 2014 15:58:22 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Xd2np-00018V-T8 for help-gnu-emacs@gnu.org; Sat, 11 Oct 2014 15:58:15 -0400 Original-Received: from mx02.posteo.de ([89.146.194.165]:38881) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xd2np-00018P-NZ for help-gnu-emacs@gnu.org; Sat, 11 Oct 2014 15:58:09 -0400 Original-Received: from localhost (localhost.localdomain [127.0.0.1]) by mx02.posteo.de (Postfix) with ESMTP id 5883D25B17F1; Sat, 11 Oct 2014 21:58:08 +0200 (CEST) X-Virus-Scanned: amavisd-new at posteo.de Original-Received: from posteo.de ([10.125.125.178]) (using TLS) by localhost (amavis1.posteo.de [10.125.125.165]) (amavisd-new, port 10026) with ESMTPS id Lcy5-9y4wNtl; Sat, 11 Oct 2014 21:58:07 +0200 (CEST) Original-Received: from mail.posteo.de (localhost [127.0.0.1]) by mail.posteo.de (Postfix) with ESMTPSA id B4DE92C010F; Sat, 11 Oct 2014 21:58:01 +0200 (CEST) In-reply-to: <1e855312-d62b-4385-89a9-c778e88b6e03@default> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 89.146.194.165 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:100435 Archived-At: Thanks for your answer! I just found out, that I completely missed the `fill-region' function=E2=80=A6 I read the doc-string of `fill-paragraph' multiple times and yet, I managed to ignore it. It turns out that (fill-region start end) is what I want. I'm sorry for the noise and confusion. Regards Eike Drew Adams writes: >> (let ((beg (point))) >> (insert descr) >> (set-mark beg) >> (fill-paragraph nil t) >> (set-mark nil)) >> >> What is the idiomatic way to achieve this? > > Use `narrow-to-region' to operate on the text between two positions. -- gpg: AD7AC35E finger print: 137F BB0B 1639 D25F DC5D E59C B412 C5F5 AD7A C35E