From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Robert Weiner Newsgroups: gmane.emacs.bugs Subject: bug#44365: 27.1; intern-soft given a symbol never returns nil Date: Sun, 1 Nov 2020 08:55:57 -0500 Message-ID: References: <87blghcizx.fsf@gnus.org> Reply-To: rswgnu@gmail.com Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="000000000000c158f505b30bfe69" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="33802"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 44365@debbugs.gnu.org To: Lars Ingebrigtsen Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Nov 01 14:57:09 2020 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 1kZDr2-0008er-7V for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 01 Nov 2020 14:57:08 +0100 Original-Received: from localhost ([::1]:53452 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kZDr1-0000XL-An for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 01 Nov 2020 08:57:07 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:39844) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kZDqw-0000Ww-Db for bug-gnu-emacs@gnu.org; Sun, 01 Nov 2020 08:57:02 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:52703) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kZDqw-0004xv-4X for bug-gnu-emacs@gnu.org; Sun, 01 Nov 2020 08:57:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kZDqw-00037v-2y for bug-gnu-emacs@gnu.org; Sun, 01 Nov 2020 08:57:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Robert Weiner Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 01 Nov 2020 13:57:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 44365 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: notabug Original-Received: via spool by 44365-submit@debbugs.gnu.org id=B44365.160423899311981 (code B ref 44365); Sun, 01 Nov 2020 13:57:02 +0000 Original-Received: (at 44365) by debbugs.gnu.org; 1 Nov 2020 13:56:33 +0000 Original-Received: from localhost ([127.0.0.1]:36016 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kZDqT-00037B-0X for submit@debbugs.gnu.org; Sun, 01 Nov 2020 08:56:33 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:39682) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kZDqR-00036x-AC for 44365@debbugs.gnu.org; Sun, 01 Nov 2020 08:56:31 -0500 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:54590) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kZDqM-0004va-0e for 44365@debbugs.gnu.org; Sun, 01 Nov 2020 08:56:26 -0500 Original-Received: from mail-lf1-f41.google.com ([209.85.167.41]:37352) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.82) (envelope-from ) id 1kZDqL-00057a-2H for 44365@debbugs.gnu.org; Sun, 01 Nov 2020 08:56:25 -0500 Original-Received: by mail-lf1-f41.google.com with SMTP id j30so13956653lfp.4 for <44365@debbugs.gnu.org>; Sun, 01 Nov 2020 05:56:25 -0800 (PST) X-Gm-Message-State: AOAM533ztdi//3y6ky+Slzav8BOi25kVreVJ9TzfUo22LmEHrF+ajmej It9JASuZwRAK4eIYe/HjJy6Z6s6jo+DVpVYnF84= X-Google-Smtp-Source: ABdhPJypl2aeWLnAatyjp4b0kSuhMqseHUnjtw6hYz4PCn9g6qX55RyOp2jiH8eNBWWn+tprRfSMQ/AzTZyoyxnML3I= X-Received: by 2002:a19:ed04:: with SMTP id y4mr3960747lfy.306.1604238983647; Sun, 01 Nov 2020 05:56:23 -0800 (PST) In-Reply-To: <87blghcizx.fsf@gnus.org> X-Gmail-Original-Message-ID: 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:192374 Archived-At: --000000000000c158f505b30bfe69 Content-Type: text/plain; charset="UTF-8" Hi Lars: I would have only sent intern-soft a string if it were not for the doc string which says it takes a string or a symbol. "Return the canonical symbol named NAME, or nil if none exists. NAME may be a string or a symbol. If it is a symbol, that exact symbol is searched for." So, the doc string must need changing if your view is correct. Bob On Sun, Nov 1, 2020 at 8:19 AM Lars Ingebrigtsen wrote: > Robert Weiner writes: > > > If I first call intern-soft with the symbol-name of an unbound symbol, > > then it returns nil properly. But if I instead give intern-soft the > > symbol, it always returns the symbol rather than nil. Maybe it > > is because the internal call to symbol-name interns the symbol before it > can test > > whether it is bound. Isn't this a bug? > > So your test case is > > (intern-soft 'does-not-exist) > > ? > > That's not a valid use case for the function -- the reader will intern > `does-not-exist', and so the `intern-soft' call will just return the > interned symbol. The function is meant to be used like: > > (intern-soft "does-not-exist") > > So I'm closing this bug reprt. > > -- > (domestic pets only, the antidote for overdose, milk.) > bloggy blog: http://lars.ingebrigtsen.no > --000000000000c158f505b30bfe69 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi Lars:

I would have only sent intern-soft a string if= it were not for the doc string which says it takes a string=C2=A0or a symb= ol.

"Ret= urn the canonical symbol named NAME, or nil if none exists.
NAM= E may be a string or a symbol.=C2=A0 If it is a symbol, that exact
symbo= l is searched for."

So, the doc string must ne= ed changing if your view is correct.

Bob

On Sun, Nov 1, 2020 at 8:19 AM Lars Ingebrigtsen <larsi@gnus.org> wrote:
Robert Weiner <rsw@gnu.org> writes:

> If I first call intern-soft with the symbol-name of an unbound symbol,=
> then it returns nil properly.=C2=A0 But if I instead give intern-soft = the
> symbol, it always returns the symbol rather than nil.=C2=A0 Maybe it > is because the internal call to symbol-name interns the symbol before = it can test
> whether it is bound.=C2=A0 Isn't this a bug?

So your test case is

(intern-soft 'does-not-exist)

?

That's not a valid use case for the function -- the reader will intern<= br> `does-not-exist', and so the `intern-soft' call will just return th= e
interned symbol.=C2=A0 The function is meant to be used like:

(intern-soft "does-not-exist")

So I'm closing this bug reprt.

--
(domestic pets only, the antidote for overdose, milk.)
=C2=A0 =C2=A0bloggy blog: http://lars.ingebrigtsen.no
--000000000000c158f505b30bfe69--