From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Matt Newsgroups: gmane.emacs.bugs Subject: bug#69745: [PATCH] Fix incorrect Edebug docstrings Date: Fri, 15 Mar 2024 18:22:55 +0100 Message-ID: <18e43236053.ea8d2a62434521.1358079795129399231@excalamus.com> References: <18e31efc662.110b51b75233014.2760074093528628525@excalamus.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_Part_1428726_1091533694.1710523375699" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="28923"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Zoho Mail Cc: 69745 <69745@debbugs.gnu.org> To: "Andreas Schwab" Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Mar 15 18:27:40 2024 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 1rlBLI-0007H5-9c for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 15 Mar 2024 18:27:40 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rlBL6-0000Ow-8e; Fri, 15 Mar 2024 13:27:28 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rlBL4-0000OS-91 for bug-gnu-emacs@gnu.org; Fri, 15 Mar 2024 13:27:26 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rlBL3-0006YM-Ke for bug-gnu-emacs@gnu.org; Fri, 15 Mar 2024 13:27:26 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rlBLe-0002Mk-04 for bug-gnu-emacs@gnu.org; Fri, 15 Mar 2024 13:28:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Matt Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 15 Mar 2024 17:28:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 69745 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 69745-submit@debbugs.gnu.org id=B69745.17105236559061 (code B ref 69745); Fri, 15 Mar 2024 17:28:01 +0000 Original-Received: (at 69745) by debbugs.gnu.org; 15 Mar 2024 17:27:35 +0000 Original-Received: from localhost ([127.0.0.1]:53695 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rlBLD-0002M4-3p for submit@debbugs.gnu.org; Fri, 15 Mar 2024 13:27:35 -0400 Original-Received: from sender4-pp-f112.zoho.com ([136.143.188.112]:27207) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rlBHO-0002Eu-SJ for 69745@debbugs.gnu.org; Fri, 15 Mar 2024 13:23:42 -0400 ARC-Seal: i=1; a=rsa-sha256; t=1710523377; cv=none; d=zohomail.com; s=zohoarc; b=Lq4A+ziJllH7IKIuTVirHfi94sbZnSt7w6efxMmXuC4PJylTUZEGdMeYuOuX2FjrYg+p1fnDdjK5lo533yLWqbhrBr2WtKOy2z1uoX59jtNg/ngTlGb34GPPP89uv6oyL5VOd38Sg6kbQtglJZQpBkRlHUJamX3hsV40BZNyJUo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1710523377; h=Content-Type:Cc:Cc:Date:Date:From:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:Subject:To:To:Message-Id:Reply-To; bh=eVVkXuMVx48GY1DeA0GbyTYtIFoKQFJLzN3oFsNU9Ns=; b=axtc3cvVfkkqj+w/EkNp7k0MC7xXWMUJXi2N1SyrDNcZrHjNajSHlm8GAIiv4I01RVudBxN6EELIuNzR+HGEUD8CnCGBXY+4lpIHuDVz0FXugJOu9+kq/zfAAZ06TwdiPhXg7xAmELQYSwPQAM9s0zus4uEI8WXAdHl/iSvBk1M= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass header.i=excalamus.com; spf=pass smtp.mailfrom=matt@excalamus.com; dmarc=pass header.from= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1710523377; s=zmail; d=excalamus.com; i=matt@excalamus.com; h=Date:Date:From:From:To:To:Cc:Cc:Message-Id:Message-Id:In-Reply-To:References:Subject:Subject:MIME-Version:Content-Type:Reply-To; bh=eVVkXuMVx48GY1DeA0GbyTYtIFoKQFJLzN3oFsNU9Ns=; b=J2szl8cLPJ1KE77/wZjZCsbctsybuOR5FZrjtA50W3SrA9xZ3DJiwQdqBzPe45O/ vQ+pRsQr897kY+c2zoJ+SINjDylem4SJ7EziTigefdFsEH558JAxKt2tM7WHo8VGEFS VzBAaRuRSYDVzNWfjKQbqZF5pH3AhG5nP9yiZ6zU= Original-Received: from mail.zoho.com by mx.zohomail.com with SMTP id 1710523375729200.16209540255284; Fri, 15 Mar 2024 10:22:55 -0700 (PDT) In-Reply-To: Importance: Medium X-Mailer: Zoho Mail X-Zoho-Virus-Status: 1 X-Zoho-AV-Stamp: zmail-av-1.1.0/210.452.42 X-Mailman-Approved-At: Fri, 15 Mar 2024 13:27:34 -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-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:281692 Archived-At: ------=_Part_1428726_1091533694.1710523375699 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable ---- On Tue, 12 Mar 2024 13:59:58 +0100 Andreas Schwab wrote ---=20 > On M=C3=A4r 12 2024, Matt wrote: >=20 > > When edebug-print-length and edebug-print-level are nil, they default = to print-level and print-length. The docstrings currently say the opposite= , that edebug defaults to the print variables if non-nil. >=20 > That's not correct. The edebug-print-* variables, when non-nil, > override the corresponding print-* variables during printing (see > edebug-safe-prin1-to-string). When they are nil, they have no effect. >=20 > > (defcustom edebug-print-length 50 > > - "If non-nil, default value of `print-length' for printing results i= n Edebug." > > + "If nil, default value of `print-length' is used for printing resul= ts in Edebug." >=20 > That fails to say what happens if it is non-nil, which is the actual > relevant information. Thanks for taking the time to review this. =20 You are correct in the functioning. The problem is the current docstrings = are ambiguous. Consider the current description for 'edebug-print-length': "If non-nil, default value of =E2=80=98print-length=E2=80=99 for printing r= esults in Edebug." This has, at least, two possible interpretations: 1. "If non-nil, USE THE VALUE OF EDEBUG-PRINT-LENGTH FOR THE default value = of 'print-length' for printing results in Edebug." =20 2. "If non-nil, USE THE default value of 'print-length' for printing result= s in Edebug." =20 =20 As you point out, the first meaning is the intended one based on the implem= entation. I read it according to the second interpretation. Without getting hung up on why it's ambiguous, I hope I've made the case th= at it is ambiguous. I've updated the patch to use the same wording as 'print-length' and 'print= -level' which hopefully makes things clear. The current docstring felt it= necessary to explicitly mention "for printing results in Edebug" and I've = tried to preserve that in the suggested changes. -- Matt Trzcinski Emacs Org contributor (ob-shell) Learn more about Org mode at https://orgmode.org Support Org development at=C2=A0https://liberapay.com/org-mode ------=_Part_1428726_1091533694.1710523375699 Content-Type: application/octet-stream; name=v02-fix-incorrect-edebug-docstring.diff Content-Transfer-Encoding: 7bit X-ZM_AttachId: 139298161756990370 Content-Disposition: attachment; filename=v02-fix-incorrect-edebug-docstring.diff diff --git a/lisp/emacs-lisp/edebug.el b/lisp/emacs-lisp/edebug.el index 4c7dbb4ef8c..8be066d0f61 100644 --- a/lisp/emacs-lisp/edebug.el +++ b/lisp/emacs-lisp/edebug.el @@ -193,10 +193,12 @@ Use this with caution since it is not debugged." (defcustom edebug-print-length 50 - "If non-nil, default value of `print-length' for printing results in Edebug." + "Maximum length of list to print before abbreviating while in `edebug-mode'. +When nil, behave according to `print-length'." :type '(choice integer (const nil))) (defcustom edebug-print-level 50 - "If non-nil, default value of `print-level' for printing results in Edebug." + "Maximum depth of list nesting to print before abbreviating while in `edebug-mode'. +When nil, behave according to `print-level'." :type '(choice integer (const nil))) (defcustom edebug-print-circle t "If non-nil, default value of `print-circle' for printing results in Edebug." ------=_Part_1428726_1091533694.1710523375699--