From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: gnuist007@hotmail.com Newsgroups: gmane.emacs.bugs Subject: save-excursion not working - despite NO-ERROR in search-forward-regexp Date: Tue, 23 Oct 2012 20:49:18 -0700 (PDT) Message-ID: <97bd72ac-9ff5-43f7-b1c4-c589a5bfe48f__33841.4041478702$1351050619$gmane$org@r6g2000yqd.googlegroups.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 X-Trace: ger.gmane.org 1351050610 3793 80.91.229.3 (24 Oct 2012 03:50:10 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 24 Oct 2012 03:50:10 +0000 (UTC) To: bug-gnu-emacs@gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Oct 24 05:50:18 2012 Return-path: Envelope-to: geb-bug-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 1TQrz0-00078Z-DR for geb-bug-gnu-emacs@m.gmane.org; Wed, 24 Oct 2012 05:50:18 +0200 Original-Received: from localhost ([::1]:38240 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TQrys-0001FA-RA for geb-bug-gnu-emacs@m.gmane.org; Tue, 23 Oct 2012 23:50:10 -0400 Original-Received: by 10.66.79.161 with SMTP id k1mr4356181pax.7.1351050558690; Tue, 23 Oct 2012 20:49:18 -0700 (PDT) Original-Received: by 10.236.116.67 with SMTP id f43mr1046832yhh.13.1351050558386; Tue, 23 Oct 2012 20:49:18 -0700 (PDT) Original-Path: usenet.stanford.edu!kr7no8956216pbb.0!news-out.google.com!s9ni21683pbb.0!nntp.google.com!kt20no8707326pbb.1!postnews.google.com!r6g2000yqd.googlegroups.com!not-for-mail Original-Newsgroups: gnu.emacs.help, comp.emacs, comp.unix.shell, gnu.emacs.gnus, gnu.emacs.bug Complaints-To: groups-abuse@google.com Injection-Info: r6g2000yqd.googlegroups.com; posting-host=99.61.86.87; posting-account=HZMwaQgAAABuThfluRZ4FM7A69xRFwOt Original-NNTP-Posting-Host: 99.61.86.87 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: Wed, 24 Oct 2012 03:49:18 +0000 Original-Xref: usenet.stanford.edu gnu.emacs.help:195055 comp.emacs:102649 comp.unix.shell:256050 gnu.emacs.gnus:87013 gnu.emacs.bug:92333 X-BeenThere: bug-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:65956 Archived-At: 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