From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Robert Pluim Newsgroups: gmane.emacs.help Subject: Re: How to do a massive unfill paragraph operation over several hundred files? Date: Mon, 01 Oct 2018 17:21:51 +0200 Message-ID: <875zyl1yls.fsf@gmail.com> References: <8636ts4jz3.fsf@zoho.com> <86zhvyzq4c.fsf@zoho.com> <86muryype2.fsf@zoho.com> <87in2lvikf.fsf@tu-berlin.de> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: blaine.gmane.org 1538407224 32596 195.159.176.226 (1 Oct 2018 15:20:24 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 1 Oct 2018 15:20:24 +0000 (UTC) Cc: help-gnu-emacs@gnu.org, Emanuel Berg To: Gerald Wildgruber Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Mon Oct 01 17:20:20 2018 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1g6zze-0008Ms-Ja for geh-help-gnu-emacs@m.gmane.org; Mon, 01 Oct 2018 17:20:18 +0200 Original-Received: from localhost ([::1]:39158 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g701l-0005BZ-5u for geh-help-gnu-emacs@m.gmane.org; Mon, 01 Oct 2018 11:22:29 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:55636) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g701K-0005BT-J0 for help-gnu-emacs@gnu.org; Mon, 01 Oct 2018 11:22:03 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1g701E-0002Ye-Sq for help-gnu-emacs@gnu.org; Mon, 01 Oct 2018 11:22:02 -0400 Original-Received: from mail-wr1-x435.google.com ([2a00:1450:4864:20::435]:37564) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1g701E-0002Xt-DE for help-gnu-emacs@gnu.org; Mon, 01 Oct 2018 11:21:56 -0400 Original-Received: by mail-wr1-x435.google.com with SMTP id u12-v6so14410497wrr.4 for ; Mon, 01 Oct 2018 08:21:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:mail-copies-to:gmane-reply-to-list :date:in-reply-to:message-id:mime-version:content-transfer-encoding; bh=PAcJsPiQyVEhok+D90Xb8dingDbGIbMy6Ofoe2z82FE=; b=jviYPyYnkv8d1MI8BsfLfHsRskhF1VW70k/GMc1QZmVChTIZ2bJSTNqqSyLaODXYcq /LfVKrT6Cjr4yoqXh3mBT3OpqoWD+/GWE0IG0yfaSCqIookLcKVziyy8GlhrkFdYkUuk AwCdAFYU6cGoMof0zCyt61Y5+bOEy7ylZx88wzjSzRQgQw1lPUPaEFzh4aaiYADIxwNr jC9E36PrDpoyoFvoP9Hj2MJQvGPUViDlHyPyJTnXQEhf9xp4WwB4XQRwr/+uBXqSVJAT L9En5bwgxWP7BPETsiRMoeuN56fyPHtnPtU/ALMiB9nGd+P6p9ofS3MkdlDGtGvxxdDD Rgzw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:mail-copies-to :gmane-reply-to-list:date:in-reply-to:message-id:mime-version :content-transfer-encoding; bh=PAcJsPiQyVEhok+D90Xb8dingDbGIbMy6Ofoe2z82FE=; b=YOLVZVB8iyxLP8nL6ytNwCEsNmIPpiIN83a9OOHkYBm9n6IH2JBIm/zXWlmNEUMVo2 3/6UmlrkNoc0TOcanf60YPVbxgem4XFMmKOO7YhSKXJSIFZmpDYrh3pBaDiqW9ZaBXDV x/miUVBdALMXfI3qQl83/usTXM+c72FhpPv7cTWGE6P9T72d9uvqhMoPrqkhYKm/kNz6 C4JmrTZi3gvd11bu+vVJPfAVd8rbpbBaMG2q/a4cx+zOA+z+Ng7MmZRbJVrEmJ8w7STv gJjzT+iMX1Ji2IdI/pvMtwwqUAPVjfJ4heEEcc3SsmJOczbZVfTWvj27si2BL/NXANSE iIHQ== X-Gm-Message-State: ABuFfohRg+glU/mb6FXqXRb6NWYVgBNrXt0SIlYs8QcJ8H/68FkIjoOM 8beybqxDGiqFVCvdfU/GI92N1Fbo X-Google-Smtp-Source: ACcGV61gRb8A4c9owTJIrB0uxRDf69ifPVmV1nCOqkhkgNdNw93IVdrTWpxZ6DB7CiPLOyiYqT5cKw== X-Received: by 2002:adf:e7cb:: with SMTP id e11-v6mr813850wrn.27.1538407313850; Mon, 01 Oct 2018 08:21:53 -0700 (PDT) Original-Received: from rpluim-ubuntu ([149.5.228.1]) by smtp.gmail.com with ESMTPSA id e133-v6sm10884953wma.42.2018.10.01.08.21.52 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 01 Oct 2018 08:21:53 -0700 (PDT) Mail-Copies-To: never Gmane-Reply-To-List: yes In-Reply-To: <87in2lvikf.fsf@tu-berlin.de> (Gerald Wildgruber's message of "Mon, 1 Oct 2018 16:37:52 +0200") X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::435 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.21 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" Xref: news.gmane.org gmane.emacs.help:118088 Archived-At: Gerald Wildgruber writes: > On Mo, Okt 01 2018, Emanuel Berg wrote: > >> Gerald Wildgruber wrote: >> >>> But how can I use the unfill-paragraph >>> function programmatically (non-interactively) >>> in a script >> >> (unfill-paragraph ARGS) > > Yes, that is the whole point I didn't understand! What does "ARGS" have t= o be when called non-interactively in a script. From the doc string of the = function: > > (defun unfill-paragraph (&optional region) > "Takes a multi-line paragraph and makes it into a single line of text." > (interactive (progn (barf-if-buffer-read-only) '(t))) > (let ((fill-column (point-max))) > (fill-paragraph nil region))) It=CA=BCs optional, which means it will be 'nil' if you don=CA=BCt specify = it, which means (from the docsting of 'fill-paragraph') The REGION argument is non-nil if called interactively; in that case, if Transient Mark mode is enabled and the mark is active, call `fill-region' to fill each of the paragraphs in the active region, instead of just filling the current paragraph. So 'nil' just means 'fill the current paragraph'. It might work for you if you mark the whole buffer, and call (unfill-paragraph t) instead, since that should take care of iterating over all the paragraphs (untested). Robert