From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Van L Newsgroups: gmane.emacs.help Subject: Re: How to do a massive unfill paragraph operation over several hundred files? Date: Sun, 30 Sep 2018 15:10:17 +1000 Message-ID: <583DAEED-6321-4E75-B26E-530A998CD72D@scratch.space> References: <87wor6ujdn.fsf@tu-berlin.de> <86wor435c6.fsf@zoho.com> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: blaine.gmane.org 1538284145 6146 195.159.176.226 (30 Sep 2018 05:09:05 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sun, 30 Sep 2018 05:09:05 +0000 (UTC) To: Emacs Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sun Sep 30 07:09:01 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 1g6TyW-0001UG-8L for geh-help-gnu-emacs@m.gmane.org; Sun, 30 Sep 2018 07:09:00 +0200 Original-Received: from localhost ([::1]:53716 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g6U0c-0003T1-Fs for geh-help-gnu-emacs@m.gmane.org; Sun, 30 Sep 2018 01:11:10 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:43148) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g6U01-0003Sf-D0 for help-gnu-emacs@gnu.org; Sun, 30 Sep 2018 01:10:34 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1g6Tzx-0005t2-FC for help-gnu-emacs@gnu.org; Sun, 30 Sep 2018 01:10:33 -0400 Original-Received: from relay4-d.mail.gandi.net ([217.70.183.196]:50849) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1g6Tzx-0005rg-7i for help-gnu-emacs@gnu.org; Sun, 30 Sep 2018 01:10:29 -0400 X-Originating-IP: 199.249.223.63 Original-Received: from epi.local (unknown [199.249.223.63]) (Authenticated sender: van@scratch.space) by relay4-d.mail.gandi.net (Postfix) with ESMTPSA id BFC59E000A for ; Sun, 30 Sep 2018 05:10:24 +0000 (UTC) In-Reply-To: <86wor435c6.fsf@zoho.com> X-Mailer: Apple Mail (2.3124) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 217.70.183.196 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:118075 Archived-At: >> It's been decades since I messed with it, but >> as I vaguely recall there's a batch mode for >> emacs. Basically, you call emacs from the >> command line with the "--batch" and other >> options ("--script [file_containing_elisp]"). >=20 > See? I was right even decades ago! >=20 > :) You had this formulation: =E2=94=8C=E2=94=80=E2=94=80=E2=94=80=E2=94=80 =E2=94=82 1 #! /bin/zsh =E2=94=82 2 =20 =E2=94=82 3 # Script to insert a string into files =E2=94=82 4 # 1, 2, and 3: =E2=94=82 5 =20 =E2=94=82 6 local script=3Ddo-this.el =E2=94=82 7 =20 =E2=94=82 8 emacs -Q --batch --script $script 1 2 3 =E2=94=94=E2=94=80=E2=94=80=E2=94=80=E2=94=80 =E2=94=8C=E2=94=80=E2=94=80=E2=94=80=E2=94=80 =E2=94=82 1 ;; do-this.el =E2=94=82 2 =20 =E2=94=82 3 ;; Elisp to do it: =E2=94=82 4 =20 =E2=94=82 5 (dolist (f argv) =E2=94=82 6 (find-file f) =E2=94=82 7 (insert "Sail away, sail away, sail away=E2=80=A6") ; = do your thing here =E2=94=82 8 (save-buffer) ) =E2=94=94=E2=94=80=E2=94=80=E2=94=80=E2=94=80=