GNU bug report logs - #55562
28.1.50; Wrong hash table return values in Elisp manual

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: emacs; Severity: minor; Reported by: "Basil L. Contovounesios" <contovob@HIDDEN>; Keywords: patch; dated Sat, 21 May 2022 20:30:02 UTC; Maintainer for emacs is bug-gnu-emacs@HIDDEN.

Message received at 55562 <at> debbugs.gnu.org:


Received: (at 55562) by debbugs.gnu.org; 22 May 2022 05:11:00 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun May 22 01:11:00 2022
Received: from localhost ([127.0.0.1]:43445 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1nsdrn-00014P-UO
	for submit <at> debbugs.gnu.org; Sun, 22 May 2022 01:11:00 -0400
Received: from eggs.gnu.org ([209.51.188.92]:50550)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1nsdrm-00014C-9I
 for 55562 <at> debbugs.gnu.org; Sun, 22 May 2022 01:10:58 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e]:35776)
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1nsdrg-000164-3v; Sun, 22 May 2022 01:10:52 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org;
 s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From:
 Date; bh=HugUB54sLtyFk6zBYi+89S7SpYMl/gThxDeEhrx3RXQ=; b=pVVaCRTt8sXIu9GLNKHk
 amMA5c8gvhpggtQ3eSlLraJw0J878yUf+Kjnr+Qcjb2vUK7l3zRRPcRe+3q0U+O2sAvhr/VD9XHY3
 WUrZwEJYMa/GNoGQjMomh0dYMNelmFqbaOjwfZubS6gep0VBweFCpNS7Jr/y1CPeLqqOoq3EuPRTq
 bqBJjuziytwNAYMyj0AJIFQdV1Vo1JhWMB+WKMrrgAMvNJ0//nNOMsuqwPAMJyA9K8e4tIyvjnlJe
 prFSWWJe/9XeQX0NlrwxmRPy70MFZKioOCLztK6Uub5BAVFV/UhKwJN9QoTTDkYjXFlfI8bCylVqE
 ScBzeuYRJR7TwQ==;
