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: Tue, 10 Nov 2020 14:40:08 +0100 Message-ID: References: <20201110111024.GA15992@tuxteam.de> <87zh3pctr1.fsf@web.de> <87o8k5csqj.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="3066"; 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 Tue Nov 10 14:42:19 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 1kcTuc-0000gV-W0 for geh-help-gnu-emacs@m.gmane-mx.org; Tue, 10 Nov 2020 14:42:18 +0100 Original-Received: from localhost ([::1]:50356 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kcTub-0004Mu-Nn for geh-help-gnu-emacs@m.gmane-mx.org; Tue, 10 Nov 2020 08:42:17 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:52546) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kcTsa-0004Lv-My for help-gnu-emacs@gnu.org; Tue, 10 Nov 2020 08:40:13 -0500 Original-Received: from mout.gmx.net ([212.227.15.18]:50089) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kcTsY-00056R-Gm for help-gnu-emacs@gnu.org; Tue, 10 Nov 2020 08:40:12 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1605015608; bh=BwlNcIKmNP3G/abws7SgWBwkL9DLdUTC61Z500Mk70Q=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:In-Reply-To:References; b=e/e7vm2UQHc4ziNeuL3OYPSshEFCG4WgEBVm7HN+MKfHazQA2mrr+HRR6ybUkjxiS x8ibw/WoiDfAdVGdnvcvFZdcd263sFMBC4ymzj9px+gZVN8Vc2t/GwiENmNh4BIVux UkhPwV0bIt7g2tr6uBGdIPwHGPgtQSPw2sA6UiEs= 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-bs07.server.lan [172.19.170.175]) (via HTTP); Tue, 10 Nov 2020 14:40:08 +0100 Importance: normal Sensitivity: Normal In-Reply-To: <87o8k5csqj.fsf@web.de> X-UI-Message-Type: mail X-Priority: 3 X-Provags-ID: V03:K1:CrywYyLYS6X1m18lEXrAPOkTURB9W1QdBLSFif68JINHkT+c/ldQBqCSLjs0Q+Chumch3 htrjGqdL+3PqbQflLdC/N4qDJTaVY9uza4def9YPTmHgDXcXMeyoATugyXtoL//5PFmiHZE7Z6z9 P0CQ+C+232khNqzRlAVK1hoKZNgx9WLtiwuN+HfVrh9Z7PmRJtqwzxGQt0AF9AmSJZuX0hMtCs/V H4kGWFP41Sh4RqT5zEZ4OcS0NVMZvyyYn12+hQJc3y4B04O8SIzEmhiaaP8gEJy9ZK5gYQGTlLdm WI= X-UI-Out-Filterresults: notjunk:1;V03:K0:2SfN7DFDjpo=:6m1Gr01oB6vPat2uUprGOF /LbQzFdWtsUIyc5cD6Nk8PsjoXDjDzWhiqfSi0G676IpJQiA/i5Jamhhwi92dDpsXFvqUxqzx FOUcHqDnd3kst2SKB8lYrcSUiYiLYCnfFP/bxmFLktKh6fta3CTLnKK6GjW9OVdFRRlL77HA/ hHXT2FpLWoP7viOVodWBZwIOAV3Gizrec0my1Wm4A7R/qmzjxikVtrSYDTpFTmseuK5+pJmjm 8g0u5HXuPp4cYI3dBKEdz3o8fb9QQ49XwA69sbIluYvaHFndqYWGZudj8QZorWZLkiM1l/lU/ b0VuPzfJXxH6YfMWeuMClSITQ2Bl/9pdeWs9BwiKBPE/CH2CkYoafdDCqXrc3aqO5Zy2Tjvv4 oqQw2KTmk9qtwK3hN1m6G9gO6svfVVsgve+FiTGb+CT18K4ER1SIuXs/Ji24JCLmfEv9HwquL taIJad0ZfhnuPp+Fq7Hf0i5+DEtNi93zXIfhOBPHh3Fjib6rwT6ioi8EKxThnpYHNSM83wH1q /hw4Xg6+j1tM0xvH15n3VEztJUBNCmyXZYoGrVOsc/d6NEYo4Av9E3eV8xiHBI8pOzkrtLzVL ZURHHJGXQTXAs= Received-SPF: pass client-ip=212.227.15.18; envelope-from=dimech@gmx.com; helo=mout.gmx.net X-detected-operating-system: by eggs.gnu.org: First seen = 2020/11/10 06:29:51 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:125185 Archived-At: I now have got 'rec-cont', which lets me pass a string. How can I add a dafault if I don't pass a regex in the mini-buffer. (defun rec-cont (beg end regex) (interactive "r\ns rec-cont regex: ") (replace-regexp "^" regex nil beg end)) ;; (replace-regexp "^" ";; + " nil beg end)) > Sent: Tuesday, November 10, 2020 at 1:16 PM > From: "Michael Heerdegen" > To: help-gnu-emacs@gnu.org > Subject: Re: Adding String to Beginning of Lines > > Christopher Dimech writes: > > > Have used the following > > > > (defun compfx () > > (interactive "r") > > (query-replace-regexp "^" ";; + ")) > > (defun compfx (beg end) > (interactive "r") > (query-replace-regexp "^" ";; + " nil beg end)) > > Do you want to be asked interactively whether to replace each "match"? > If not, we want to use something non-interactive instead of > `query-replace-regexp'. > > > Michael. > > >