* Printing \\= in the docstring
[not found] <WOGXhoHXi-ghoVidse8cDwgfvmLUKIRqLxBwbF97alGfbnXgAISYEy9GKfzTC6yCqxaCn4Yjks7lzl_bTZyEuhIv91aWowm9r3whjcWlmz0=@protonmail.com>
@ 2024-07-15 22:43 ` Heime
2024-07-15 23:10 ` Stephen Berman
0 siblings, 1 reply; 7+ messages in thread
From: Heime @ 2024-07-15 22:43 UTC (permalink / raw)
To: Heime, Heime via Users list for the GNU Emacs text editor
On Tuesday, July 16th, 2024 at 9:22 AM, Heime <heimeborgia@protonmail.com> wrote:
> How can I print \\= in the docstring ?
When I try \\= the = does not display. Neither does \\\\= or \\\=
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Printing \\= in the docstring
2024-07-15 22:43 ` Printing \\= in the docstring Heime
@ 2024-07-15 23:10 ` Stephen Berman
2024-07-16 8:20 ` Heime
0 siblings, 1 reply; 7+ messages in thread
From: Stephen Berman @ 2024-07-15 23:10 UTC (permalink / raw)
To: Heime; +Cc: Heime via Users list for the GNU Emacs text editor
On Mon, 15 Jul 2024 22:43:26 +0000 Heime <heimeborgia@protonmail.com> wrote:
> On Tuesday, July 16th, 2024 at 9:22 AM, Heime <heimeborgia@protonmail.com> wrote:
>
>> How can I print \\= in the docstring ?
>
> When I try \\= the = does not display. Neither does \\\\= or \\\=
To print the sequence "\\=" as a string but not as a doc string escape
sequence, using "\\\\=" does work. But if you want to print it in the
context of a doc string escape sequence, you have to double it, just
like you have to double "\" in normal Lisp strings. For example, this
in a doc string:
"\\\\=\\=\\=`\\(\\s-\\\\=\\=\\=\\[\\-\\]\\s-\\)\\(.*\\) uses \\\\="
appears like this in a "*Help*" buffer:
\\=`\(\s-\\=\[\-\]\s-\)\(.*\) uses \\=
Steve Berman
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Printing \\= in the docstring
2024-07-15 23:10 ` Stephen Berman
@ 2024-07-16 8:20 ` Heime
2024-07-16 8:25 ` Stephen Berman
0 siblings, 1 reply; 7+ messages in thread
From: Heime @ 2024-07-16 8:20 UTC (permalink / raw)
To: Stephen Berman; +Cc: Heime via Users list for the GNU Emacs text editor
On Tuesday, July 16th, 2024 at 11:10 AM, Stephen Berman <stephen.berman@gmx.net> wrote:
> On Mon, 15 Jul 2024 22:43:26 +0000 Heime heimeborgia@protonmail.com wrote:
>
> > On Tuesday, July 16th, 2024 at 9:22 AM, Heime heimeborgia@protonmail.com wrote:
> >
> > > How can I print \\= in the docstring ?
> >
> > When I try \\= the = does not display. Neither does \\\\= or \\\=
>
>
> To print the sequence "\\=" as a string but not as a doc string escape
> sequence, using "\\\\=" does work. But if you want to print it in the
> context of a doc string escape sequence, you have to double it, just
> like you have to double "\" in normal Lisp strings. For example, this
> in a doc string:
>
> "\\\\=\\=\\=`\\\\(\\\\s-\\\\\\\\=\\\\=\\\\=\\\\[\\\\-\\\\]\\\\s-\\\\)\\\\(.*\\\\) uses \\\\\\\\=" appears like this in a "*Help*" buffer: \\\\=`\(\s-\\=\[\-\]\s-\)\(.*\) uses \\=
>
> Steve Berman
If I use "\\\\=" the only thing that is displayed is "\" when using "C-h v myvar".
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Printing \\= in the docstring
2024-07-16 8:20 ` Heime
@ 2024-07-16 8:25 ` Stephen Berman
2024-07-16 8:32 ` Heime
0 siblings, 1 reply; 7+ messages in thread
From: Stephen Berman @ 2024-07-16 8:25 UTC (permalink / raw)
To: Heime; +Cc: Heime via Users list for the GNU Emacs text editor
On Tue, 16 Jul 2024 08:20:05 +0000 Heime <heimeborgia@protonmail.com> wrote:
> On Tuesday, July 16th, 2024 at 11:10 AM, Stephen Berman
> <stephen.berman@gmx.net> wrote:
>
>> On Mon, 15 Jul 2024 22:43:26 +0000 Heime heimeborgia@protonmail.com wrote:
>>
>> > On Tuesday, July 16th, 2024 at 9:22 AM, Heime heimeborgia@protonmail.com wrote:
>> >
>> > > How can I print \\= in the docstring ?
>> >
>> > When I try \\= the = does not display. Neither does \\\\= or \\\=
>>
>>
>> To print the sequence "\\=" as a string but not as a doc string escape
>> sequence, using "\\\\=" does work. But if you want to print it in the
>> context of a doc string escape sequence, you have to double it, just
>> like you have to double "\" in normal Lisp strings. For example, this
>> in a doc string:
>>
>> "\\\\=\\=\\=`\\\\(\\\\s-\\\\\\\\=\\\\=\\\\=\\\\[\\\\-\\\\]\\\\s-\\\\)\\\\(.*\\\\)
>> uses \\\\\\\\=" appears like this in a "*Help*" buffer:
>> \\\\=`\(\s-\\=\[\-\]\s-\)\(.*\) uses \\=
>>
>> Steve Berman
>
> If I use "\\\\=" the only thing that is displayed is "\" when using "C-h v myvar".
It works in the example I gave just above. As so often you have not
provided a complete reproducer, so I can only try to guess why what you
did does not work. But I won't guess now.
Steve Berman
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Printing \\= in the docstring
2024-07-16 8:25 ` Stephen Berman
@ 2024-07-16 8:32 ` Heime
2024-07-16 8:49 ` Stephen Berman
0 siblings, 1 reply; 7+ messages in thread
From: Heime @ 2024-07-16 8:32 UTC (permalink / raw)
To: Stephen Berman; +Cc: Heime via Users list for the GNU Emacs text editor
Sent with Proton Mail secure email.
On Tuesday, July 16th, 2024 at 8:25 PM, Stephen Berman <stephen.berman@gmx.net> wrote:
> On Tue, 16 Jul 2024 08:20:05 +0000 Heime heimeborgia@protonmail.com wrote:
>
> > On Tuesday, July 16th, 2024 at 11:10 AM, Stephen Berman
> > stephen.berman@gmx.net wrote:
> >
> > > On Mon, 15 Jul 2024 22:43:26 +0000 Heime heimeborgia@protonmail.com wrote:
> > >
> > > > On Tuesday, July 16th, 2024 at 9:22 AM, Heime heimeborgia@protonmail.com wrote:
> > > >
> > > > > How can I print \\= in the docstring ?
> > > >
> > > > When I try \\= the = does not display. Neither does \\\\= or \\\=
> > >
> > > To print the sequence "\\=" as a string but not as a doc string escape
> > > sequence, using "\\\\=" does work. But if you want to print it in the
> > > context of a doc string escape sequence, you have to double it, just
> > > like you have to double "\" in normal Lisp strings. For example, this
> > > in a doc string:
> > >
> > > "\\\\=\\=\\=`\\\\\\\\(\\\\\\\\s-\\\\\\\\\\\\\\\\=\\\\\\\\=\\\\\\\\=\\\\\\\\[\\\\\\\\-\\\\\\\\]\\\\\\\\s-\\\\\\\\)\\\\\\\\(.*\\\\\\\\) uses \\\\\\\\\\\\\\\\=" appears like this in a "*Help*" buffer: \\\\\\\\=`\(\s-\\=\[\-\]\s-\)\(.*\) uses \\=
> > >
> > > Steve Berman
> >
> > If I use "\\\\=" the only thing that is displayed is "\" when using "C-h v myvar".
>
>
> It works in the example I gave just above. As so often you have not
> provided a complete reproducer, so I can only try to guess why what you
> did does not work. But I won't guess now.
>
> Steve Berman
(defconst mydocstring ""
"In the docstring, apply the escape sequence \\\\= to stop conversion by
`substitute-command-keys'."
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Printing \\= in the docstring
2024-07-16 8:32 ` Heime
@ 2024-07-16 8:49 ` Stephen Berman
2024-07-16 10:56 ` Stephen Berman
0 siblings, 1 reply; 7+ messages in thread
From: Stephen Berman @ 2024-07-16 8:49 UTC (permalink / raw)
To: Heime; +Cc: Heime via Users list for the GNU Emacs text editor
On Tue, 16 Jul 2024 08:32:36 +0000 Heime <heimeborgia@protonmail.com> wrote:
> Sent with Proton Mail secure email.
>
> On Tuesday, July 16th, 2024 at 8:25 PM, Stephen Berman
> <stephen.berman@gmx.net> wrote:
>
>> On Tue, 16 Jul 2024 08:20:05 +0000 Heime heimeborgia@protonmail.com wrote:
>>
>> > On Tuesday, July 16th, 2024 at 11:10 AM, Stephen Berman
>> > stephen.berman@gmx.net wrote:
>> >
>> > > On Mon, 15 Jul 2024 22:43:26 +0000 Heime heimeborgia@protonmail.com wrote:
>> > >
>> > > > On Tuesday, July 16th, 2024 at 9:22 AM, Heime
>> > > > heimeborgia@protonmail.com wrote:
>> > > >
>> > > > > How can I print \\= in the docstring ?
>> > > >
>> > > > When I try \\= the = does not display. Neither does \\\\= or \\\=
>> > >
>> > > To print the sequence "\\=" as a string but not as a doc string escape
>> > > sequence, using "\\\\=" does work. But if you want to print it in the
>> > > context of a doc string escape sequence, you have to double it, just
>> > > like you have to double "\" in normal Lisp strings. For example, this
>> > > in a doc string:
>> > >
>> > > "\\\\=\\=\\=`\\\\\\\\(\\\\\\\\s-\\\\\\\\\\\\\\\\=\\\\\\\\=\\\\\\\\=\\\\\\\\[\\\\\\\\-\\\\\\\\]\\\\\\\\s-\\\\\\\\)\\\\\\\\(.*\\\\\\\\)
>> > > uses \\\\\\\\\\\\\\\\=" appears like this in a "*Help*" buffer:
>> > > \\\\\\\\=`\(\s-\\=\[\-\]\s-\)\(.*\) uses \\=
>> > >
>> > > Steve Berman
>> >
>> > If I use "\\\\=" the only thing that is displayed is "\" when using "C-h v
>> > myvar".
>>
>>
>> It works in the example I gave just above. As so often you have not
>> provided a complete reproducer, so I can only try to guess why what you
>> did does not work. But I won't guess now.
>>
>> Steve Berman
>
> (defconst mydocstring ""
>
> "In the docstring, apply the escape sequence \\\\= to stop conversion by
> `substitute-command-keys'."
Thank you, now I can reproduce the problem. From brief testing it seems
"\\\\=" in a doc string only prints as "\\=" when it is the final
character sequence in the doc string. This could be a bug but I don't
have time to debug it now. However, escaping "\\=" as above does work:
(defvar mydocstring ""
"In the docstring, apply the escape sequence \\\\=\\=\\= to stop
conversion by `substitute-command-keys'.")
So I guess the recommendation is to always use this if you want to see
"\\=" in a *Help* buffer.
Steve Berman
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Printing \\= in the docstring
2024-07-16 8:49 ` Stephen Berman
@ 2024-07-16 10:56 ` Stephen Berman
0 siblings, 0 replies; 7+ messages in thread
From: Stephen Berman @ 2024-07-16 10:56 UTC (permalink / raw)
To: Heime; +Cc: Heime via Users list for the GNU Emacs text editor
On Tue, 16 Jul 2024 10:49:05 +0200 Stephen Berman <stephen.berman@gmx.net> wrote:
> On Tue, 16 Jul 2024 08:32:36 +0000 Heime <heimeborgia@protonmail.com> wrote:
[...]
>> (defconst mydocstring ""
>>
>> "In the docstring, apply the escape sequence \\\\= to stop conversion by
>> `substitute-command-keys'."
>
> Thank you, now I can reproduce the problem. From brief testing it seems
> "\\\\=" in a doc string only prints as "\\=" when it is the final
> character sequence in the doc string. This could be a bug but I don't
> have time to debug it now. However, escaping "\\=" as above does work:
>
> (defvar mydocstring ""
>
> "In the docstring, apply the escape sequence \\\\=\\=\\= to stop
> conversion by `substitute-command-keys'.")
After seeing your post about the discussion of substitute-command-keys
in the Elisp manual, and re-reading that section, I have to make what I
wrote above more precise: to make "\\=" appear in a *Help* buffer by
itself, i.e. not functioning as an escape sequence, write "\\\\=\\=" in
the doc string; to make "\\=" appear in a *Help* buffer in a context
where it functions as an escape sequence, write "\\\\=\\=\\=" in the doc
string. So in the above example of a doc string for the variable
`mydocstring', "\\\\=\\=" suffices.
Steve Berman
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2024-07-16 10:56 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <WOGXhoHXi-ghoVidse8cDwgfvmLUKIRqLxBwbF97alGfbnXgAISYEy9GKfzTC6yCqxaCn4Yjks7lzl_bTZyEuhIv91aWowm9r3whjcWlmz0=@protonmail.com>
2024-07-15 22:43 ` Printing \\= in the docstring Heime
2024-07-15 23:10 ` Stephen Berman
2024-07-16 8:20 ` Heime
2024-07-16 8:25 ` Stephen Berman
2024-07-16 8:32 ` Heime
2024-07-16 8:49 ` Stephen Berman
2024-07-16 10:56 ` 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.