From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Gregory Heytings Newsgroups: gmane.emacs.bugs Subject: bug#60454: 30.0.50; `format-message' does not allow displaying "`" and "'" verbatim Date: Sat, 31 Dec 2022 19:29:48 +0000 Message-ID: <0a62cbaeff6a36ea26cd@heytings.org> References: <87tu1b8vi3.fsf@localhost> <0a62cbaeff9cde095dd2@heytings.org> <87o7rj8pur.fsf@localhost> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="pZLa78qoJR" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="21053"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 60454@debbugs.gnu.org, Stefan Monnier To: Ihor Radchenko Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Dec 31 20:30:23 2022 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pBhYk-0005JM-Um for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 31 Dec 2022 20:30:23 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pBhYV-0004L7-Va; Sat, 31 Dec 2022 14:30:07 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pBhYR-0004Kq-AO for bug-gnu-emacs@gnu.org; Sat, 31 Dec 2022 14:30:03 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pBhYQ-0000He-Iv for bug-gnu-emacs@gnu.org; Sat, 31 Dec 2022 14:30:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pBhYQ-0005kP-EG for bug-gnu-emacs@gnu.org; Sat, 31 Dec 2022 14:30:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Gregory Heytings Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 31 Dec 2022 19:30:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 60454 X-GNU-PR-Package: emacs Original-Received: via spool by 60454-submit@debbugs.gnu.org id=B60454.167251499322049 (code B ref 60454); Sat, 31 Dec 2022 19:30:02 +0000 Original-Received: (at 60454) by debbugs.gnu.org; 31 Dec 2022 19:29:53 +0000 Original-Received: from localhost ([127.0.0.1]:39873 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pBhYG-0005jZ-OY for submit@debbugs.gnu.org; Sat, 31 Dec 2022 14:29:53 -0500 Original-Received: from heytings.org ([95.142.160.155]:53448) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pBhYE-0005jO-Fs for 60454@debbugs.gnu.org; Sat, 31 Dec 2022 14:29:50 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=heytings.org; s=20220101; t=1672514989; bh=TIe5QzqTHpgDjuNwS/HU7DrQt7RdorL2HC0DwC9gaoE=; h=Date:From:To:cc:Subject:In-Reply-To:Message-ID:References:From; b=nyFIVsvNNjh7+TPY6CownuVcoVVI1x4TtCfo/CbkcV10nXuhYov0C5s6gUXmVzAMa FPW4H8mPDOUYznpVaxo5DEz4oe8dF53rb4YN4REJQHFlBneG41rA1KPVv/6hvwRHk1 oYKoCwejSjEQ9RY3hNX1DwDhZW55hWgCsj3TKuxN/JXwDeWBmjTr/GUNAJwfttR667 vSuuf0fJG3Fbrjsn8VLWBnRv4+m8qhTL7IH3d0qeVlCPnuVE3CPVaxYoFN6Cx7CjWH c5Y42dxYFdyQXgM+PN95o131GUvILK/AUbZh/uUKvJa7KxRAChbQPra8bIWwRdB++5 bbZty7ZB66mVA== In-Reply-To: <87o7rj8pur.fsf@localhost> Content-ID: <0a62cbaeff393040efe5@heytings.org> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:252215 Archived-At: --pZLa78qoJR Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: quoted-printable Content-ID: <0a62cbaeff8b733d5257@heytings.org> >> Just let-bind text-quoting-style: >> >> (let ((text-quoting-style 'grave)) >> (format-message "foo `bar' baz")) > > This won't work when I sometimes actually want the replacement to=20 > happen: > > (format-message "This is variable `foo', and the code 'bar") > Indeed. If you want both literal ` ' and interpreted ` ', until Stefan's= =20 suggestion is implemented, you can either use what Andreas suggested, or=20 use a variant of format-message such as: (defun format-message-alt (format &rest objects) "Format a string out of a format-string and arguments. This acts like `format-message', which see, except that the grave accent (\\=3D`) and apostrophe (\\=3D') can be escaped with `\\\\=E2=80=8B= =3D', in which case they are not replaced by the left and right quote replacement characters specified by `text-quoting-style'." (let* ((fq =09 (replace-regexp-in-string =09 "\\\\=3D`" "\uE001" =09 (replace-regexp-in-string =09 "\\\\=3D'" "\uE000" format))) =09 (fm (format-message fq objects)) =09 (fu =09 (replace-regexp-in-string =09 "\uE001" "`" =09 (replace-regexp-in-string =09 "\uE000" "'" fm)))) fu)) --pZLa78qoJR--