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#55562: 28.1.50; Wrong hash table return values in Elisp manual Date: Sun, 22 May 2022 08:10:33 +0300 Message-ID: <835yly8852.fsf@gnu.org> References: <87czg6635b.fsf@tcd.ie> 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="29946"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 55562@debbugs.gnu.org To: "Basil L. Contovounesios" , Stefan Monnier , Daniel Colascione Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun May 22 07:11:29 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 1nsdsF-0007cQ-Mx for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 22 May 2022 07:11:27 +0200 Original-Received: from localhost ([::1]:58474 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nsdsE-0004vz-Ib for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 22 May 2022 01:11:26 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:43858) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nsdrq-0004oa-Vs for bug-gnu-emacs@gnu.org; Sun, 22 May 2022 01:11:04 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:49548) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nsdrq-00019N-Lp for bug-gnu-emacs@gnu.org; Sun, 22 May 2022 01:11:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nsdrq-00014f-CO for bug-gnu-emacs@gnu.org; Sun, 22 May 2022 01:11: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: Sun, 22 May 2022 05:11:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 55562 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 55562-submit@debbugs.gnu.org id=B55562.16531962604121 (code B ref 55562); Sun, 22 May 2022 05:11:02 +0000 Original-Received: (at 55562) by debbugs.gnu.org; 22 May 2022 05:11:00 +0000 Original-Received: from localhost ([127.0.0.1]:43445 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nsdrn-00014P-UO for submit@debbugs.gnu.org; Sun, 22 May 2022 01:11:00 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:50550) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nsdrm-00014C-9I for 55562@debbugs.gnu.org; Sun, 22 May 2022 01:10:58 -0400 Original-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 ) 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==; Original-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 ) id 1nsdrf-0000de-JR; Sun, 22 May 2022 01:10:51 -0400 In-Reply-To: <87czg6635b.fsf@tcd.ie> (bug-gnu-emacs@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" Xref: news.gmane.io gmane.emacs.bugs:232862 Archived-At: [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" > > 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" > 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