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 12:19:32 +0100 Message-ID: References: <20201110111024.GA15992@tuxteam.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="35064"; mail-complaints-to="usenet@ciao.gmane.io" Cc: help-gnu-emacs@gnu.org To: tomas@tuxteam.de Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Tue Nov 10 12:45:43 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 1kcS5l-0008xZ-7c for geh-help-gnu-emacs@m.gmane-mx.org; Tue, 10 Nov 2020 12:45:41 +0100 Original-Received: from localhost ([::1]:60060 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kcS5j-00058h-PR for geh-help-gnu-emacs@m.gmane-mx.org; Tue, 10 Nov 2020 06:45:40 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:46466) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kcRhC-0002Sf-Sk for help-gnu-emacs@gnu.org; Tue, 10 Nov 2020 06:20:18 -0500 Original-Received: from mout.gmx.net ([212.227.17.22]:51325) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kcRgf-0006tx-Pb for help-gnu-emacs@gnu.org; Tue, 10 Nov 2020 06:20:18 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1605007172; bh=cjLr0ErgkPRSHQTNTOhalT3tVv8cwDn62gF75MSOS08=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:In-Reply-To:References; b=a5kAJumG3C4f6WGuTtllWaIjP0eKeY009qgxo4dFwgE0KMLvrXJKna1u90IcAXfZi FhBOLT+Zb77JTmt94vVAh8xcExxAtnD+6JxtyTlpvhn/KV0EWsmkaFFiCHkOYHH9PO VB5wEgobdT6/dMK6Jlssy3F3e8EvNnwifb669T9g= 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 12:19:32 +0100 Importance: normal Sensitivity: Normal In-Reply-To: <20201110111024.GA15992@tuxteam.de> X-UI-Message-Type: mail X-Priority: 3 X-Provags-ID: V03:K1:vqAjoaV+2q+pBt3jnC3zVIShj11VPQBcSf3pmOCEw7sPQZowzy+ZbrNuuHh/znQlpji7X 4FPSFNxAYDWroG72xkJIPCm5DcFcqLu/JsADqWNXm/Wd0I/FbhFVrZwqlNd3bs8Uiw/tzmSiEdAD sr8q3K0QjY/DWqOnlPwUGxIyQGAI/lPVR46jCLmvMbM28nhDIVANJzCGmEriYivKvoJbIzw40B9b e7ruossTRWNIiZCj1ZJ0CkQzy/0OpQCauN5ghbHmRIjjbwQkPcIGsnWJ7uFBDxAsN9QE4Qc5rWnZ Gg= X-UI-Out-Filterresults: notjunk:1;V03:K0:pXsAgDPiUpI=:Uf4eGu0EpguHrXy0BeCPJ1 9XUOEYht21WNvuRDoeWdaa//AtHN4MpwqbexBBaZjnDoyplsVtsnkZxls4rc8DjtvO4FDf5S6 MR3w8lgCONv3PZs7VZIDlMSIORPMrj3aYCXh2JYQ36nO9F5iRImmENM2shNGWVlfl/2b9gxgc DFO4Qfv3lZN9k7vk88i7ggTXyHAl2mkPhGcgIibktkernKKlrcudxIYWEnUq0QZvTAbnyI/fE goD1uxENTMNPqCchvCpGN5xHoMELRjMsciWN8pdQh7g3N6w9hsaheBvv83OSu1ksJ5YrRBSmz MhaZB/y3hCs37dSAEUThHI/ASmOxmQ1qGmin6mA3q61QDmRk/iBhbSaXRoEECKb9h0HZ5APhd mMpGuwvtf2pPQX4r/JMXH/U6bHyJShln5vEOUxLtd6e36YAE91/IEhO/Ip8Wog7EzAfw/QM0N CWj4LialKe3bUHLs4QjaB+/eWSXGwxAsN6EPob7msNT6P2mzuEt4aK4COoezIrZHdItT0Fw9C JReE+68DAXvMMxFhfAYi4EeH/qG2pzEU8HJMa9a7rzqCZzNiwiLM7sibE1p599yXmEkxecno+ HIjNFGMKcVuUU= Received-SPF: pass client-ip=212.227.17.22; envelope-from=dimech@gmx.com; helo=mout.gmx.net X-detected-operating-system: by eggs.gnu.org: First seen = 2020/11/10 06:19:43 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:125177 Archived-At: Hell, I started doing like this=2E Still a good exercise though=2E (defun comblock (rg-beg rg-end) "TODO" (interactive "r") (if (use-region-p) (progn (goto-char rg-beg) (beginning-of-line) (setq myLine (buffer-substring-no-properties (line-beginning-position) (line-end-position) )) (message "region active")) (message "region not active")) ) > Sent: Tuesday, November 10, 2020 at 12:10 PM > From: tomas@tuxteam=2Ede > To: help-gnu-emacs@gnu=2Eorg > Subject: Re: Adding String to Beginning of Lines > > On Tue, Nov 10, 2020 at 11:43:45AM +0100, Christopher Dimech wrote: > >=20 > > I have a paragraph and want to add a string to the beginning of each l= ine after selecting > > the paragraph region=2E > >=20 > > GNU is an operating system that is free software=E2=80=94that is, it r= espects users' freedom=2E The > > GNU operating system consists of GNU packages (programs specifically r= eleased by the GNU=20 > > Project) as well as free software released by third parties=2E The dev= elopment of GNU made > > it possible to use a computer without software that would trample your= freedom=2E > >=20 > > Example, passing ';; + ' as argument to a function to get > >=20 > > ;; + GNU is an operating system that is free software=E2=80=94that is,= it respects users' freedom=2E The > > ;; + GNU operating system consists of GNU packages (programs specifica= lly released by the GNU=20 > > ;; + Project) as well as free software released by third parties=2E Th= e development of GNU made > > ;; + it possible to use a computer without software that would trample= your freedom=2E >=20 > - Select the region > - M-x query-replace-regexp "^" =E2=86=92 ";; + " > - Profit! >=20 > Wrapping that up in a function is left as an exercise to the > reader :-) >=20 > Cheers > -- t >