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 15:38:39 +0100 Message-ID: References: <20201110111024.GA15992@tuxteam.de> <87zh3pctr1.fsf@web.de> <87o8k5csqj.fsf@web.de> <874klxcn6k.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="36072"; 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 15:40:53 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 1kcUpJ-0009Is-LA for geh-help-gnu-emacs@m.gmane-mx.org; Tue, 10 Nov 2020 15:40:53 +0100 Original-Received: from localhost ([::1]:35964 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kcUpI-0000Yp-HO for geh-help-gnu-emacs@m.gmane-mx.org; Tue, 10 Nov 2020 09:40:52 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:38182) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kcUnF-0000Ya-Mz for help-gnu-emacs@gnu.org; Tue, 10 Nov 2020 09:38:47 -0500 Original-Received: from mout.gmx.net ([212.227.17.20]:50475) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kcUnB-000096-2p for help-gnu-emacs@gnu.org; Tue, 10 Nov 2020 09:38:44 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1605019119; bh=C8GOMr+rQ7LEdBUOmDIPMw4PNiK4jiWG+GRweIeijbI=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:In-Reply-To:References; b=lJXJUxRZ4tAc7o9gor29mU0sezqdQtS+3u0+pUpCkYHhz6WH4AWnw2RiTsgFRylvX 47fQiPYN+yPpIQnPUqz70mtIYT9oF82/tD51OoXzafrJHlrPr+6Rk2z8iyRtkARsYG vVgErIjxytGesbeTlxoJLqVFaeETlIZMqsjmY3fg= 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 15:38:39 +0100 Importance: normal Sensitivity: Normal In-Reply-To: <874klxcn6k.fsf@web.de> X-UI-Message-Type: mail X-Priority: 3 X-Provags-ID: V03:K1:CnxFEogC6vma6XfG1Nr6PrVe2exxjc8uTmJDwqhfWJdZ70kdzF13oKOPn7z7N/nzxqoi7 oY8CtMoxBn79dLW56bt7J6cAfghBWdhMySzxOJzDPLjlecOaC8pc+0ntpnO8lc2XU1FgLFdYJkya pv79H1nBC2bKzrgYWDLAKPLJGDLXs1j7FGft76aEiv2s9Ii0xZfVFdV9ns23aeT4YcbuzTIIyCA9 PmCAvJ6fZ0UbRCjUiEabQFjESUATiR6OguBJcnLuz2C61B8l5O/2NJaxhi8RUnVrIub8xai+30c/ z4= X-UI-Out-Filterresults: notjunk:1;V03:K0:QJYDA/wLWHE=:2wQDXtI3mL4g/rJseu2mhj qax5PqWjl7P7HikDF5xlYB+5FbUHzT9h8lQS517BaVaF2nrSaOKpZVHDNXKy7xnACum69tTj1 jSmpFmXWbSLdI3KMO5k42YW9mqCwRHwsJ6NWmyNrWCN7izKfvlfv54S40Kx9cR+3shJvqwNYI rAW0A0jG42gstoFbtw3GKjZI6UaTRgovYphwVGIGmYE9kAIGiZ4ZDMwJhuw+h6GL3suGCw4eR y87am2ra3JEduOci4L1zJIX1/+RlWaREDEVkkQvMj/gYbGG3OBg7qqG8hkhHjYEefJ8GqavOH fnIOm+7BvuY4nZUUUbvUeDRN7ZRruhowSCK48GDeMQ6bGbiQD35wcP79AsjOv7qvFaHgYP+QX GowuVKqlTtTn5u77ZPgzXIRVZjitXkIZzCFdumvs82d23mtoUdxkuCQTvxMpztrtN9fdlAhJX Lv5HVRFddw88sSjNKhLxT/XN11ytVAK94C6Sidh41iBnfXtIyrqdv4RcqzWPPc4sPj2C86tY8 3XTKGz1wkyoQVoWnLikGCRJVw49KAEbOffsioxTAIHD8djQidqICBncQa9ruGQ3K4MY0eNr8V YYEordo679Rws= Received-SPF: pass client-ip=212.227.17.20; envelope-from=dimech@gmx.com; helo=mout.gmx.net X-detected-operating-system: by eggs.gnu.org: First seen = 2020/11/10 09:38:39 X-ACL-Warn: Detected OS = Linux 3.11 and newer [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:125192 Archived-At: Correct, the replacement. Because in .el files, the replacement will be ";; + ", in other languages, it is dependent on the symbol for comments (e.g. "!! +" for fortran code .f) > Sent: Tuesday, November 10, 2020 at 3:16 PM > From: "Michael Heerdegen" > To: help-gnu-emacs@gnu.org > Subject: Re: Adding String to Beginning of Lines > > Christopher Dimech writes: > > > 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)) > > Eh - Are you speaking about a default for the replacement, the > TO-STRING, you want to insert? Because your regexp is always "^" as far > as I understand. > > Michael. > > >