all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@iro.umontreal.ca>
To: bug-gnu-emacs@gnu.org
Subject: Re: Macro aborts even though regexp instance exists
Date: Wed, 24 Oct 2012 11:23:56 -0400	[thread overview]
Message-ID: <jwvpq47gaxu.fsf-monnier+gnu.emacs.help@gnu.org> (raw)
In-Reply-To: 78ea1d8e-420f-411c-a793-fd69eb049489@3g2000yqn.googlegroups.com

> 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


  parent reply	other threads:[~2012-10-24 15:23 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-22 20:39 Macro aborts even though regexp instance exists Swami Tota Ram Shankar
2012-10-24 15:23 ` Stefan Monnier
2012-10-24 15:23 ` Stefan Monnier [this message]
2012-10-24 16:00   ` bug#12722: " Andreas Schwab
2012-10-24 16:17     ` Glenn Morris
  -- strict thread matches above, loose matches on Subject: below --
2012-10-22 20:39 Swami Tota Ram Shankar

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=jwvpq47gaxu.fsf-monnier+gnu.emacs.help@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --cc=bug-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.