unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Ihor Radchenko <yantar92@posteo.net>
To: 60454@debbugs.gnu.org
Cc: Stefan Monnier <monnier@iro.umontreal.ca>
Subject: bug#60454: 30.0.50; `format-message' does not allow displaying "`" and "'" verbatim
Date: Sat, 31 Dec 2022 15:04:36 +0000	[thread overview]
Message-ID: <87tu1b8vi3.fsf@localhost> (raw)

Hi,

Following up https://list.orgmode.org/87k027af5x.fsf@localhost/T/#t
and https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=62dc49509c8962bd2a19c4c4475fc616eebdfde8

`format-message' and thus also `warn' unconditionally replace _all_ the
instances of "`" and "'" in the message:

    This acts like ‘format’, except it also replaces each grave accent (`)
    by a left quote, and each apostrophe (') by a right quote.

However, sometimes, it is desired to keep these chars literal.
For example, `org-assert-version' displays a warning that suggests Elisp
code:

(warn "...
   It is recommended to put
    (straight-use-package 'org)
...")

Replacing "'" is undesired here and will make copy-pasted Elisp code
incorrect.

Would it be possible to introduce some kind of escape mechanism in
`format-message' to produce literal "'" and "`" when needed?

In GNU Emacs 30.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version
 3.24.35, cairo version 1.17.6) of 2022-12-26 built on localhost
Repository revision: cc29fab3a66c59e77d0ff67c0f3e2e34ec80a03c
Repository branch: master
Windowing system distributor 'The X.Org Foundation', version 11.0.12101004
System Description: Gentoo Linux

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>





             reply	other threads:[~2022-12-31 15:04 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-31 15:04 Ihor Radchenko [this message]
2022-12-31 15:41 ` bug#60454: 30.0.50; `format-message' does not allow displaying "`" and "'" verbatim Andreas Schwab
2022-12-31 16:39   ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-12-31 15:42 ` Gregory Heytings
2022-12-31 17:06   ` Ihor Radchenko
2022-12-31 19:29     ` Gregory Heytings
2022-12-31 20:17       ` Gregory Heytings

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

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87tu1b8vi3.fsf@localhost \
    --to=yantar92@posteo.net \
    --cc=60454@debbugs.gnu.org \
    --cc=monnier@iro.umontreal.ca \
    /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 public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

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).