From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Po Lu Newsgroups: gmane.emacs.devel Subject: Re: `unreadablep' Date: Wed, 15 Dec 2021 20:42:03 +0800 Message-ID: <87ilvqox9g.fsf@yahoo.com> References: <87bl1imhnd.fsf@gnus.org> <87h7bas2kb.fsf@yahoo.com> <87wnk6l0yu.fsf@gnus.org> <87czlyryq0.fsf@yahoo.com> <87sfuuktj2.fsf@gnus.org> <8735muqfcy.fsf@yahoo.com> <87k0g6kqmh.fsf@gnus.org> <87v8zqoy6v.fsf@yahoo.com> <87fsqukpun.fsf@gnus.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="19911"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.60 (gnu/linux) Cc: emacs-devel@gnu.org To: Lars Ingebrigtsen Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Wed Dec 15 13:55:35 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 1mxTol-0004xY-4Z for ged-emacs-devel@m.gmane-mx.org; Wed, 15 Dec 2021 13:55:35 +0100 Original-Received: from localhost ([::1]:33078 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mxTok-0007VL-6V for ged-emacs-devel@m.gmane-mx.org; Wed, 15 Dec 2021 07:55:34 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:48810) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mxTc6-0004Oz-Jv for emacs-devel@gnu.org; Wed, 15 Dec 2021 07:42:30 -0500 Original-Received: from sonic304-21.consmr.mail.ne1.yahoo.com ([66.163.191.147]:42113) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mxTc0-0005lM-Pt for emacs-devel@gnu.org; Wed, 15 Dec 2021 07:42:28 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1639572135; bh=c3uEA/98zRKqWcpfyPmSf1TXWkafMlccd8v5jpngqeo=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From:Subject:Reply-To; b=YMoNCO8qkhPGJH7Nn++QUIsQTnfnKpXoj74bReJtlNkW0OtfPydJDUF9GUhrLXkBq82GgiiPt2KMg3wgoiAZad+4NNGH5p9SbLCzBpTA8hwxOTL9vKyVy2C3dAXAzy1FdF0MtVEmXQbkPAiPIqcn+EKGD26BC2TH3gfgw8lYha+ga8rfxstnztnGfmwkrvKqwFwvr3HdqwHMEQSeXAlfU/kcGFK3SaGZP+anQi6HehqxnMzzbysLInvVI+q4fwFqOqGrvz64EKocrSLwyzM9m5qKxETc78FDOxSAt+zCAs4XYLkFhgnVkFJfFX4+lMAZ4bLrBmjP8yqK0ae4vFWgdA== X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1639572135; bh=5Kw7Kz9ylBa79k2TWi7AJyEqHTLnxQrwDPzKYJfVAM3=; h=X-Sonic-MF:From:To:Subject:Date:From:Subject; b=bVMQ7/29zOHiebs4l3/ChMhh5+z7YH5bMVwQo6P9m3FBZPwzcXeF6/4pmGatGiyrE6Gwjw348gThbTzrKKY6Li3NE6uFoSJ+PgWYSYI/0rdc6fyJnOIx6pGK+KKoArY4uPKF9l0pgzrgPi8c4JUy3ceG0RHFToImuae9jBmKEa8ezopzMGHZagKDCA4CziOffS+L68Cd5APQAnNFPzwL/UptM337yzt8W6SujWV5l5Ae+M865MDwiXUwN80rBNh9hBgKCyFIm3uvL7EFqNlN6ptJ2P4947J/6QKcLkl9gGtkqnTfpKWwQ0dWroNF8LCNtZnJtwKksfkLSU60mqbSaw== X-YMail-OSG: ZgtHe2QVM1kK4u2jbN.Q9s12Ot.J2x5FsYFucLbQyx12nCUPwhH1RtrYy60eWtX YL_dtUjA6jEQsltCzvSHSvhd5qbEIx0hUrNW.qBqnzjrAHobHIa2VeMZW.9QB6Z_JdCwbjIhGBeM DuUS4wBtWPGmtcYwOzQTBMbntd.UYoXGU_qMi3yZGw2ORjl6FNrdGc3LTb5dbvfPN3dDJWEgrBwU 1yZ9s1qqPJmFwjrcbpuccaTvd6wQGMOLKB2AoBOnYBiig2IpHSSJFRhR.w1raMSrazqGM8F47JMB ifxalQoXeH52OQjOKVjlpOnK2GoQxx4KFhhwYQE7mRwyknv_D0TLwUjGu4I6z8VLAy6ny7IMcLe0 yRT7MLPrk_8aoGKIBkUpCJBuijgcnbmOjSFCXg4Ju8lUGQckYN3uFejjLvuKph6KADZ0CJ21QXpO wkOOPAVzZf2a0olAZw1GCcV.I1gBzO0eme1fRMh1Sojd4YQ1TilZ4jqvGFeKdij_pkM8RwK7HS1P foqPbR0zXUtmJvanvPlKb.q1qnAAN05atk0AcmEF4z.MNA1PwydFgcXA00omcf8bRmwU8yVA40yB TkiB4_VbdLyKh1JNIaoVhc25bzTG1wYJR.e3VTqYINDxeViPW75A4VqBxL6PkMeZrhSDrDj6Ik1h RQ5PEKBLYyy57hzyTSQdZiwfM8bcLcLAAA2RZSQ5PGmZUTjza_I1FIvXnQ8.qL9D475dj_quHrR4 cO.U2UghrPt2j7u_fmsMnKBTiqNkKP9SPxlFbPA7DenQ5mKtMjq0sPGPLg1SpcAaUaId_7nGif0C 2PqDgd45Uulna3zh6eCIie5Cu2z2DnD1S3bAwRTALt X-Sonic-MF: Original-Received: from sonic.gate.mail.ne1.yahoo.com by sonic304.consmr.mail.ne1.yahoo.com with HTTP; Wed, 15 Dec 2021 12:42:15 +0000 Original-Received: by kubenode518.mail-prod1.omega.sg3.yahoo.com (VZM Hermes SMTP Server) with ESMTPA ID 0e6400924ea44e33351aa04abb981b67; Wed, 15 Dec 2021 12:42:09 +0000 (UTC) In-Reply-To: <87fsqukpun.fsf@gnus.org> (Lars Ingebrigtsen's message of "Wed, 15 Dec 2021 13:35:44 +0100") X-Mailer: WebService/1.1.19415 mail.backend.jedi.jws.acl:role.jedi.acl.token.atz.jws.hermes.yahoo Received-SPF: pass client-ip=66.163.191.147; envelope-from=luangruo@yahoo.com; helo=sonic304-21.consmr.mail.ne1.yahoo.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, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham 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:282029 Archived-At: Lars Ingebrigtsen writes: > Right... > > Skimming print_object and friends, it seems like the vast majority of > the unprintable objects are in print_vectorlike, so I guess such a > change could be made (pretty much?) locally to that function... Don't we also have Lisp_Misc and friends? (But I'm not sure Lisp_Misc is ever supposed to be printed at all, and I don't see Lisp_Misc anywhere, so perhaps my recollection is faulty.) > So I think doing it that way should be pretty easy to implement, and > it's certainly general enough to be used in both of the cases I > sketched. But the logic would have to be such that if > `print-unreadable-function' returns some special value, then printing > continues as normally (to implement the "just tell me if what was > printed is readable" case). We could have it return nil in that case. > And calling out to Lisp in this case may be slower than the other > solution sketched. Unreadable objects are in general rare in printed objects, and a funcall followed by a test against nil will not add any significant overhead to prin1 either, so I wouldn't be worried about that. Let's not optimize prematurely, especially with something like prin1 :)