From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: =?UTF-8?Q?Jo=C3=A3o_?= =?UTF-8?Q?T=C3=A1vora?= Newsgroups: gmane.emacs.bugs Subject: bug#59082: 28.2; Undocumented `intern-soft` feature with shorthands symbols Date: Sat, 12 Nov 2022 13:22:28 +0000 Message-ID: References: <875yfresq9.fsf@posteo.net> <831qq8ny2m.fsf@gnu.org> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="000000000000964c9905ed45e62a" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="31936"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Thierry Volpiatto , 59082@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Nov 12 14:23:25 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 1otqTl-00089c-2d for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 12 Nov 2022 14:23:25 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1otqTe-0002eo-HY; Sat, 12 Nov 2022 08:23:18 -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 1otqTQ-0002aB-Fk for bug-gnu-emacs@gnu.org; Sat, 12 Nov 2022 08:23:06 -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 1otqTO-0008WA-82 for bug-gnu-emacs@gnu.org; Sat, 12 Nov 2022 08:23:04 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1otqTN-0007v5-Rm for bug-gnu-emacs@gnu.org; Sat, 12 Nov 2022 08:23:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: =?UTF-8?Q?Jo=C3=A3o_?= =?UTF-8?Q?T=C3=A1vora?= Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 12 Nov 2022 13:23:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 59082 X-GNU-PR-Package: emacs Original-Received: via spool by 59082-submit@debbugs.gnu.org id=B59082.166825936930415 (code B ref 59082); Sat, 12 Nov 2022 13:23:01 +0000 Original-Received: (at 59082) by debbugs.gnu.org; 12 Nov 2022 13:22:49 +0000 Original-Received: from localhost ([127.0.0.1]:47521 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1otqTA-0007uV-Hh for submit@debbugs.gnu.org; Sat, 12 Nov 2022 08:22:48 -0500 Original-Received: from mail-oi1-f182.google.com ([209.85.167.182]:43735) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1otqT8-0007uI-87 for 59082@debbugs.gnu.org; Sat, 12 Nov 2022 08:22:46 -0500 Original-Received: by mail-oi1-f182.google.com with SMTP id q83so7295922oib.10 for <59082@debbugs.gnu.org>; Sat, 12 Nov 2022 05:22:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=my94LJSYBDyrHihTZo+IkZHwZfCoDcj8SP5YCNMpZpM=; b=bPu2YiImmhYJNjtd8R9JgeFmX0R8y9L75NtyV8Q6BGNsV/s61DfLAIpybmhMEolEFz 2U0oRPE3hpPbnAvqvUl8s9dKkh8kCVsOc+noExdkuqVkqapJLaOZTr3qK5/T4AA2ib2Y 2h2BX9ynt46xXnwiGc7kDSate/6D9Zougn92YbNnIZ7Sj/Z0nUIBz3OwS32NV+B9wlF0 ujCvx4xVqc3jHauJ5ZWteyH4/qaoMSNNLpPCyAMz6t/TsILt8iMl5oNKIMuAvpkOmSHw VupuqvFrPlXvhgJkpWwZ0mrHwRLoPjjL48o3gWtUZVslJ4WOfOD2YuiS3BhxcsGk6z9G 3OJQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=my94LJSYBDyrHihTZo+IkZHwZfCoDcj8SP5YCNMpZpM=; b=t/Kf/Cvrp2t/qal7cRmbwSixmtNubfMb3pAKcRzWIArRm961XDK7xtH3HDXsEaBDlN 0tpVJxfVDXDaz5//lgFyVrCNzbOhsd742G2m3JM2k4x5ehl2PK9eDbb+qZkpy/ScKYUX 2CGRFWw0Ccmuj4OX72kvuPSVQB+bBaForKsIVrETc30F/xVruTfg3a1Zv55bJcW1Vt85 CnKw9nbCRY/CjabD0Y6S4zs5u7LPqIsm1rnqtipKwf1j6Ipd+FGBApeokCkuacNYfJTz YRht97rsm5R3Uq2B1FsN3c3b5ps2RAAjQHD+2i58yUBVqwNyZE97B/vwJZnGOfzmWXAt 8nOg== X-Gm-Message-State: ANoB5pmP7yRe2Eodf8VOQHNgNsLynBVIE/HR1jyF+ADSSub890cX954B Cl04y0bSXYMkNOKx2ZhSOMyW2GWnnUYfJmdXjhw= X-Google-Smtp-Source: AA0mqf6xEFG3D5Q3169jz4Mh8Du4nMq+jbIbPdWCsNSYpqguk2xJgWvLxxQRH9LOmHTlmtZcSEFPxvJR3xurfFyaebw= X-Received: by 2002:a05:6808:13c4:b0:35a:7e8d:8ad6 with SMTP id d4-20020a05680813c400b0035a7e8d8ad6mr2643697oiw.171.1668259360688; Sat, 12 Nov 2022 05:22:40 -0800 (PST) In-Reply-To: <831qq8ny2m.fsf@gnu.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:247662 Archived-At: --000000000000964c9905ed45e62a Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Thierry is correct. Intern-soft is Emacs way to go from a string representation to the symbol itself (or nowhere, if there's no match). This is not new with shorthands. Should we document this in the Elisp manual? Maybe, but where? Shorthand section? Not sure. This is a feature of Lisp in general and the correct way to go from strings to symbols. Before shorthands we got away without this step for obvious reasons. Curiously, I was pleasantly surprised that much code of key symbol processing facilities was already using this indirection and shorthands automatically worked in those facilities because of that. Jo=C3=A3o On Sat, Nov 12, 2022, 12:43 Eli Zaretskii wrote: > > From: Thierry Volpiatto > > Date: Sun, 06 Nov 2022 20:16:48 +0000 > > > > after having hard time getting the longhand name of a shorthand symbol > > at point (with regexp and the local value of read-symbol-shorthands) I > > discover it is easy to get this information with: > > > > (symbol-name (intern-soft (thing-at-point 'symbol))) > > > > Is this the right way to get this information and if so is it > > possible to document it? > > Jo=C3=A3o, any comments? > > Thanks. > --000000000000964c9905ed45e62a Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Thierry is correct. Intern-soft is Emacs way to go from a= string representation to the symbol itself (or nowhere, if there's no = match). This is not new with shorthands.
=C2=A0
Should we document this in the Elisp manual?= Maybe, but where? Shorthand section? Not sure. This is a feature of Lisp i= n general and the correct way to go from strings to symbols. Before shortha= nds we got away without this step for obvious reasons. Curiously, I was ple= asantly surprised that much code of key symbol processing facilities was al= ready using this indirection and shorthands automatically worked in those f= acilities because of that.

Jo=C3=A3o

On Sat, Nov 12, 2022, 12:43 Eli Zaretskii <eliz@gnu.org> wrote:
> From: Thierry Volpiatto <thievol@posteo.net= >
> Date: Sun, 06 Nov 2022 20:16:48 +0000
>
> after having hard time getting the longhand name of a shorthand symbol=
> at point (with regexp and the local value of read-symbol-shorthands) I=
> discover it is easy to get this information with:
>
>=C2=A0 =C2=A0 =C2=A0(symbol-name (intern-soft (thing-at-point 'symb= ol)))
>
> Is this the right way to get this information and if so is it
> possible to document it?

Jo=C3=A3o, any comments?

Thanks.
--000000000000964c9905ed45e62a--