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: Mon, 27 Jun 2022 23:43:59 +0300 Message-ID: <8735fpkfao.fsf@tcd.ie> References: <87czg6635b.fsf@tcd.ie> <835yly8852.fsf@gnu.org> Reply-To: "Basil L. Contovounesios" Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="37114"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) Cc: 55562@debbugs.gnu.org, Daniel Colascione , Stefan Monnier To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Jun 27 22:45:19 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 1o5vbi-0009Lr-Gq for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 27 Jun 2022 22:45:18 +0200 Original-Received: from localhost ([::1]:48736 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o5vbg-00051b-PK for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 27 Jun 2022 16:45:16 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:52070) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o5vbT-00051R-0A for bug-gnu-emacs@gnu.org; Mon, 27 Jun 2022 16:45:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:59506) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1o5vbS-0007g2-KW for bug-gnu-emacs@gnu.org; Mon, 27 Jun 2022 16:45:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1o5vbS-0005wu-IP for bug-gnu-emacs@gnu.org; Mon, 27 Jun 2022 16:45:02 -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: Mon, 27 Jun 2022 20:45: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.165636265222758 (code B ref 55562); Mon, 27 Jun 2022 20:45:02 +0000 Original-Received: (at 55562) by debbugs.gnu.org; 27 Jun 2022 20:44:12 +0000 Original-Received: from localhost ([127.0.0.1]:53397 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o5vad-0005uz-RZ for submit@debbugs.gnu.org; Mon, 27 Jun 2022 16:44:12 -0400 Original-Received: from mail-ej1-f52.google.com ([209.85.218.52]:45947) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o5vab-0005ui-41 for 55562@debbugs.gnu.org; Mon, 27 Jun 2022 16:44:10 -0400 Original-Received: by mail-ej1-f52.google.com with SMTP id h23so21524465ejj.12 for <55562@debbugs.gnu.org>; Mon, 27 Jun 2022 13:44:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tcd.ie; s=google21; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-transfer-encoding; bh=4mAsNRbtDdMAOMTBTmMV1J/hDgdRMDpZtd0Ij5Ptims=; b=aco7BBSCrPE3gIDixf62ljqkyo6/TJCtUAXtB5af8LTeRn3N0HUCxoozZMJUW+ChY5 Fnf4QcsdcJoXIk+PtqCIzhFKHg/W1GaF0M/r9PS7EtR8eMDEz20Z+LASWpqPXJZJMqN/ 9X3eN0DTL9/j2xXCoik3lIIBZAKrjYPz8oDjPUDUQLjMV54Y8bRz2qE0Lv95TRznp7oq /HEN9NnG6IsgTYbTqwAX9y+ZCZUiAFgHestlKqwavbZfVuMr1sJiZRHkql9D9Te5YIdu GMYiCg8PaaXCtEUOr/Im4V4y+6XtJHO9NY/caMUN5/tGseFp9K4PIkUGa2NKkBgKNM+2 7TKw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version:content-transfer-encoding; bh=4mAsNRbtDdMAOMTBTmMV1J/hDgdRMDpZtd0Ij5Ptims=; b=ZEt7Gmjxik6APmWfj2FdLX3ZEymlYm8MC09Mr3qGRpvQn9KmiPilDb/qNJkGmrmLrF oUdW65dqRqHRuZ7YAoRF/9I97P4YHkgEk9uCxYry/v5MoYroV3PrqmuP3MRraapkY2Sq op6ol1/Xv/19UT9iU26ZZbE2jQV8SOazktd0UCP5K9v2+NuEBksYlogewQOllosPREcn AJC07beq7QqaxZMVYtIFmaCg5mDfJbvkWbIu4albmIyg5AW9jDEiFbyRjJTxDe1MeE5f qKbpL16MYNBNyu7ZURb4sVahA3HaZthHuKmDo3s7TUOMHMA76iXj5u9pRHWUbZpvP2Z8 gLgQ== X-Gm-Message-State: AJIora84Ds0HXeRDM3aXbLpCJFLLDo12SV8bFUAk6fn6KqPFBKO2Mbok qT59cUiYHAAbALlbSf48VM77Jg== X-Google-Smtp-Source: AGRyM1sboQjaNsdu+jfKjTuJDclNxxL619bkqOx3u2PGDwoRB7kxkrVJ9kITjUxJnJduFjaJgIWaPg== X-Received: by 2002:a17:907:6d1d:b0:726:363e:cca3 with SMTP id sa29-20020a1709076d1d00b00726363ecca3mr14390405ejc.713.1656362643222; Mon, 27 Jun 2022 13:44:03 -0700 (PDT) Original-Received: from localhost ([2a02:587:322b:6f5e:dc92:136a:a7c4:dc8c]) by smtp.gmail.com with ESMTPSA id t17-20020a1709067c1100b00711d5baae0esm5489838ejo.145.2022.06.27.13.44.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 Jun 2022 13:44:02 -0700 (PDT) In-Reply-To: <835yly8852.fsf@gnu.org> (Eli Zaretskii's message of "Sun, 22 May 2022 01:10:52 -0400") 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:235497 Archived-At: Eli Zaretskii [2022-05-22 01:10 -0400] wrote: > [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" >>=20 >> Severity: minor >> Tags: patch >>=20 >> 0. emacs -Q >> 1. C-h f clrhash RET >>=20 >> > Clear hash table TABLE and return it. >>=20 >> 2. C-h S clrhash RET >>=20 >> > Common Lisp note: In Common Lisp, =E2=80=98clrhash=E2=80=99 returns th= e empty >> > TABLE. In Emacs Lisp, it returns =E2=80=98nil=E2=80=99. >>=20 >> It seems the following changes never propagated to the manual: >>=20 >> (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 >>=20 >> * 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 >>=20 >> And the following change wasn't announced in etc/NEWS either: >>=20 >> (Fclrhash): Return TABLE. >> ccd8f7fe14 2008-01-25 10:01:15 +0000 >> https://git.sv.gnu.org/cgit/emacs.git/commit/?id=3Dccd8f7fe14 >>=20 >> Is there any point in announcing the status quo, or can we just update >> the manual, e.g. as follows? >>=20 >> >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 >>=20 >> * 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(-) >>=20 >> 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 >>=20=20 >> @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 >>=20=20 >> @defun maphash function table >> --=20 >> 2.35.1 Is this suitable for Emacs 28? Thanks, --=20 Basil