From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#51089: 28.0.60; Using read-symbol-shorthands (("-" . "foo-")) shouldn't shadow the '-' symbol Date: Fri, 08 Oct 2021 08:49:30 +0300 Message-ID: <83ee8wysk5.fsf@gnu.org> References: <871r4w8sza.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="21940"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 51089@debbugs.gnu.org, rms@gnu.org To: =?UTF-8?Q?Jo=C3=A3o_?= =?UTF-8?Q?T=C3=A1vora?= Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Oct 08 07:51:09 2021 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 1mYimi-0005UB-U9 for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 08 Oct 2021 07:51:08 +0200 Original-Received: from localhost ([::1]:33536 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mYimh-0003iY-US for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 08 Oct 2021 01:51:07 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:32920) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mYimc-0003i4-PJ for bug-gnu-emacs@gnu.org; Fri, 08 Oct 2021 01:51:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:37368) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mYimc-0000ki-Eg for bug-gnu-emacs@gnu.org; Fri, 08 Oct 2021 01:51:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mYimc-0004V8-DD for bug-gnu-emacs@gnu.org; Fri, 08 Oct 2021 01:51:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 08 Oct 2021 05:51:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 51089 X-GNU-PR-Package: emacs Original-Received: via spool by 51089-submit@debbugs.gnu.org id=B51089.163367220417225 (code B ref 51089); Fri, 08 Oct 2021 05:51:02 +0000 Original-Received: (at 51089) by debbugs.gnu.org; 8 Oct 2021 05:50:04 +0000 Original-Received: from localhost ([127.0.0.1]:48914 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mYilg-0004Tl-Bq for submit@debbugs.gnu.org; Fri, 08 Oct 2021 01:50:04 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:59114) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mYile-0004Sz-AM for 51089@debbugs.gnu.org; Fri, 08 Oct 2021 01:50:03 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:58222) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mYilZ-0008BJ-23; Fri, 08 Oct 2021 01:49:57 -0400 Original-Received: from 84.94.185.95.cable.012.net.il ([84.94.185.95]:2979 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mYilS-0002no-2X; Fri, 08 Oct 2021 01:49:50 -0400 In-Reply-To: <871r4w8sza.fsf@gmail.com> (message from =?UTF-8?Q?Jo=C3=A3o_?= =?UTF-8?Q?T=C3=A1vora?= on Thu, 07 Oct 2021 21:44:57 +0100) 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" Xref: news.gmane.io gmane.emacs.bugs:216695 Archived-At: > From: João Távora > Date: Thu, 07 Oct 2021 21:44:57 +0100 > > (1) The very simplest fix (and perhaps the most correct one) is just to > special-case the case of the '-' prefix and the '-' function. That's > because the '-' symbol is the only one that exactly matches the > name-prefix separator that is used in Emacs. In other words, I can't > think of any other "legitimate" use case for the shorthands feature that > would shadow a similar one-character symbol. For example using > > (("/" . "some-longhand/")) > > would shadow the '/' symbol but count as as "the user knows what she's > doing". Shouldn't we disallow doing this when the car is any existing symbol? Why do you think the above use with "/" is legitimate, and when could it be useful? And how "/" is different from "-"? The fact that we tend to use '-' as name separator is not 100% true: some symbols use other separators: '/', '+', '>', etc. Here's another idea: disallow the car from being a string that includes only punctuation characters. WDYT? > (2) Another natural, more generic, way would be to demand that the > shorthand in the 'car's of the elements of read-symbol-shorthands is > strictly shorter then the form about to be renamed. In lread.c, I think > it would amount to this: I don't think I like this artificial restriction. I'm aware that you are convinced that's how this feature should be used, but hard-coding your personal opinions, not necessarily shared by others, in such a low-level code is something we should avoid, I think. And that's besides the fact that this changes sensitive parts of Emacs on the release branch.