Subject: bug#69745: [PATCH] Fix incorrect Edebug docstrings

From: Matt <[email-masked]>
Date: Fri, 15 Mar 2024 18:22:55 +0100

---- On Tue, 12 Mar 2024 13:59:58 +0100  Andreas Schwab  wrote --- 
 > On Mär 12 2024, Matt wrote:
 > 
 > > 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.
 > 
 > 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.
 > 
 > >  (defcustom edebug-print-length 50
 > > -  "If non-nil, default value of `print-length' for printing results in Edebug."
 > > +  "If nil, default value of `print-length' is used for printing results in Edebug."
 > 
 > 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.  

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 ‘print-length’ for printing results 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."  
2. "If non-nil, USE THE default value of 'print-length' for printing results in Edebug."  
 
As you point out, the first meaning is the intended one based on the implementation.  I read it according to the second interpretation.

Without getting hung up on why it's ambiguous, I hope I've made the case that 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 https://liberapay.com/org-mode