all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Introducing a regexp in a docstring brings up M-x
@ 2024-07-13 16:36 Heime
  2024-07-13 22:52 ` Stephen Berman
  0 siblings, 1 reply; 2+ messages in thread
From: Heime @ 2024-07-13 16:36 UTC (permalink / raw)
  To: Heime via Users list for the GNU Emacs text editor

I have introduced the following in the function docstring

1. First Capturing Group \*\\(\\s-*\\[\\-\\]\\s-*\\)\*

Why do I get M-x cropping up ?

1. First Capturing Group "\(\s-*\M-x \-\\\s-*\)"



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

* Re: Introducing a regexp in a docstring brings up M-x
  2024-07-13 16:36 Introducing a regexp in a docstring brings up M-x Heime
@ 2024-07-13 22:52 ` Stephen Berman
  0 siblings, 0 replies; 2+ messages in thread
From: Stephen Berman @ 2024-07-13 22:52 UTC (permalink / raw)
  To: Heime; +Cc: Heime via Users list for the GNU Emacs text editor

On Sat, 13 Jul 2024 16:36:05 +0000 Heime <heimeborgia@protonmail.com> wrote:

> I have introduced the following in the function docstring
>
> 1. First Capturing Group \*\\(\\s-*\\[\\-\\]\\s-*\\)\*
>
> Why do I get M-x cropping up ?
>
> 1. First Capturing Group "\(\s-*\M-x \-\\\s-*\)"

This is because in doc strings the string "\\[COMMAND]" is converted by
substitute-command-keys either into the key sequence bound to COMMAND or
else into "M-x COMMAND", as in your case.  To avoid this, use the escape
sequence "\\=": "1. First Capturing Group \\(\\s-*\\=\\[\\-\\]\\s-*\\)".

Steve Berman



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

end of thread, other threads:[~2024-07-13 22:52 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-07-13 16:36 Introducing a regexp in a docstring brings up M-x Heime
2024-07-13 22:52 ` Stephen Berman

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.