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 19:39:10 +0800 Message-ID: <877dc6t7vl.fsf@localhost> References: <87bl1imhnd.fsf@gnus.org> <87r1aetgdn.fsf@localhost> <871r2eryaz.fsf@yahoo.com> <87o85itbiw.fsf@localhost> <87sfuuqic1.fsf@yahoo.com> <87ilvqtasn.fsf@localhost> <87bl1iqh9u.fsf@yahoo.com> <87a6h2t94n.fsf@localhost> <877dc6qft0.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="15756"; 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 13:06:33 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 1mxT3I-0003z8-OL for ged-emacs-devel@m.gmane-mx.org; Wed, 15 Dec 2021 13:06:32 +0100 Original-Received: from localhost ([::1]:52790 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mxT3H-0002HL-DV for ged-emacs-devel@m.gmane-mx.org; Wed, 15 Dec 2021 07:06:31 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:59078) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mxSba-0006lX-Aa for emacs-devel@gnu.org; Wed, 15 Dec 2021 06:37:54 -0500 Original-Received: from [2a00:1450:4864:20::233] (port=46775 helo=mail-lj1-x233.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mxSbY-00018s-5V for emacs-devel@gnu.org; Wed, 15 Dec 2021 06:37:53 -0500 Original-Received: by mail-lj1-x233.google.com with SMTP id a37so31764576ljq.13 for ; Wed, 15 Dec 2021 03:37:49 -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=6Sbb2m/dNl9n7vv0Nik1vYQcTXH8SgFRBApcjzN38Og=; b=Rlg2b+KB9gednE2pIrIZEIkASJ6wND5PXLa5JnaEjnQ4AivRJyVkO2Kv5/vOO9gVsI +x7zAZAvaf94Zn3NkQt9KJC2pAW117D3WXliixr0lMyNlrPIGh2xDV7sBXGLCutewqO2 9UIKTJQqdg9bebCR90gPiqpAPLpDPoLhaVNnhH4hGQpSyMjvTXkCCMkJmwD0dFhPa+28 dbojC9mNCOhxehlwbbzbK5j7yTpr0q2WYtvDvahhJUxM6uH7n86ZZcUEWhnPULqRhBxG UqQXHA23at34TODewYJCeTnkg6sE7OBZ4LbO1nFVVO2DmjIm7XZxISEV2LZnFKci8pVD jN3Q== 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=6Sbb2m/dNl9n7vv0Nik1vYQcTXH8SgFRBApcjzN38Og=; b=oWr8Kuvspov34tfOuAL91/vkRaluwDZPJJZU4yGIsT1Lutiwt3N307/8SAn1Qoqm7G jqN/5C0UXCOghQeASwFm1qKbnT6TMatXhtOHDhw9QDs/AaoOxZHMpIfymTrfj55/5uOm JhORMflqc8UCf+/hWpYqh+73B6mtVlJCqNo50FytTv5RpgOMGMNiEgzvYR+3yk4Qv/ml Qd225xMOM/d3q3y73syJoLesDRMmBF+XmMb7zmBYprjFMfoLuHHMOvIVyEZv4caTfpKB T0Clem+ugwxoBgbISiBzXN+QUobLU42g2LNXEMun1xzmKfMhi2a+uxkfoRUy0vnVbfx1 XI2Q== X-Gm-Message-State: AOAM532ZmL5Yapt5i0BaKAShVzxFu8QIu0EW/oZWMCCExAA7mMlmHmFC ZtGITA3OXKGkEleKoXmI+vc= X-Google-Smtp-Source: ABdhPJxvo4I8FoC1BXG+UAm0vPsaq3wOV6P7p5JK2YMNqLzaAoeGdrMie6fMLJXBjdaPM7nA9lCt2w== X-Received: by 2002:a2e:9d8f:: with SMTP id c15mr10517468ljj.477.1639568267935; Wed, 15 Dec 2021 03:37:47 -0800 (PST) Original-Received: from localhost ([141.105.67.194]) by smtp.gmail.com with ESMTPSA id bp36sm284459lfb.0.2021.12.15.03.37.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 Dec 2021 03:37:47 -0800 (PST) In-Reply-To: <877dc6qft0.fsf@yahoo.com> X-Host-Lookup-Failed: Reverse DNS lookup failed for 2a00:1450:4864:20::233 (failed) Received-SPF: pass client-ip=2a00:1450:4864:20::233; envelope-from=yantar92@gmail.com; helo=mail-lj1-x233.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:282017 Archived-At: Po Lu writes: >> Do you imply that `print-unreadable-function' should return the new >> value to be printed? If so, it is indeed more flexible. Passing the >> unreadable value to the function would also be useful (e.g. we can print >> buffer file name instead of buffer object). > > It would accept a function that is called to print characters, like the > `printcharfun' argument to prin1. I was confused by the name. `printcharfun' in prin1 can be a buffer, a marker, etc. Doing the same for the `print-unreadable-function' makes it tricky to implement. How does `print-unreadable-function' print into a buffer or marker? It would be cumbersome to consider all such cases if the user simply wants to print nil in place of unreadable objects. If the `printcharfun' passed to `print-unreadable-function' is strictly an ordinary function that does actual printing, I can see a problem with circular objects. Consider something like (#1=a # #2=b #1 #1 #2). If the main print loop is not aware of what was printed by `print-unreadable-function' and the function tries to print reference to b, we may get incorrect object: (#1=a b #2=b #1 #1 #2) The object printed instead of unreadable value will break circular structure. Of course, the described problem will depend on the details of implementation. Best, Ihor