From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Lars Ingebrigtsen Newsgroups: gmane.emacs.devel Subject: `unreadablep' Date: Wed, 15 Dec 2021 08:49:58 +0100 Message-ID: <87bl1imhnd.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="39778"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Wed Dec 15 09:17:54 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 1mxPU1-000ADo-VN for ged-emacs-devel@m.gmane-mx.org; Wed, 15 Dec 2021 09:17:53 +0100 Original-Received: from localhost ([::1]:33592 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mxPU0-0003d8-Uh for ged-emacs-devel@m.gmane-mx.org; Wed, 15 Dec 2021 03:17:52 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:52460) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mxP38-0001wi-1d for emacs-devel@gnu.org; Wed, 15 Dec 2021 02:50:08 -0500 Original-Received: from [2a01:4f9:2b:f0f::2] (port=39632 helo=quimby.gnus.org) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mxP36-000213-0N for emacs-devel@gnu.org; Wed, 15 Dec 2021 02:50:05 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Content-Type:MIME-Version:Message-ID:Date:Subject:To:From: Sender:Reply-To:Cc:Content-Transfer-Encoding:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: In-Reply-To:References:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=JO8864W8Rzsyda4dumXDYXR+Ck6h2xmzyvtuHbMdT+o=; b=NkBpTgKFKWMSlVBoYR6YCvcNOo Xok+h5FGVGz77WwoRHrTkHGEe2p8Ymp/dlFn+TuJwxAIQ1UTU/+j0QFNuJqw/ckwOKXkiToCHa3YN nXAWqd7BryPwfxrM3ShOtyV4PfOaeIe3lO2qU0DKrhRFCgU0v3lm7dhSbY59tSmOau9c=; Original-Received: from [84.212.220.105] (helo=xo) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mxP31-0002tf-1Q for emacs-devel@gnu.org; Wed, 15 Dec 2021 08:50:01 +0100 Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAABGdBTUEAALGPC/xhBQAAACBj SFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAAElBMVEWwjWtxQT+fUEzR saT49O3///+dfHtVAAAAAWJLR0QF+G/pxwAAAAd0SU1FB+UMDwcUDUKeYKsAAAGRSURBVDjLfZIB YsMgCEUVcwDjLqCYAzjJAbra+59pH026dHWjasUX+BFizNzs5Cz+CcIUUB8TYEeyWao/xKPxhjtI 66t1/wrC9YmowNvoiWMki10ICe4AkZA4es82Ugwp2XQCNjjpgA2nlNgPDZ+sPwAZZmtPECydIJg4 wKnBAIGtD0j1AsyIQApP11Ts8VZhTWHlAHUOIwJ30xbQccFQjwtCT2tUMB3DPghhAK4smOIUiC7L Ud3FCKzgZ5w0pw6eEgVwdjhiFvzvpWHfToABkR5cMOBCQ4aw6TtXXjpYZq0dYuUdPNTktIfsD9GT rwEu1nZxUyCtIWoCbjidgdaPO3gK672xtNykA+JXs8wr728g6Vx5+TKNcl3yPW+u1lxdZKoun2B3 krdM91wkW1vNAJxZsuScuWZUhy6Aar4BUN3QSbpXOUCstx4BwAD1AA/Sjg+Qn6C/LsSlg09Vq/Ve tg4YX+LWXI5cI0sspOIKbOKohS7jpqGvPZUxWjpFPwXYf1VXK4mOYH3vx2H/AJnb5zdoRIS3tuUh TAAAACV0RVh0ZGF0ZTpjcmVhdGUAMjAyMS0xMi0xNVQwNzoyMDoxMyswMDowMC/FjEoAAAAldEVY dGRhdGU6bW9kaWZ5ADIwMjEtMTItMTVUMDc6MjA6MTMrMDA6MDBemDT2AAAAAElFTkSuQmCC X-Now-Playing: Scritti Politti's _Cupid & Psyche 85_: "Lover To Fall" X-Host-Lookup-Failed: Reverse DNS lookup failed for 2a01:4f9:2b:f0f::2 (failed) Received-SPF: pass client-ip=2a01:4f9:2b:f0f::2; envelope-from=larsi@gnus.org; helo=quimby.gnus.org X-Spam_score_int: -35 X-Spam_score: -3.6 X-Spam_bar: --- X-Spam_report: (-3.6 / 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, RCVD_IN_DNSWL_MED=-2.3, RDNS_NONE=0.793, 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:281987 Archived-At: Do we have any primitive that can be used to check whether an object is printable or not? Code like this (from savehist.el) makes me believe "not": ;; Print elements of VALUE one by one, carefully. (dolist (elt value) (let ((start (point))) (insert " ") ;; Try to print and then to read an element. (condition-case nil (progn (prin1 elt (current-buffer)) (save-excursion (goto-char start) (read (current-buffer)))) (error ;; If writing or reading gave an error, comment it out. (goto-char start) (insert "\n") (while (not (eobp)) (insert ";;; ") (forward-line 1)) (insert "\n"))) (goto-char (point-max)))) It would be nice to have such a function (i.e., that says whether it can be read back after printing it). The problem is, of course, complex structures that require recursing (and then checking for loops), etc, so you basically have to implement it the way printing is done if you want it to be fast, I think? Does anybody have any thoughts on this issue? I wonder whether this could be efficiently implemented by, say, having some kind of special value for PRINTCHARFUN for prin1, but I haven't looked at the code yet. -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no