all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Michael Heerdegen <michael_heerdegen@web.de>
To: Xie Shynur <one.last.kiss@outlook.com>
Cc: 61281@debbugs.gnu.org
Subject: bug#61281: “`(a \, b)” equals to “`(a . , b)”
Date: Mon, 06 Feb 2023 05:11:04 +0100	[thread overview]
Message-ID: <87ilgfsaav.fsf@web.de> (raw)
In-Reply-To: <SA0PR04MB7433BC96453731D173F8B8A5D7D49@SA0PR04MB7433.namprd04.prod.outlook.com> (Xie Shynur's message of "Sat, 4 Feb 2023 23:23:00 +0000")

[-- Attachment #1: Type: text/plain, Size: 1365 bytes --]

Xie Shynur <one.last.kiss@outlook.com> writes:

> ELISP> `(emacs-version \, emacs-version)
> (emacs-version . "28.2")

> ```
> (custom-set-variables
>  '(var `(a . ,b)))
> ```
>
> Then change some options by GUI menu, and click `Save Options`:
>
> ```
> (custom-set-variables
>  '(var `(a \, b))
>  '(changed-option new-value))
> ```

> Is it a feature or bug?

It doesn't harm (it's not wrong), you see an implementation detail
exposed, but it's not nice either.

After discussing this and peripheral stuff with others I would suggest
(I try to give a complete summary of the useful suggestions here) to do
these things:


(1) We should try to teach the printer to prefer the syntax
(... . ,X) over (... \, X).  The latter is equivalent but in most
cases the first version will be easier to interpret.  This would fix
the above case about saving custom variables (readability).


(2) We should (in the recently added function docstrings and the manual)
explain that the reader constructs `X, ,X and ,@X are expanded to (or
equivalent to) (\` X), (\, X) and (\,@ X) respectively, where the cars
are the symbols with the names "`", "," and ",@".

While this is an implementation detail, not knowing about that fact
leaves the semantics of expressions like above unclear, which is not
good.


(3) Fix the header in backquote.el as suggested by Drew, e.g. like this:


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-lisp-emacs-lisp-backquote.el-Small-fix-in-commentary.patch --]
[-- Type: text/x-diff, Size: 1025 bytes --]

From 7c8bc97263a1b6d009a11b32d6e62e82fe14e997 Mon Sep 17 00:00:00 2001
From: Michael Heerdegen <michael_heerdegen@web.de>
Date: Mon, 6 Feb 2023 04:47:12 +0100
Subject: [PATCH] ; * lisp/emacs-lisp/backquote.el: Small fix in commentary

---
 lisp/emacs-lisp/backquote.el | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/lisp/emacs-lisp/backquote.el b/lisp/emacs-lisp/backquote.el
index 84527234207..de14b5cd42f 100644
--- a/lisp/emacs-lisp/backquote.el
+++ b/lisp/emacs-lisp/backquote.el
@@ -25,9 +25,9 @@

 ;;; Commentary:

-;; When the Lisp reader sees `(...), it generates (\` (...)).
-;; When it sees ,... inside such a backquote form, it generates (\, ...).
-;; For ,@... it generates (\,@ ...).
+;; When the Lisp reader sees `X it generates (\` X).
+;; When it sees ,X it generates (\, X).  For ,@X it generates
+;; (\,@ X).

 ;; This backquote will generate calls to the backquote-list* form.
 ;; Both a function version and a macro version are included.
--
2.30.2


[-- Attachment #3: Type: text/plain, Size: 20 bytes --]



Thanks,

Michael.

  parent reply	other threads:[~2023-02-06  4:11 UTC|newest]

Thread overview: 47+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-04 23:23 bug#61281: “`(a \, b)” equals to “`(a . , b)” Xie Shynur
2023-02-04 23:34 ` Drew Adams
2023-02-04 23:43   ` Drew Adams
2023-02-05  0:28   ` Michael Heerdegen
2023-02-05  3:30     ` Drew Adams
2023-02-05  4:32       ` Michael Heerdegen
2023-02-05  4:55         ` Michael Heerdegen
2023-02-05 15:53           ` Drew Adams
2023-02-05 23:56             ` Michael Heerdegen
2023-02-06  2:26               ` Drew Adams
2023-02-06  3:03                 ` Michael Heerdegen
2023-02-06  3:49                   ` Drew Adams
2023-02-06 10:49                 ` Ihor Radchenko
2023-02-06 16:46                   ` Drew Adams
2023-02-07  1:07                     ` Michael Heerdegen
2023-02-07  1:40                   ` Michael Heerdegen
2023-02-07 11:50                     ` bug#61281: Double backquote expansion and ", " (was: bug#61281: “`(a \, b)” equals to “`(a . , b)”) Ihor Radchenko
2023-02-07 23:33                       ` bug#61281: Double backquote expansion and ", " Michael Heerdegen
2023-02-06  9:40               ` bug#61281: “`(a \, b)” equals to “`(a . , b)” Andreas Schwab
2023-02-06 16:43                 ` Drew Adams
2023-02-07  8:56                   ` Andreas Schwab
2023-02-07 18:00                     ` Drew Adams
2023-02-07 23:44                       ` Michael Heerdegen
2023-02-08  3:09                         ` Drew Adams
2023-02-08  9:06                           ` Andreas Schwab
2023-02-09  1:29                           ` Michael Heerdegen
2023-02-09  2:04                             ` Drew Adams
2023-02-09  2:15                               ` Michael Heerdegen
2023-02-08  9:12                       ` Andreas Schwab
2023-02-05  6:32         ` Jim Porter
2023-02-06  0:13           ` Michael Heerdegen
2023-02-06  0:18             ` Michael Heerdegen
2023-02-06  1:14               ` Jim Porter
2023-02-05 15:48         ` Drew Adams
2023-02-05 23:17           ` Michael Heerdegen
2023-02-06  1:49             ` Drew Adams
2023-02-06  4:11 ` Michael Heerdegen [this message]
2023-02-06  5:01   ` Drew Adams
2023-02-06  5:22     ` Drew Adams
2023-02-06  5:25     ` Michael Heerdegen
2023-02-06 16:43       ` Drew Adams
2023-02-07  2:00         ` Michael Heerdegen
2023-02-07 18:00           ` Drew Adams
2023-02-07 23:36             ` Michael Heerdegen
2023-02-08  3:09               ` Drew Adams
2023-02-09  1:37                 ` Michael Heerdegen
2023-02-09  2:10                   ` Drew Adams

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=87ilgfsaav.fsf@web.de \
    --to=michael_heerdegen@web.de \
    --cc=61281@debbugs.gnu.org \
    --cc=one.last.kiss@outlook.com \
    /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.