From: Cecil Westerhof <Cecil@decebal.nl>
To: help-gnu-emacs@gnu.org
Subject: Re: Changing the Emacs engine to Guile
Date: Tue, 22 Jun 2010 22:40:26 +0200 [thread overview]
Message-ID: <87hbkux0lh.fsf@linux-lqcw.site> (raw)
In-Reply-To: 87hbkvt1ra.fsf@kuiper.lan.informatimago.com
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
next prev parent reply other threads:[~2010-06-22 20:40 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <87fx0g2yu6.fsf@linux-lqcw.site>
[not found] ` <87iq5cmjgp.fsf@fh-trier.de>
2010-06-21 16:40 ` Changing the Emacs engine to Guile Andreas Politz
[not found] ` <87y6e81d6f.fsf@linux-lqcw.site>
2010-06-21 21:04 ` Pascal J. Bourguignon
[not found] ` <878w671qvm.fsf@linux-lqcw.site>
2010-06-22 8:38 ` Pascal J. Bourguignon
2010-06-22 10:05 ` Cecil Westerhof
2010-06-22 17:28 ` Pascal J. Bourguignon
2010-06-22 20:40 ` Cecil Westerhof [this message]
2010-06-21 19:22 ` Cecil Westerhof
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87hbkux0lh.fsf@linux-lqcw.site \
--to=cecil@decebal.nl \
--cc=help-gnu-emacs@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.