Received: from [87.69.77.57] (port=1220 helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1nsdrf-0000de-JR; Sun, 22 May 2022 01:10:51 -0400
Date: Sun, 22 May 2022 08:10:33 +0300
Message-Id: <835yly8852.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: "Basil L. Contovounesios" <contovob@HIDDEN>,
 Stefan Monnier <monnier@HIDDEN>,
 Daniel Colascione <dancol@HIDDEN>
In-Reply-To: <87czg6635b.fsf@HIDDEN> (bug-gnu-emacs@HIDDEN)
Subject: Re: bug#55562: 28.1.50; Wrong hash table return values in Elisp manual
References: <87czg6635b.fsf@HIDDEN>
MIME-version: 1.0
Content-type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 55562
Cc: 55562 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

[Adding Stefan and Daniel to the CC.]

> Date: Sat, 21 May 2022 23:29:04 +0300
> From:  "Basil L. Contovounesios" via "Bug reports for GNU Emacs,
>  the Swiss army knife of text editors" <bug-gnu-emacs@HIDDEN>
> 
> Severity: minor
> Tags: patch
> 
> 0. emacs -Q
> 1. C-h f clrhash RET
> 
> > Clear hash table TABLE and return it.
> 
> 2. C-h S clrhash RET
> 
> > Common Lisp note: In Common Lisp, ‘clrhash’ returns the empty
> > TABLE.  In Emacs Lisp, it returns ‘nil’.
> 
> It seems the following changes never propagated to the manual:
> 
> (Fputhash): Return `value' rather than nil.
> d9c4f922fb 2000-07-03 06:59:05 +0000
> https://git.sv.gnu.org/cgit/emacs.git/commit/?id=d9c4f922fb
> 
> * fns.c (Fputhash): Document return value.
> a54e348216 2011-06-06 18:39:26 -0700
> https://git.sv.gnu.org/cgit/emacs.git/commit/?id=a54e348216
> 
> And the following change wasn't announced in etc/NEWS either:
> 
> (Fclrhash): Return TABLE.
> ccd8f7fe14 2008-01-25 10:01:15 +0000
> https://git.sv.gnu.org/cgit/emacs.git/commit/?id=ccd8f7fe14
> 
> Is there any point in announcing the status quo, or can we just update
> the manual, e.g. as follows?
> 
> 
> >From b63ec2658f1c8782620c7418c8282f29249333cd Mon Sep 17 00:00:00 2001
> From: "Basil L. Contovounesios" <contovob@HIDDEN>
> Date: Sat, 21 May 2022 23:11:33 +0300
> Subject: [PATCH] Fix hash table function return values in manual
> 
> * doc/lispref/hash.texi (Hash Access): Reconcile documented return
> values of puthash and clrhash with their respective docstrings.
> ---
>  doc/lispref/hash.texi | 8 +++-----
>  1 file changed, 3 insertions(+), 5 deletions(-)
> 
> diff --git a/doc/lispref/hash.texi b/doc/lispref/hash.texi
> index a566d89824..34eda45b23 100644
> --- a/doc/lispref/hash.texi
> +++ b/doc/lispref/hash.texi
> @@ -203,7 +203,8 @@ Hash Access
>  @defun puthash key value table
>  This function enters an association for @var{key} in @var{table}, with
>  value @var{value}.  If @var{key} already has an association in
> -@var{table}, @var{value} replaces the old associated value.
> +@var{table}, @var{value} replaces the old associated value.  This
> +function always returns @var{value}.
>  @end defun
>  
>  @defun remhash key table
> @@ -219,10 +220,7 @@ Hash Access
>  @defun clrhash table
>  This function removes all the associations from hash table @var{table},
>  so that it becomes empty.  This is also called @dfn{clearing} the hash
> -table.
> -
> -@b{Common Lisp note:} In Common Lisp, @code{clrhash} returns the empty
> -@var{table}.  In Emacs Lisp, it returns @code{nil}.
> +table.  @code{clrhash} returns the empty @var{table}.
>  @end defun
>  
>  @defun maphash function table
> -- 
> 2.35.1
> 
> Thanks,
> 
> -- 
> Basil
> 
> In GNU Emacs 28.1.50 (build 1, x86_64-pc-linux-gnu)
>  of 2022-05-21 built on tia
> Repository revision: 139bfa1a0884dbd2600fc1bd11d11f41d3f9ef94
> Repository branch: wt/emacs-28-nox
> System Description: Debian GNU/Linux bookworm/sid
> 
> Configured using:
>  'configure CC=gcc-12 'CFLAGS=-O2 -march=native'
>  --prefix=/home/blc/.local --program-suffix=-28-nox
>  --with-file-notification=yes --with-x-toolkit=no --without-x'
> 
> Configured features:
> ACL DBUS GMP GNUTLS GPM JSON LCMS2 LIBSELINUX LIBSYSTEMD LIBXML2 MODULES
> NOTIFY INOTIFY PDUMPER SECCOMP SOUND THREADS XIM ZLIB




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#55562; Package emacs. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 21 May 2022 20:29:20 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat May 21 16:29:19 2022
Received: from localhost ([127.0.0.1]:43036 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1nsVix-0004i4-H8
	for submit <at> debbugs.gnu.org; Sat, 21 May 2022 16:29:19 -0400
Received: from lists.gnu.org ([209.51.188.17]:36838)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <contovob@HIDDEN>) id 1nsVis-0004hu-Rr
 for submit <at> debbugs.gnu.org; Sat, 21 May 2022 16:29:18 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10]:56818)
 by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <contovob@HIDDEN>) id 1nsVis-0002MC-L8
 for bug-gnu-emacs@HIDDEN; Sat, 21 May 2022 16:29:14 -0400
Received: from mail-wm1-x336.google.com ([2a00:1450:4864:20::336]:38682)
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.90_1) (envelope-from <contovob@HIDDEN>) id 1nsViq-0005rO-2n
 for bug-gnu-emacs@HIDDEN; Sat, 21 May 2022 16:29:13 -0400
Received: by mail-wm1-x336.google.com with SMTP id
 h205-20020a1c21d6000000b003972dda143eso2792504wmh.3
 for <bug-gnu-emacs@HIDDEN>; Sat, 21 May 2022 13:29:09 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tcd.ie; s=google21;
 h=from:to:subject:date:message-id:mime-version;
 bh=tc+5Hv4NfYxM0MFoMsgpU3vZnMD3N9+JFYeGoBLYLTU=;
 b=V7pzkvABUgXT1oznFI+XBInz4qwett/+ZBUwwEOx6OOgL3nyPexhc1RNDUjeldwSUE
 LS97axRX3OCl5mlY906XsdEQYXFari4ciYC1ju31Oqel2G5n+L3nkToER7cIEDv3aNCq
 pfZAEyrPJYtqxBereyIDOuDjXk8h/wplw2NbYoe1kPOlPgtdAOE5CsNOGxDDz2hViW+s
 v0ieBu3IV1UFWhheBvCeJCkpu4Uu4U8n9Otos9uQ8ucPjE6S0ZgwCr1Q4kYi+WwQ0Ie6
 st56pn5qIZqvw8LN7SWphfRdRAUD/4eIwtSIFb9PJepBkgQ6EWc0xSSLwvpeUXZ08UXG
 TmgA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20210112;
 h=x-gm-message-state:from:to:subject:date:message-id:mime-version;
 bh=tc+5Hv4NfYxM0MFoMsgpU3vZnMD3N9+JFYeGoBLYLTU=;
 b=NhUuwxpuZ1/ZHrxMzzKpYPLop+hTATwXFD2zclL7dQ3trTS/pwKmmJiJmT2uK6WybR
 ydegLVQO1T3/8sfYBlsrsSmhD2FJm7zBKwiB2myDbsGM8QcnCw+NYDODuStR9sDwwcJb
 j8Sy8mWYaOQEvy3m6BCnLKCRoQmg1Oaac87OdTykrEGMObm8XYZERdaXsgwsnr1xsCTq
 EiaZaAsMDwl1mJDciUK5bns2q3gOWXczf5xU8SbbUKEpUnnvtBcZnarI27THLv52oLPY
 YKkLMndabDUqRM640dKBIpSJs8c634sw83Qph70SRTvXKeRQe9KJ21lPRfgwdlBdXsXh
 dJBQ==
X-Gm-Message-State: AOAM5313m2g5oDAhw0t7F/wnMSX1vQQcQljTcvozaYNBMBqxQjSrW9G/
 43jSsFPTW9PVRhZHWm38NaAS6n5Kpwojzw==
X-Google-Smtp-Source: ABdhPJy9E07edrwFC7uYazgiLMlRHlpJTlZEyxSGHmBMEXzJY85RiPzijC/4OuGvV4e3i3qt9HDjKg==
X-Received: by 2002:a05:600c:1992:b0:394:826a:d40d with SMTP id
 t18-20020a05600c199200b00394826ad40dmr13725776wmq.146.1653164948041; 
 Sat, 21 May 2022 13:29:08 -0700 (PDT)
Received: from localhost ([2a02:587:3222:c5cf:d3e:f15b:b576:eb37])
 by smtp.gmail.com with ESMTPSA id
 s26-20020adfa29a000000b0020d069148bcsm5979762wra.110.2022.05.21.13.29.05
 for <bug-gnu-emacs@HIDDEN>
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Sat, 21 May 2022 13:29:06 -0700 (PDT)
From: "Basil L. Contovounesios" <contovob@HIDDEN>
To: bug-gnu-emacs@HIDDEN
Subject: 28.1.50; Wrong hash table return values in Elisp manual
Date: Sat, 21 May 2022 23:29:04 +0300
Message-ID: <87czg6635b.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="=-=-="
Received-SPF: pass client-ip=2a00:1450:4864:20::336;
 envelope-from=contovob@HIDDEN; helo=mail-wm1-x336.google.com
X-Spam_score_int: -20
X-Spam_score: -2.1
X-Spam_bar: --
X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1,
 DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1,
 RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001,
 T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no
X-Spam_action: no action
X-Spam-Score: -1.4 (-)
X-Debbugs-Envelope-To: submit
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -2.4 (--)

--=-=-=
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable

Severity: minor
Tags: patch

0. emacs -Q
1. C-h f clrhash RET

> Clear hash table TABLE and return it.

2. C-h S clrhash RET

> Common Lisp note: In Common Lisp, =E2=80=98clrhash=E2=80=99 returns the e=
mpty
> TABLE.  In Emacs Lisp, it returns =E2=80=98nil=E2=80=99.

It seems the following changes never propagated to the manual:

(Fputhash): Return `value' rather than nil.
d9c4f922fb 2000-07-03 06:59:05 +0000
https://git.sv.gnu.org/cgit/emacs.git/commit/?id=3Dd9c4f922fb

* fns.c (Fputhash): Document return value.
a54e348216 2011-06-06 18:39:26 -0700
https://git.sv.gnu.org/cgit/emacs.git/commit/?id=3Da54e348216

And the following change wasn't announced in etc/NEWS either:

(Fclrhash): Return TABLE.
ccd8f7fe14 2008-01-25 10:01:15 +0000
https://git.sv.gnu.org/cgit/emacs.git/commit/?id=3Dccd8f7fe14

Is there any point in announcing the status quo, or can we just update
the manual, e.g. as follows?


--=-=-=
Content-Type: text/x-diff
Content-Disposition: inline;
 filename=0001-Fix-hash-table-function-return-values-in-manual.patch

From b63ec2658f1c8782620c7418c8282f29249333cd Mon Sep 17 00:00:00 2001
From: "Basil L. Contovounesios" <contovob@HIDDEN>
Date: Sat, 21 May 2022 23:11:33 +0300
Subject: [PATCH] Fix hash table function return values in manual

* doc/lispref/hash.texi (Hash Access): Reconcile documented return
values of puthash and clrhash with their respective docstrings.
---
 doc/lispref/hash.texi | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/doc/lispref/hash.texi b/doc/lispref/hash.texi
index a566d89824..34eda45b23 100644
--- a/doc/lispref/hash.texi
+++ b/doc/lispref/hash.texi
@@ -203,7 +203,8 @@ Hash Access
 @defun puthash key value table
 This function enters an association for @var{key} in @var{table}, with
 value @var{value}.  If @var{key} already has an association in
-@var{table}, @var{value} replaces the old associated value.
+@var{table}, @var{value} replaces the old associated value.  This
+function always returns @var{value}.
 @end defun
 
 @defun remhash key table
@@ -219,10 +220,7 @@ Hash Access
 @defun clrhash table
 This function removes all the associations from hash table @var{table},
 so that it becomes empty.  This is also called @dfn{clearing} the hash
-table.
-
-@b{Common Lisp note:} In Common Lisp, @code{clrhash} returns the empty
-@var{table}.  In Emacs Lisp, it returns @code{nil}.
+table.  @code{clrhash} returns the empty @var{table}.
 @end defun
 
 @defun maphash function table
-- 
2.35.1


--=-=-=
Content-Type: text/plain


Thanks,

-- 
Basil

In GNU Emacs 28.1.50 (build 1, x86_64-pc-linux-gnu)
 of 2022-05-21 built on tia
Repository revision: 139bfa1a0884dbd2600fc1bd11d11f41d3f9ef94
Repository branch: wt/emacs-28-nox
System Description: Debian GNU/Linux bookworm/sid

Configured using:
 'configure CC=gcc-12 'CFLAGS=-O2 -march=native'
 --prefix=/home/blc/.local --program-suffix=-28-nox
 --with-file-notification=yes --with-x-toolkit=no --without-x'

Configured features:
ACL DBUS GMP GNUTLS GPM JSON LCMS2 LIBSELINUX LIBSYSTEMD LIBXML2 MODULES
NOTIFY INOTIFY PDUMPER SECCOMP SOUND THREADS XIM ZLIB

--=-=-=--




Acknowledgement sent to "Basil L. Contovounesios" <contovob@HIDDEN>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs@HIDDEN. Full text available.
Report forwarded to bug-gnu-emacs@HIDDEN:
bug#55562; Package emacs. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Sun, 22 May 2022 05:15:02 UTC

GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.