help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: substring and search


From: Stephen Berman
Subject: Re: substring and search
Date: 29 Jan 2002 10:17:15 +0100
User-agent: Gnus/5.0808 (Gnus v5.8.8) Emacs/20.7

Greg Hill <ghill@synergymicro.com> writes:

> The 431 is the position in the current buffer of the "c" found by the
> search-forward command.

This I realized...

>                          The 7 is the length of the string "abcdefg". 

...but this I didn't; that was the source of my misunderstanding.

> The error message is trying to tell you that you are asking for the
> substring starting with the 431st character in a 7-character string,
> which obviously makes no sense.

Yes, now its clear to me.


> Apparently you are trying to use the substring function to do
> something it is not intended to do.  See section 4.3 of the GNU Emacs
> List Reference Manual for a description of the substring function and
> how it is intended to be used.

I had read the section in the Elisp manual, but unfortunately it
didn't disabuse me of my misunderstanding.

> What ARE you trying to do, anyway?  If you can tell us that, we can
> point you to the correct function.

As I mentioned in my response to Kai's answer in the newsgroup, I had
already found out that buffer-substring does what I want.  But I still
didn't understand why substring didn't work as I had expected it to.
Now I do; thanks.

--Steve Berman




reply via email to

[Prev in Thread] Current Thread [Next in Thread]