From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.help Subject: Re: Macro aborts even though regexp instance exists Date: Wed, 24 Oct 2012 11:23:56 -0400 Organization: A noiseless patient Spider Message-ID: References: <78ea1d8e-420f-411c-a793-fd69eb049489@3g2000yqn.googlegroups.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1351092320 30687 80.91.229.3 (24 Oct 2012 15:25:20 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 24 Oct 2012 15:25:20 +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 17:25:28 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 1TR2pd-0008SM-PL for geh-help-gnu-emacs@m.gmane.org; Wed, 24 Oct 2012 17:25:21 +0200 Original-Received: from localhost ([::1]:51618 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TR2pV-0001ho-NJ for geh-help-gnu-emacs@m.gmane.org; Wed, 24 Oct 2012 11:25:13 -0400 Original-Path: usenet.stanford.edu!news.tele.dk!news.tele.dk!small.news.tele.dk!proxad.net!feeder1-2.proxad.net!feeder.erje.net!eternal-september.org!feeder.eternal-september.org!mx04.eternal-september.org!.POSTED!not-for-mail Original-Newsgroups: gnu.emacs.help,comp.emacs,gnu.emacs.bug Original-Lines: 30 Injection-Info: mx04.eternal-september.org; posting-host="9b718dca22ff4598baab0f6e08a1d03d"; logging-data="10599"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/4h7XQnS8HwctT6/td2Swp" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.1.50 (gnu/linux) Cancel-Lock: sha1:quydHYoiZq8AFNgjwmw9nI4UacE= sha1:6I0bmnqN67f67lU3m6cX27FD3Gs= Original-Xref: usenet.stanford.edu gnu.emacs.help:195067 comp.emacs:102651 gnu.emacs.bug:92353 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:87396 Archived-At: > 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. [...] > to the original position when OR is entered and proceeds forward from > there, but perhaps, the macro aborts. Indeed, that's a problem: the macro aborts because macros abort not only on error but also when `ding' is called. > Any solutions? You can work around the problem in this particular case as follows: first do C-s M-r ONE\|TWO RET, and then record your macro using C-u C-s C-s to recall the last regexp used, so it gets inserted "all at once" without going through the problematic intermediate state (which is not when it gets to \ but rather when it gets to ON or ONE and it doesn't match anything). Maybe isearch-search shouldn't call ding when the match fails and we're matching regexps (and the match failed because of a new char being added to search regexp, rather than because the user hit C-s to jump to the next match). Please M-x report-emacs-bug, Stefan