From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Cecil Westerhof Newsgroups: gmane.emacs.help Subject: Re: Changing the Emacs engine to Guile Date: Tue, 22 Jun 2010 22:40:26 +0200 Organization: Decebal Computing Message-ID: <87hbkux0lh.fsf@linux-lqcw.site> References: <87fx0g2yu6.fsf@linux-lqcw.site> <87iq5cmjgp.fsf@fh-trier.de> <87y6e81d6f.fsf@linux-lqcw.site> <87mxuoumfb.fsf@kuiper.lan.informatimago.com> <878w671qvm.fsf@linux-lqcw.site> <87tyovtqc3.fsf@kuiper.lan.informatimago.com> <87d3vjz8jm.fsf@linux-lqcw.site> <87hbkvt1ra.fsf@kuiper.lan.informatimago.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: dough.gmane.org 1291838373 13743 80.91.229.12 (8 Dec 2010 19:59:33 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Wed, 8 Dec 2010 19:59:33 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Dec 08 20:59:24 2010 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1PQQAb-0002Vp-6B for geh-help-gnu-emacs@m.gmane.org; Wed, 08 Dec 2010 20:59:22 +0100 Original-Received: from localhost ([127.0.0.1]:58887 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PQQAa-0008W9-Hv for geh-help-gnu-emacs@m.gmane.org; Wed, 08 Dec 2010 14:59:20 -0500 Original-Path: usenet.stanford.edu!news.tele.dk!news.tele.dk!small.news.tele.dk!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Original-Newsgroups: gnu.emacs.help X-Homepage: http://www.decebal.nl/ User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) Cancel-Lock: sha1:TUAaEaOGlkIexiwJI5tNoJS3z88= Original-Lines: 29 Original-NNTP-Posting-Host: 84.53.123.169 Original-X-Trace: 1277239188 news.xs4all.nl 22940 decebal/[::ffff:84.53.123.169]:13526 Original-X-Complaints-To: abuse@xs4all.nl Original-Xref: usenet.stanford.edu gnu.emacs.help:179188 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:75937 Archived-At: Op dinsdag 22 jun 2010 19:28 CEST schreef Pascal J. Bourguignon: >>> this (while (re-search-forward ...)) loop modifies the line for each >>> occurence of the regexp, replacing it with (substring substitute-str 0 >>> match-length), which is a different replacement string in general. >> >> Why? I would think the replacement string is the same. (When using >> single byte characters.) > > With: > > substitute-str = "Abcdef" ; initally > start-match = 4 > end-match = 12 > match-length = 8 > > > substitute-str will become "AbcdefAbcdef", > and (substring substitute-str 0 match-length) = "AbcdefAb" > while (substring substitute-str start-match end-match) = "efAbcdef" I made a stupid mistake. It did not show because I only changed a substring at the start of the line. Better code is at: http://www.decebal.nl/guile/sources/substituteExpression.scm -- Cecil Westerhof Senior Software Engineer LinkedIn: http://www.linkedin.com/in/cecilwesterhof