unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* Keyboard macro and regexp syntax search
@ 2007-12-20 20:44 spamfilteraccount
  2007-12-20 21:20 ` Tyler Smith
  2007-12-20 21:45 ` Lennart Borgman (gmail)
  0 siblings, 2 replies; 4+ messages in thread
From: spamfilteraccount @ 2007-12-20 20:44 UTC (permalink / raw)
  To: help-gnu-emacs

Here's a key sequence which searches a whitespace character with a non-
whitespace character after it and moves right to terminate the search
there (just an example):

M-C-s	\s-\S- <right>


According to the macro editor it is recorded like this:

;; Keyboard Macro Editor.  Press C-c C-c to finish; press C-x k RET to
cancel.
;; Original keys: M-C-s \ s \ S <right>

Command: last-kbd-macro
Key: none

Macro:

M-C-s			;; isearch-forward-regexp
\			;; self-insert-command
s			;; self-insert-command
\			;; self-insert-command
S			;; self-insert-command
<right>			;; forward-char-nomark



The dash (-) character is missing after the syntax matcher (\s and
\S), so the macro doesn't work at playback. Is it a bug?

GNU Emacs 22.1.1 (i386-mingw-nt5.1.2600) of 2007-06-02 on RELEASE

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Keyboard macro and regexp syntax search
  2007-12-20 20:44 Keyboard macro and regexp syntax search spamfilteraccount
@ 2007-12-20 21:20 ` Tyler Smith
  2007-12-20 21:40   ` spamfilteraccount
  2007-12-20 21:45 ` Lennart Borgman (gmail)
  1 sibling, 1 reply; 4+ messages in thread
From: Tyler Smith @ 2007-12-20 21:20 UTC (permalink / raw)
  To: help-gnu-emacs

On 2007-12-20, spamfilteraccount@gmail.com <spamfilteraccount@gmail.com> wrote:
> Here's a key sequence which searches a whitespace character with a non-
> whitespace character after it and moves right to terminate the search
> there (just an example):
>
> M-C-s	\s-\S- <right>
>
>
> According to the macro editor it is recorded like this:
>
> ;; Keyboard Macro Editor.  Press C-c C-c to finish; press C-x k RET to
> cancel.
> ;; Original keys: M-C-s \ s \ S <right>
>
> Command: last-kbd-macro
> Key: none
>
> Macro:
>
> M-C-s			;; isearch-forward-regexp
> \			;; self-insert-command
> s			;; self-insert-command
> \			;; self-insert-command
> S			;; self-insert-command
><right>			;; forward-char-nomark
>
>
>
> The dash (-) character is missing after the syntax matcher (\s and
> \S), so the macro doesn't work at playback. Is it a bug?
>
> GNU Emacs 22.1.1 (i386-mingw-nt5.1.2600) of 2007-06-02 on RELEASE

It works as expected for me, running Emacs 22.1.1:

;; Keyboard Macro Editor.  Press C-c C-c to finish; press C-x k RET to cancel.
;; Original keys: M-C-s \ s- \ S- <right>

Command: last-kbd-macro
Key: none

Macro:

M-C-s			;; isearch-forward-regexp
\			;; self-insert-command
s-			;; self-insert-command * 2
\			;; self-insert-command
S-			;; self-insert-command * 2
<right>			;; forward-char

Can you reproduce the problem when you launch Emacs with no init files
(i.e., emacs -Q)?

Tyler

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Keyboard macro and regexp syntax search
  2007-12-20 21:20 ` Tyler Smith
@ 2007-12-20 21:40   ` spamfilteraccount
  0 siblings, 0 replies; 4+ messages in thread
From: spamfilteraccount @ 2007-12-20 21:40 UTC (permalink / raw)
  To: help-gnu-emacs

On Dec 20, 10:20 pm, Tyler Smith <tyler.sm...@mail.mcgill.ca> wrote:
>
> Can you reproduce the problem when you launch Emacs with no init files
> (i.e., emacs -Q)?
>

Yes. It seems the i-search and dash interaction is problematic. A
simple macro for searching for a dash:

;; Keyboard Macro Editor.  Press C-c C-c to finish; press C-x k RET to
cancel.
;; Original keys: C-s <right>

Command: last-kbd-macro
Key: none

Macro:

C-s			;; isearch-forward
<right>			;; forward-char

The dash is missing after C-s.


A macro which inserts a dash character into the buffer works. I tested
it.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Keyboard macro and regexp syntax search
  2007-12-20 20:44 Keyboard macro and regexp syntax search spamfilteraccount
  2007-12-20 21:20 ` Tyler Smith
@ 2007-12-20 21:45 ` Lennart Borgman (gmail)
  1 sibling, 0 replies; 4+ messages in thread
From: Lennart Borgman (gmail) @ 2007-12-20 21:45 UTC (permalink / raw)
  Cc: help-gnu-emacs

spamfilteraccount@gmail.com wrote:
> Here's a key sequence which searches a whitespace character with a non-
> whitespace character after it and moves right to terminate the search
> there (just an example):
> 
> M-C-s	\s-\S- <right>
> 
> 
> According to the macro editor it is recorded like this:
> 
> ;; Keyboard Macro Editor.  Press C-c C-c to finish; press C-x k RET to
> cancel.
> ;; Original keys: M-C-s \ s \ S <right>
> 
> Command: last-kbd-macro
> Key: none
> 
> Macro:
> 
> M-C-s			;; isearch-forward-regexp
> \			;; self-insert-command
> s			;; self-insert-command
> \			;; self-insert-command
> S			;; self-insert-command
> <right>			;; forward-char-nomark
> 
> 
> 
> The dash (-) character is missing after the syntax matcher (\s and
> \S), so the macro doesn't work at playback. Is it a bug?
> 
> GNU Emacs 22.1.1 (i386-mingw-nt5.1.2600) of 2007-06-02 on RELEASE


Looks like it, but please try starting from

   emacs -Q

If the problem persists then report it as a bug.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2007-12-20 21:45 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-12-20 20:44 Keyboard macro and regexp syntax search spamfilteraccount
2007-12-20 21:20 ` Tyler Smith
2007-12-20 21:40   ` spamfilteraccount
2007-12-20 21:45 ` Lennart Borgman (gmail)

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).