info-gnus-english
[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: Kevin Brubeck Unhammer
Subject: Re: save-excursion not working - despite NO-ERROR in search-forward-regexp
Date: Wed, 24 Oct 2012 10:24:31 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.2 (gnu/linux)

gnuist007@hotmail.com writes:

> 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)

1. When I try this code, point does not move (save-excursion seems to
work for me, I'm running emacs 24.2.1).

2. `end-of-buffer' moves point to end of buffer, I think you want
`point-max'.


-- 
Kevin Brubeck Unhammer

GPG: 0x766AC60C




reply via email to

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