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

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

Re: save-excursion not working - despite NO-ERROR in search-forward-rege


From: gnuist007
Subject: Re: save-excursion not working - despite NO-ERROR in search-forward-regexp
Date: Wed, 24 Oct 2012 19:54:55 -0700 (PDT)
User-agent: G2/1.0

On Oct 24, 5:52 am, Doug Lewan <do...@shubertticketing.com> wrote:
> Gnuist,
>
> I think the problem is your use of (end-of-buffer) which is a function of 
> motion, not location. It's *info* documentation also has this note: 
> `*Warning:* Don't use this function in Lisp programs!'.
>
> Try using (point-max) instead.
>
> I hope this helps.
>
> ,Doug
>
>
>
>
>
>
>
> > -----Original Message-----
> > From: help-gnu-emacs-bounces+dougl=shubertticketing....@gnu.org
> > [mailto:help-gnu-emacs-bounces+dougl=shubertticketing....@gnu.org] On
> > Behalf Of gnuist...@hotmail.com
> > Sent: Tuesday, 2012 October 23 23:49
> > To: help-gnu-em...@gnu.org
> > Subject: save-excursion not working - despite NO-ERROR in search-
> > forward-regexp
>
> > Hello Everyone,
>
> > I am trying to search some regular expressions in a file and then to
> > do some manipulations represented for now by a message only. I want to
> > go till the eob and then dont want to hit error, so I have a t for NO-
> > ERROR. However, I also want the cursor ie point to return where I
> > started from, ie did C-x C-e, but I see that the cursor gets stuck
> > somewhere else, a little above the eob, even though its wrapped in
> > save-excursion. This is driving me crazy so please help me.
>
> > (save-excursion
> >   (while
> >       (search-forward-regexp (regexp-quote "does nott existt inn this
> > file") (end-of-buffer) t)
> >   (message "first")
> > ))
>
> > If you have a better suggestion, I shall be glad to have it, but I
> > also want someone to show a fix to the one I have posted.
>
> > gnuist

Thanks


reply via email to

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