all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Stephen Berman <stephen.berman@gmx.net>
To: Heime <heimeborgia@protonmail.com>
Cc: Heime via Users list for the GNU Emacs text editor
	<help-gnu-emacs@gnu.org>
Subject: Re: Printing \\= in the docstring
Date: Tue, 16 Jul 2024 10:49:05 +0200	[thread overview]
Message-ID: <874j8p90xq.fsf@gmx.net> (raw)
In-Reply-To: <E_GorWuExlsfj1681Fa1DTOQFmCEuV_S403ux1ZAk-KYFTqw57ApdB0oPWSe6Fz5GEI3BvsqxI1R5pms2-qlOhMsDIR1epcfUM1fZUZ0Ht8=@protonmail.com> (Heime's message of "Tue, 16 Jul 2024 08:32:36 +0000")

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



  reply	other threads:[~2024-07-16  8:49 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [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 [this message]
2024-07-16 10:56             ` Stephen Berman

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=874j8p90xq.fsf@gmx.net \
    --to=stephen.berman@gmx.net \
    --cc=heimeborgia@protonmail.com \
    --cc=help-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.