From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Christopher Dimech Newsgroups: gmane.emacs.help Subject: Re: Adding String to Beginning of Lines Date: Wed, 11 Nov 2020 14:22:44 +0100 Message-ID: References: <20201110111024.GA15992@tuxteam.de> <87zh3pctr1.fsf@web.de> <87o8k5csqj.fsf@web.de> <20201110224507.GA10842@tuxteam.de> <87v9ecdty8.fsf@web.de> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="12678"; mail-complaints-to="usenet@ciao.gmane.io" Cc: help-gnu-emacs@gnu.org To: Michael Heerdegen Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Wed Nov 11 14:37:08 2020 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kcqJA-0003Bd-JH for geh-help-gnu-emacs@m.gmane-mx.org; Wed, 11 Nov 2020 14:37:08 +0100 Original-Received: from localhost ([::1]:54234 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kcqJ9-0003ej-DN for geh-help-gnu-emacs@m.gmane-mx.org; Wed, 11 Nov 2020 08:37:07 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:46514) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kcq5J-0001Mh-68 for help-gnu-emacs@gnu.org; Wed, 11 Nov 2020 08:22:50 -0500 Original-Received: from mout.gmx.net ([212.227.15.19]:46581) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kcq5G-0005Wo-Ui for help-gnu-emacs@gnu.org; Wed, 11 Nov 2020 08:22:48 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1605100964; bh=mELmGSgkP+/kZ2fb5jXZE7T8zWWzI/Ge7x/4FDeptK4=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:In-Reply-To:References; b=j50njYX40rIJfqD1j+kYyeSccd22N9+ThtlLFbZIYSDPbO2/RGFS2qEwSTNeKfeYU 8F3sz/dNBANLrrW/qZb5qGzDdklfrZEr82jYGmyBkaggHRro+dVjH5Fbrb1HWwszAK dkN2WdEVpq5w3AgYt3t8aMmj49s/+s98jHO6PPwM= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Original-Received: from [213.165.168.94] ([213.165.168.94]) by web-mail.gmx.net (3c-app-mailcom-bs13.server.lan [172.19.170.181]) (via HTTP); Wed, 11 Nov 2020 14:22:44 +0100 Importance: normal Sensitivity: Normal In-Reply-To: <87v9ecdty8.fsf@web.de> X-UI-Message-Type: mail X-Priority: 3 X-Provags-ID: V03:K1:QVdF8GhxepOq9w27qy5p6KGz/bwyjjE8PpX36Anq42eNUXf21Ov5VtzWw1eag83i2D9bm 4jgEWEiZjmVSTQae5BfCFC8GBf6kV5jBIoip1HU5dH0LH0sa4eQB2v0eaT1BjZiOr9l5ZYxdVI2g g0WJ/0WVVYF6HqfWaIZ+qluCBbjLg3U3R9dEk6kw92CuLF2YY5o2ro3FkVF8gkbM7Zb8gfek4/cg detFaeNqEdalwJ9HyGfSujmLit9ml8NonwBwiYhJGkKhc+maK4xranlknES1jTGbnj4H+DJUxesc dU= X-UI-Out-Filterresults: notjunk:1;V03:K0:mqccC9zsFs8=:Ldbd3lPIWBJZAwgQkbydmb bmIs8HYaw66gowXIAgJAG9TCCn4TJxC23jtW88YOD8UvMbB5FMC0f5BvY7nLv6vdlAwnJClyV P/S8QBUsAKWYOMff1ps5aMc5VLxEHtc+o6JenB7PBJthQ0mIUhm1/+Mrzc/2NWft+dMub3NZg gPIl6gMmnJOen3cOD4+7vFmNjW2/fVP7DHibHQei7uHGHljQgMswpmbian6lSjbr8YivdDORG cGXdZIL3hKih6UZop9BgzqEJ9ZZmA1W5c4yw7Ayi3ZtAcILl6FmumtLpYDGOnhor7yyr61KCD EwKJxgeVuL7avlRoo4Pt6axCK26/5GpB6orjUx9QMCHE/SnbUT+3OGm8UpdLwWClVrPHNef4+ nf1FibWt+wmCGImsRkQFlBgQGA3k8la039FEdI850qKmFW9mfzPDIo4sDp3m+utdQsLfk+hKh re3am1yb9Vol7xp/pvhE1Zy0B5OvdpDXXse26f2aYSvI+0siapUkzK21vpLUJG2oP9GHMyVgu TKFK5k7DpYKIkw3JpxDbXTo0rjbc+qC7P7+AnECHBXm09bzuGCcLHmMOCCNKNx3STOX2yDI0s SJe0ugS5Ecxxs= Received-SPF: pass client-ip=212.227.15.19; envelope-from=dimech@gmx.com; helo=mout.gmx.net X-detected-operating-system: by eggs.gnu.org: First seen = 2020/11/11 08:22:45 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -25 X-Spam_score: -2.6 X-Spam_bar: -- X-Spam_report: (-2.6 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.23 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-mx.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.io gmane.emacs.help:125224 Archived-At: > Sent: Wednesday, November 11, 2020 at 12:16 PM > From: "Michael Heerdegen" > To: help-gnu-emacs@gnu.org > Subject: Re: Adding String to Beginning of Lines > > writes: > > > But watch out: the replacement string (confusingly called `regex' here= , > > others have already pointed that out) might contain special sequences > > (e.g. "\\&") which have a meaning in this context. > > Indeed, an important objection. > > I would suggest to avoid using any query-replace at all and rather use > something like > > #+begin_src emacs-lisp > (save-excursion > (while (and (<=3D (point) end) > (not (eobp))) > (insert my-string) > (forward-line +1)) > (deactivate-mark)) > #+end_src That's what I started doing at the beginning. Should we revert to this or continue with replace-regexp. Have now removed the confusingly called `regex' and it is currently called nwltok. > > Cheers > > Ebenso! > > > Regards, > > Michael. > > >