From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: gnuist007@hotmail.com Newsgroups: gmane.emacs.help Subject: Re: save-excursion not working - despite NO-ERROR in search-forward-regexp Date: Wed, 24 Oct 2012 19:54:55 -0700 (PDT) Message-ID: References: <97bd72ac-9ff5-43f7-b1c4-c589a5bfe48f@r6g2000yqd.googlegroups.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1351133721 23671 80.91.229.3 (25 Oct 2012 02:55:21 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 25 Oct 2012 02:55:21 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Oct 25 04:55:30 2012 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1TRDbW-0003js-4e for geh-help-gnu-emacs@m.gmane.org; Thu, 25 Oct 2012 04:55:30 +0200 Original-Received: from localhost ([::1]:56275 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TRDbO-0003A1-9I for geh-help-gnu-emacs@m.gmane.org; Wed, 24 Oct 2012 22:55:22 -0400 Original-Received: by 10.224.97.199 with SMTP id m7mr5011927qan.5.1351133695179; Wed, 24 Oct 2012 19:54:55 -0700 (PDT) Original-Received: by 10.236.183.163 with SMTP id q23mr1824346yhm.19.1351133695154; Wed, 24 Oct 2012 19:54:55 -0700 (PDT) Original-Path: usenet.stanford.edu!x14no7318014qar.0!news-out.google.com!r17ni57592152qap.0!nntp.google.com!x14no7318011qar.0!postnews.google.com!r6g2000yqd.googlegroups.com!not-for-mail Original-Newsgroups: gnu.emacs.help Complaints-To: groups-abuse@google.com Injection-Info: r6g2000yqd.googlegroups.com; posting-host=99.42.78.5; posting-account=HZMwaQgAAABuThfluRZ4FM7A69xRFwOt Original-NNTP-Posting-Host: 99.42.78.5 User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (Windows NT 5.1; rv:12.0) Gecko/20100101 Firefox/12.0,gzip(gfe) Injection-Date: Thu, 25 Oct 2012 02:54:55 +0000 Original-Xref: usenet.stanford.edu gnu.emacs.help:195083 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:87412 Archived-At: On Oct 24, 5:52=A0am, Doug Lewan 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: `*Warn= ing:* 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=3Dshubertticketing....@gnu.org > > [mailto:help-gnu-emacs-bounces+dougl=3Dshubertticketing....@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 > > =A0 (while > > =A0 =A0 =A0 (search-forward-regexp (regexp-quote "does nott existt inn = this > > file") (end-of-buffer) t) > > =A0 (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