* Macro aborts even though regexp instance exists - Serious Bug
@ 2012-10-22 20:40 Swami Tota Ram Shankar
2012-10-24 3:54 ` Kevin Rodgers
[not found] ` <mailman.11579.1351050855.855.help-gnu-emacs@gnu.org>
0 siblings, 2 replies; 8+ messages in thread
From: Swami Tota Ram Shankar @ 2012-10-22 20:40 UTC (permalink / raw)
To: help-gnu-emacs
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.
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.
I include more newsgroups because of the seriousness of this bug.
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Macro aborts even though regexp instance exists - Serious Bug
2012-10-22 20:40 Macro aborts even though regexp instance exists - Serious Bug Swami Tota Ram Shankar
@ 2012-10-24 3:54 ` Kevin Rodgers
[not found] ` <mailman.11579.1351050855.855.help-gnu-emacs@gnu.org>
1 sibling, 0 replies; 8+ messages in thread
From: Kevin Rodgers @ 2012-10-24 3:54 UTC (permalink / raw)
To: help-gnu-emacs
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
^ permalink raw reply [flat|nested] 8+ messages in thread
[parent not found: <mailman.11579.1351050855.855.help-gnu-emacs@gnu.org>]
* Re: Macro aborts even though regexp instance exists - Serious Bug
[not found] ` <mailman.11579.1351050855.855.help-gnu-emacs@gnu.org>
@ 2012-10-25 2:55 ` gnuist007
2012-11-30 21:57 ` David Combs
1 sibling, 0 replies; 8+ messages in thread
From: gnuist007 @ 2012-10-25 2:55 UTC (permalink / raw)
To: help-gnu-emacs
On Oct 23, 8:54 pm, Kevin Rodgers <kevin.d.rodg...@gmail.com> wrote:
> 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
thanks
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Macro aborts even though regexp instance exists - Serious Bug
[not found] ` <mailman.11579.1351050855.855.help-gnu-emacs@gnu.org>
2012-10-25 2:55 ` gnuist007
@ 2012-11-30 21:57 ` David Combs
2012-11-30 22:55 ` Dan Espen
1 sibling, 1 reply; 8+ messages in thread
From: David Combs @ 2012-11-30 21:57 UTC (permalink / raw)
To: help-gnu-emacs
In article <mailman.11579.1351050855.855.help-gnu-emacs@gnu.org>,
Kevin Rodgers <kevin.d.rodgers@gmail.com> wrote:
>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
>
>
(1) THANKS FOR THAT HINT/WARNING/INFO!
(2) "when a user is not aware of how to use a program": I don't know
that this thread really falls under that. Although your solution
and especially the reason for it "obvious" -- but only once you've
seen it. It's actually a little subtle.
AND I believe it's so important (and easy to get wrong) that
it should be added to the emacs manual (in macros) AND to
any much-used cheat-sheets -- plus the wiki, of course.
Perhaps you (as one of the real gurus around here) could write
a paragraph and example and ask the developers to put it into
the right places.
Thanks again for the pointer!
David
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Macro aborts even though regexp instance exists - Serious Bug
2012-11-30 21:57 ` David Combs
@ 2012-11-30 22:55 ` Dan Espen
2012-12-03 14:33 ` Doug Lewan
[not found] ` <mailman.14392.1354545130.855.help-gnu-emacs@gnu.org>
0 siblings, 2 replies; 8+ messages in thread
From: Dan Espen @ 2012-11-30 22:55 UTC (permalink / raw)
To: help-gnu-emacs
dkcombs@panix.com (David Combs) writes:
> In article <mailman.11579.1351050855.855.help-gnu-emacs@gnu.org>,
> Kevin Rodgers <kevin.d.rodgers@gmail.com> wrote:
>>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 :-)
>
> (1) THANKS FOR THAT HINT/WARNING/INFO!
>
> (2) "when a user is not aware of how to use a program": I don't know
> that this thread really falls under that. Although your solution
> and especially the reason for it "obvious" -- but only once you've
> seen it. It's actually a little subtle.
>
> AND I believe it's so important (and easy to get wrong) that
> it should be added to the emacs manual (in macros) AND to
> any much-used cheat-sheets -- plus the wiki, of course.
>
> Perhaps you (as one of the real gurus around here) could write
> a paragraph and example and ask the developers to put it into
> the right places.
A keyboard macro is terminated by anything that rings the bell.
I can't seem to find that in the emacs help though.
I would have expected to see it in "^h k M-x (".
Also, my bell hasn't rung in a long time, looking around, I have the
built in speaker disabled. So:
(setq ring-bell-function (lambda ()
(play-sound-file "/home/dan/audio/tap2.au")))
--
Dan Espen
^ permalink raw reply [flat|nested] 8+ messages in thread
* RE: Macro aborts even though regexp instance exists - Serious Bug
2012-11-30 22:55 ` Dan Espen
@ 2012-12-03 14:33 ` Doug Lewan
[not found] ` <mailman.14392.1354545130.855.help-gnu-emacs@gnu.org>
1 sibling, 0 replies; 8+ messages in thread
From: Doug Lewan @ 2012-12-03 14:33 UTC (permalink / raw)
To: Dan Espen, help-gnu-emacs@gnu.org
There's also the variable `visible-bell' if ringing the bell isn't appropriate for you.
,Doug
> -----Original Message-----
> From: help-gnu-emacs-bounces+dougl=shubertticketing.com@gnu.org
> [mailto:help-gnu-emacs-bounces+dougl=shubertticketing.com@gnu.org] On
> Behalf Of Dan Espen
> Sent: Friday, 2012 November 30 17:55
> To: help-gnu-emacs@gnu.org
> Subject: Re: Macro aborts even though regexp instance exists - Serious
> Bug
> ...
> A keyboard macro is terminated by anything that rings the bell.
>
> I can't seem to find that in the emacs help though.
> I would have expected to see it in "^h k M-x (".
>
> Also, my bell hasn't rung in a long time, looking around, I have the
> built in speaker disabled. So:
>
> (setq ring-bell-function (lambda ()
> (play-sound-file "/home/dan/audio/tap2.au")))
>
> --
> Dan Espen
^ permalink raw reply [flat|nested] 8+ messages in thread
[parent not found: <mailman.14392.1354545130.855.help-gnu-emacs@gnu.org>]
* Re: Macro aborts even though regexp instance exists - Serious Bug
[not found] ` <mailman.14392.1354545130.855.help-gnu-emacs@gnu.org>
@ 2012-12-03 16:22 ` Dan Espen
0 siblings, 0 replies; 8+ messages in thread
From: Dan Espen @ 2012-12-03 16:22 UTC (permalink / raw)
To: help-gnu-emacs
Doug Lewan <dougl@shubertticketing.com> writes:
>> -----Original Message-----
>> From: help-gnu-emacs-bounces+dougl=shubertticketing.com@gnu.org
>> [mailto:help-gnu-emacs-bounces+dougl=shubertticketing.com@gnu.org] On
>> Behalf Of Dan Espen
>> Sent: Friday, 2012 November 30 17:55
>> To: help-gnu-emacs@gnu.org
>> Subject: Re: Macro aborts even though regexp instance exists - Serious
>> Bug
>> ...
>> A keyboard macro is terminated by anything that rings the bell.
>>
>> I can't seem to find that in the emacs help though.
>> I would have expected to see it in "^h k M-x (".
>>
>> Also, my bell hasn't rung in a long time, looking around, I have the
>> built in speaker disabled. So:
>>
>> (setq ring-bell-function (lambda ()
>> (play-sound-file "/home/dan/audio/tap2.au")))
>>
> There's also the variable `visible-bell' if ringing the bell isn't
> appropriate for you.
Yes. tried it. Even adjusting the colors, I find it too jarring.
A low volume tapping sound fills the bill for me.
I miss the XEmacs feature which had sounds for each error type:
(setq sound-alist
(append
'((default :sound hammer)
(undefined-key :sound drum)
(undefined-click :sound drum)
(command-error :sound bass)
(no-completion :sound drip)
(y-or-n-p :sound slap)
(yes-or-no-p :sound yeep)
(isearch-failed :sound drum :volume 70)
(isearch-quit :sound yeep)
(auto-save-error :sound whip :volume 75))
sound-alist)))
--
Dan Espen
^ permalink raw reply [flat|nested] 8+ messages in thread
* Macro aborts even though regexp instance exists - Serious Bug
@ 2012-10-22 20:40 Swami Tota Ram Shankar
0 siblings, 0 replies; 8+ messages in thread
From: Swami Tota Ram Shankar @ 2012-10-22 20:40 UTC (permalink / raw)
To: bug-gnu-emacs
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.
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.
I include more newsgroups because of the seriousness of this bug.
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2012-12-03 16:22 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-10-22 20:40 Macro aborts even though regexp instance exists - Serious Bug Swami Tota Ram Shankar
2012-10-24 3:54 ` Kevin Rodgers
[not found] ` <mailman.11579.1351050855.855.help-gnu-emacs@gnu.org>
2012-10-25 2:55 ` gnuist007
2012-11-30 21:57 ` David Combs
2012-11-30 22:55 ` Dan Espen
2012-12-03 14:33 ` Doug Lewan
[not found] ` <mailman.14392.1354545130.855.help-gnu-emacs@gnu.org>
2012-12-03 16:22 ` Dan Espen
-- strict thread matches above, loose matches on Subject: below --
2012-10-22 20:40 Swami Tota Ram Shankar
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.