From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Doug Lewan Newsgroups: gmane.emacs.help Subject: RE: save-excursion not working - despite NO-ERROR in search-forward-regexp Date: Wed, 24 Oct 2012 12:53:05 +0000 Message-ID: <155DEC68569B714B86C2C7075F5EDA9826952832@DAKIYA1.pegasus.local> References: <97bd72ac-9ff5-43f7-b1c4-c589a5bfe48f@r6g2000yqd.googlegroups.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1351083142 6396 80.91.229.3 (24 Oct 2012 12:52:22 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 24 Oct 2012 12:52:22 +0000 (UTC) To: "gnuist007@hotmail.com" , "help-gnu-emacs@gnu.org" Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Oct 24 14:52:31 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 1TR0Rh-0005Nj-Ac for geh-help-gnu-emacs@m.gmane.org; Wed, 24 Oct 2012 14:52:29 +0200 Original-Received: from localhost ([::1]:49738 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TR0RZ-0007QB-Pk for geh-help-gnu-emacs@m.gmane.org; Wed, 24 Oct 2012 08:52:21 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:58687) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TR0RQ-0007PG-6h for help-gnu-emacs@gnu.org; Wed, 24 Oct 2012 08:52:17 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TR0RP-0000DZ-1l for help-gnu-emacs@gnu.org; Wed, 24 Oct 2012 08:52:12 -0400 Original-Received: from webmail.shubertorg.com ([207.246.209.200]:45418) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TR0RO-0000DL-U5 for help-gnu-emacs@gnu.org; Wed, 24 Oct 2012 08:52:10 -0400 Original-Received: from dakiya1.pegasus.local ([::1]) by DAKIYA1.pegasus.local ([::1]) with mapi id 14.01.0339.001; Wed, 24 Oct 2012 08:53:06 -0400 Thread-Topic: save-excursion not working - despite NO-ERROR in search-forward-regexp Thread-Index: AQHNsZrU4qOYkvil6UK+UL0R/4gT/JfIaMKQ In-Reply-To: <97bd72ac-9ff5-43f7-b1c4-c589a5bfe48f@r6g2000yqd.googlegroups.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.0.21.202] X-detected-operating-system: by eggs.gnu.org: Windows XP/2000 (RFC1323+, w+, tstamp-) X-Received-From: 207.246.209.200 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:87392 Archived-At: Gnuist, I think the problem is your use of (end-of-buffer) which is a function of m= otion, not location. It's *info* documentation also has this note: `*Warnin= g:* 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.com@gnu.org > [mailto:help-gnu-emacs-bounces+dougl=3Dshubertticketing.com@gnu.org] On > Behalf Of gnuist007@hotmail.com > Sent: Tuesday, 2012 October 23 23:49 > To: help-gnu-emacs@gnu.org > Subject: save-excursion not working - despite NO-ERROR in search- > forward-regexp >=20 > Hello Everyone, >=20 > 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. >=20 > (save-excursion > (while > (search-forward-regexp (regexp-quote "does nott existt inn this > file") (end-of-buffer) t) > (message "first") > )) >=20 > 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. >=20 > gnuist >=20 >=20