From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: "Basil L. Contovounesios" via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#55562: 28.1.50; Wrong hash table return values in Elisp manual Date: Sat, 21 May 2022 23:29:04 +0300 Message-ID: <87czg6635b.fsf@tcd.ie> Reply-To: "Basil L. Contovounesios" Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="29437"; mail-complaints-to="usenet@ciao.gmane.io" To: 55562@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat May 21 22:30:52 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 1nsVkS-0007Wb-7n for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 21 May 2022 22:30:52 +0200 Original-Received: from localhost ([::1]:37024 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nsVkQ-0002bA-KD for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 21 May 2022 16:30:50 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:56892) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nsVjf-0002Z7-Q3 for bug-gnu-emacs@gnu.org; Sat, 21 May 2022 16:30:05 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:49139) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nsVjf-00063q-FC for bug-gnu-emacs@gnu.org; Sat, 21 May 2022 16:30:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nsVjf-0004jS-7P for bug-gnu-emacs@gnu.org; Sat, 21 May 2022 16:30:03 -0400 X-Loop: help-debbugs@gnu.org Resent-From: "Basil L. Contovounesios" Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 21 May 2022 20:30:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 55562 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.165316496018113 (code B ref -1); Sat, 21 May 2022 20:30:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 21 May 2022 20:29:20 +0000 Original-Received: from localhost ([127.0.0.1]:43036 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nsVix-0004i4-H8 for submit@debbugs.gnu.org; Sat, 21 May 2022 16:29:19 -0400 Original-Received: from lists.gnu.org ([209.51.188.17]:36838) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nsVis-0004hu-Rr for submit@debbugs.gnu.org; Sat, 21 May 2022 16:29:18 -0400 Original-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 ) id 1nsVis-0002MC-L8 for bug-gnu-emacs@gnu.org; Sat, 21 May 2022 16:29:14 -0400 Original-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 ) id 1nsViq-0005rO-2n for bug-gnu-emacs@gnu.org; Sat, 21 May 2022 16:29:13 -0400 Original-Received: by mail-wm1-x336.google.com with SMTP id h205-20020a1c21d6000000b003972dda143eso2792504wmh.3 for ; 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) Original-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 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 21 May 2022 13:29:06 -0700 (PDT) Received-SPF: pass client-ip=2a00:1450:4864:20::336; envelope-from=contovob@tcd.ie; 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-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:232853 Archived-At: --=-=-= 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" 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 --=-=-=--