From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Ihor Radchenko Newsgroups: gmane.emacs.devel Subject: Re: `unreadablep' Date: Wed, 15 Dec 2021 18:20:23 +0800 Message-ID: <87o85itbiw.fsf@localhost> References: <87bl1imhnd.fsf@gnus.org> <87r1aetgdn.fsf@localhost> <871r2eryaz.fsf@yahoo.com> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="3707"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Lars Ingebrigtsen , emacs-devel@gnu.org To: Po Lu Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Wed Dec 15 11:20:27 2021 Return-path: Envelope-to: ged-emacs-devel@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 1mxROd-0000oc-9G for ged-emacs-devel@m.gmane-mx.org; Wed, 15 Dec 2021 11:20:27 +0100 Original-Received: from localhost ([::1]:49200 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mxROb-0003Yl-Vw for ged-emacs-devel@m.gmane-mx.org; Wed, 15 Dec 2021 05:20:26 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:35196) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mxRNL-0002rp-Eq for emacs-devel@gnu.org; Wed, 15 Dec 2021 05:19:07 -0500 Original-Received: from [2a00:1450:4864:20::135] (port=38556 helo=mail-lf1-x135.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mxRNJ-00058O-FA for emacs-devel@gnu.org; Wed, 15 Dec 2021 05:19:07 -0500 Original-Received: by mail-lf1-x135.google.com with SMTP id bi37so42236528lfb.5 for ; Wed, 15 Dec 2021 02:19:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:in-reply-to:references:date:message-id :mime-version; bh=yaVxUB7A3+gKCWetTM3gQ9hU8S/oE+aJhHdUOxRNCUY=; b=jFnV1MMw/70ttfAPwyMx5C2d23W9lCb6WFZulIsArW/YwVREr1oaQ6sz4yZGvCxCdR ukXcfrnJEtfRwun/Grn5XKGV2T0WgcA2woV0xDA60ng74o1OYDWVoJSwKF30/A+vwqGG J0rnOoGqdle+OUuOkkm1FEq4HkZWinzXNXZlPy19b0h5m0FbLBp0Yx5ZpPd6eqfVaWef ZsSEcT+NK6E0fcoWR9OXHfqnz9A1Ob/Fk+5dPG5aADqyVXWWctDp8KXLLDCtDSDGzq9B Qb3IDIPfwFag89yp1CCCYvouiafCPAPql4r/G67BSptwfkY6VcxL5tDH+5mOCblBhYXi 9LEg== 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:in-reply-to:references:date :message-id:mime-version; bh=yaVxUB7A3+gKCWetTM3gQ9hU8S/oE+aJhHdUOxRNCUY=; b=io1RVjgaKi10Ntbf7rR5T78B2+ADHMbziNC1WHnt5z62Ap7+qM3qnmLlwXL4I1E20t teJS+HWTkYKHJeEFWibVv18peOmPqvt6Kj90qgCNkaODZh1m47U3zq2fo3P6iD+4sLiK BAuMapFLRy3xHFOyM3K8fsQHAM2K3IJGUzPBqF4b10y2d6Oyfk52t807MvyIIRRchFrU BDoBpFo1CbdCCybLyZAXK9tqWoDGGjJPrq9GOMDR3aNeKZb69ewEXue2Jm56lMgkMn5F wQxiT6sXgCa+gSnvbZAIaUn6Zn5N2JeX4Nc5tDboND1umUDeRih5Alz+jfG9SmJzmOUf Fzpw== X-Gm-Message-State: AOAM532X+yodIDpdzkIWz9PkeNAaFafhlVeRNHt6cUnuC4mUxgnlTa8p TlIrtYgoHsIZ2fOZxkfPBWM= X-Google-Smtp-Source: ABdhPJwbmasVVlKYUHEF8iRz762WKHovtQzWO02lFklpHuNV0avoogl4KGVqVDLHpnvDZyPGrArDBw== X-Received: by 2002:a05:6512:23a4:: with SMTP id c36mr9440212lfv.125.1639563542374; Wed, 15 Dec 2021 02:19:02 -0800 (PST) Original-Received: from localhost ([141.105.67.194]) by smtp.gmail.com with ESMTPSA id k27sm353459ljc.129.2021.12.15.02.19.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 Dec 2021 02:19:01 -0800 (PST) In-Reply-To: <871r2eryaz.fsf@yahoo.com> X-Host-Lookup-Failed: Reverse DNS lookup failed for 2a00:1450:4864:20::135 (failed) Received-SPF: pass client-ip=2a00:1450:4864:20::135; envelope-from=yantar92@gmail.com; helo=mail-lf1-x135.google.com X-Spam_score_int: -10 X-Spam_score: -1.1 X-Spam_bar: - X-Spam_report: (-1.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, FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:282004 Archived-At: Po Lu writes: > Ihor Radchenko writes: > >> I can see a use of adding extra argument to prin1. If the argument is >> set, prin1 errors when attempting to print unreadable object or >> alternatively prints nil (or other symbol) instead of the unreadable >> object. > > Why an extra argument, and not a variable, say, > `throw-printing-unreadably'? There are many callers of prin1 that could > benefit from this. Variable would indeed be better. Using variable is more consistent with the existing behaviour. prin1 can already be controlled by variables like print-level, print-circle, etc Though the name should probably start with print-. Maybe something like print-unreadable (t by default, nil will make prin1 throw an error, and 'replace to print the value of print-unreadable-as instead of unreadable object). Yet another option may be not printing anything when print-unreadable is t and throwing an error when print-unreadable is 'error, but I am not sure if that much customisation is too much. Best, Ihor