From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Kevin Rodgers Newsgroups: gmane.emacs.help Subject: Re: Macro aborts even though regexp instance exists - Serious Bug Date: Tue, 23 Oct 2012 21:54:19 -0600 Message-ID: References: <08df09b8-18cc-4d23-9f2e-b1187f4cfdec__5446.52010216868$1350938726$gmane$org@g8g2000yqp.googlegroups.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1351050858 5325 80.91.229.3 (24 Oct 2012 03:54:18 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 24 Oct 2012 03:54:18 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Oct 24 05:54:26 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 1TQs2z-00014N-W7 for geh-help-gnu-emacs@m.gmane.org; Wed, 24 Oct 2012 05:54:26 +0200 Original-Received: from localhost ([::1]:40954 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TQs2s-0002sd-Dr for geh-help-gnu-emacs@m.gmane.org; Tue, 23 Oct 2012 23:54:18 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:44473) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TQs2n-0002s8-LJ for help-gnu-emacs@gnu.org; Tue, 23 Oct 2012 23:54:14 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TQs2m-0002SS-Mj for help-gnu-emacs@gnu.org; Tue, 23 Oct 2012 23:54:13 -0400 Original-Received: from plane.gmane.org ([80.91.229.3]:52575) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TQs2m-0002SL-FU for help-gnu-emacs@gnu.org; Tue, 23 Oct 2012 23:54:12 -0400 Original-Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1TQs2m-0000xP-HU for help-gnu-emacs@gnu.org; Wed, 24 Oct 2012 05:54:12 +0200 Original-Received: from c-71-237-25-24.hsd1.co.comcast.net ([71.237.25.24]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 24 Oct 2012 05:54:12 +0200 Original-Received: from kevin.d.rodgers by c-71-237-25-24.hsd1.co.comcast.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 24 Oct 2012 05:54:12 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 51 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: c-71-237-25-24.hsd1.co.comcast.net User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.4; en-US; rv:1.9.2.28) Gecko/20120306 Thunderbird/3.1.20 In-Reply-To: <08df09b8-18cc-4d23-9f2e-b1187f4cfdec__5446.52010216868$1350938726$gmane$org@g8g2000yqp.googlegroups.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 80.91.229.3 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:87385 Archived-At: On 10/22/12 2:40 PM, Swami Tota Ram Shankar wrote: > Hi emacs users, > > I write a simple macro which works, however, it fails in a particular > case. > > C-s > M-r > > to get into isearch-forward-regexp > > and give a regexp like > > ONE\|TWO > > It works for every TWO and ONE as long as there is a ONE ahead of TWO. > In the last instance, no ONE exists after TWO and it fails. > > \|<=> OR or disjunction. > > Any solutions? > > This is such a fundamental issue that I think its a bug. When the C-s > M-r is used outside the macro definition, the cursor gladly returns > to the original position when OR is entered and proceeds forward from > there, but perhaps, the macro aborts. It is not a bug: when ONE fails to match the buffer, C-s (which is designed for interactive use, obviously) signals an error, which terminates the macro execution. That's because there is no way for C-s to know that you _might_ type \|TWO after ONE. So the solution is to make sure that the regexp is not complete after ONE: C-s \(ONE\|TWO\) > I guess, this can lead to a lot of confusion and time wastage, if the > user is unaware of this and most likely to neglect it because its > contrary to normal usage. Yes, there is a lot of confusion and wasted time when a user is not aware of how to use a program. > I include more newsgroups because of the seriousness of this bug. Whatever :-) -- Kevin Rodgers Denver, Colorado, USA