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: fill-paragraph from elisp Date: Sat, 11 Oct 2014 18:55:24 +0200 Message-ID: <87iojqpmic.fsf@ithaka.home> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1413048553 5443 80.91.229.3 (11 Oct 2014 17:29:13 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 11 Oct 2014 17:29:13 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sat Oct 11 19:29:06 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 1Xd0TZ-0002Hi-AM for geh-help-gnu-emacs@m.gmane.org; Sat, 11 Oct 2014 19:29:05 +0200 Original-Received: from localhost ([::1]:54826 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xd0TY-00014y-Pu for geh-help-gnu-emacs@m.gmane.org; Sat, 11 Oct 2014 13:29:04 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:55391) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xd06l-0006rj-T9 for help-gnu-emacs@gnu.org; Sat, 11 Oct 2014 13:05:38 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Xd06f-0003Uo-Nc for help-gnu-emacs@gnu.org; Sat, 11 Oct 2014 13:05:31 -0400 Original-Received: from mx02.posteo.de ([89.146.194.165]:59041) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xd06f-0003Tu-HN for help-gnu-emacs@gnu.org; Sat, 11 Oct 2014 13:05:25 -0400 Original-Received: from localhost (localhost.localdomain [127.0.0.1]) by mx02.posteo.de (Postfix) with ESMTP id 90F3F25C0084 for ; Sat, 11 Oct 2014 19:05:24 +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 8-O3kk-034me for ; Sat, 11 Oct 2014 19:05:23 +0200 (CEST) Original-Received: from mail.posteo.de (localhost [127.0.0.1]) by mail.posteo.de (Postfix) with ESMTPSA id B9C572C00FD for ; Sat, 11 Oct 2014 19:05:23 +0200 (CEST) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 89.146.194.165 X-Mailman-Approved-At: Sat, 11 Oct 2014 13:28:50 -0400 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:100428 Archived-At: Hello list, I want to insert some text from a database into a buffer. This should happen with `fill-paraph' applied, and the string contains multiple paragraphs. I came up with this (`descr' is the string): (let ((beg (point))) (insert descr) (set-mark beg) (fill-paragraph nil t) (set-mark nil)) This works, but I'm not feeling confident with it. The documentation of `set-mark' says this: ...Novice Emacs Lisp programmers often try to use the mark for the wrong purposes. ... So.. I'm a novice elisp programmer. Is this a "wrong purpose"? What is the idiomatic way to achieve this? Thanks and regards Eike -- gpg: AD7AC35E finger print: 137F BB0B 1639 D25F DC5D E59C B412 C5F5 AD7A C35E