From debbugs-submit-bounces@debbugs.gnu.org Mon Mar 12 17:59:32 2018 Received: (at submit) by debbugs.gnu.org; 12 Mar 2018 21:59:32 +0000 Received: from localhost ([127.0.0.1]:57743 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1evVTe-0004zc-C7 for submit@debbugs.gnu.org; Mon, 12 Mar 2018 17:59:32 -0400 Received: from eggs.gnu.org ([208.118.235.92]:60290) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1evVTc-0004zO-Aw for submit@debbugs.gnu.org; Mon, 12 Mar 2018 17:59:28 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1evVTW-0004lY-BU for submit@debbugs.gnu.org; Mon, 12 Mar 2018 17:59:23 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:40239) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1evVTW-0004lM-7s for submit@debbugs.gnu.org; Mon, 12 Mar 2018 17:59:22 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51212) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1evVTV-0001zB-7f for bug-gnu-emacs@gnu.org; Mon, 12 Mar 2018 17:59:21 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1evVTS-0004ip-4r for bug-gnu-emacs@gnu.org; Mon, 12 Mar 2018 17:59:21 -0400 Received: from sub3.mail.dreamhost.com ([69.163.253.7]:53552 helo=homiemail-a15.g.dreamhost.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1evVTR-0004hq-VJ for bug-gnu-emacs@gnu.org; Mon, 12 Mar 2018 17:59:18 -0400 Received: from homiemail-a15.g.dreamhost.com (localhost [127.0.0.1]) by homiemail-a15.g.dreamhost.com (Postfix) with ESMTP id 5F76676C06B for ; Mon, 12 Mar 2018 14:59:16 -0700 (PDT) Received: from localhost.linkov.net (m91-129-108-46.cust.tele2.ee [91.129.108.46]) (using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) (Authenticated sender: jurta@jurta.org) by homiemail-a15.g.dreamhost.com (Postfix) with ESMTPSA id BCA4F76C065 for ; Mon, 12 Mar 2018 14:59:15 -0700 (PDT) From: Juri Linkov To: bug-gnu-emacs@gnu.org Subject: Save text properties in desktop Organization: LINKOV.NET Date: Mon, 12 Mar 2018 23:57:59 +0200 Message-ID: <87k1uhnehk.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x [fuzzy] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) Why does desktop.el not save text properties? Maybe for some historical reasons? This is required for bug#22479. I can't find a problem while trying this patch: diff --git a/lisp/desktop.el b/lisp/desktop.el index 8bd4465..a7e549f 100644 --- a/lisp/desktop.el +++ b/lisp/desktop.el @@ -852,10 +852,7 @@ desktop--v2s ((or (numberp value) (null value) (eq t value) (keywordp value)) (cons 'may value)) ((stringp value) - (let ((copy (copy-sequence value))) - (set-text-properties 0 (length copy) nil copy) - ;; Get rid of text properties because we cannot read them. - (cons 'may copy))) + (cons 'may value)) ((symbolp value) (cons 'must value)) ((vectorp value) From debbugs-submit-bounces@debbugs.gnu.org Mon Mar 12 21:16:48 2018 Received: (at 30786) by debbugs.gnu.org; 13 Mar 2018 01:16:48 +0000 Received: from localhost ([127.0.0.1]:57864 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1evYYZ-0001gP-TF for submit@debbugs.gnu.org; Mon, 12 Mar 2018 21:16:48 -0400 Received: from mail-it0-f44.google.com ([209.85.214.44]:37687) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1evYYZ-0001gC-2k for 30786@debbugs.gnu.org; Mon, 12 Mar 2018 21:16:47 -0400 Received: by mail-it0-f44.google.com with SMTP id k79-v6so14066152ita.2 for <30786@debbugs.gnu.org>; Mon, 12 Mar 2018 18:16:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=QQSEyeJpiwhvEJysaTBf7O9t+rxK69hKj1Rl6sJWooo=; b=Qq44aXGC7g9+r8nwfoH5Z2ncYJtcphcDq5q3z+IZeJ6UQ8mA4F4z1cQytRHN1Zv8BK cRqUmHDqqc4W8TVp/pEXQkCWD2JBttJ6gF4rXT0CYiZhHLyWBzKWvlzTzIbkvKVHq0sf tFtR90aYEymHqqi7M0aa7vOMBHAz5OLBr8/F2K8VqVS0q47La/qxfl0HpOKzILLdnBYQ eel5SzOX8q8jMvjoKWVmPTJ3nl79QksWBec/8Y2rzA4oHvB7xpQHp7m+evdVaMjq+9ep 96Q9dW+qDTXNBHYV+xnCjBp2vk/eT3jDxESxj4bQkz2mJGlJZm1Zg/uplMLXbfiMNlqg Bs/Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=QQSEyeJpiwhvEJysaTBf7O9t+rxK69hKj1Rl6sJWooo=; b=QbxGMqM1F7Wr8aGsOLGSr1L7MbXN9EJ86IYAr3j1GYw0+WeFkwA2OLO8OcCn1AGBRo d1lD2iWYj5RgywQYR28UBGJE7WxAH8dxwGdEdlAvxP5bmiS7Zwe2uJ1vnGhJbz8M30rP +doNm7PIbfqxzZ7YiPQzCKLCZG6KE4fR/Znj7B3367jvHls0wqiF5LrlpuCJyh/L2HHb RjEoc0X4NaFMwhKENqM7KssAxNefnyGlYquM0gvZdq0BPP2sG0HAPiZfZE5yD31wCXuW wQwfXS0XOUA9OCXtm5VYS1NXAM58sg5POY0ztXgGHqnfVhKFdOepvnZDFRZbadDpliSD pX6Q== X-Gm-Message-State: AElRT7FNtz4xycocJuuWwbL4TrjeV92PDX1nHYUIzzwBDxNmjGKDmifJ YA+nuMO8z/KyyGXPXhQPDC1Otg== X-Google-Smtp-Source: AG47ELsOiIYrAMdKm99DnPrhB9eFnF27b9Suib37iTRnHPYmze8pjzON32aYnmj9OkNyhI2/9uNXxQ== X-Received: by 10.36.166.10 with SMTP id q10mr2192101ite.132.1520903801483; Mon, 12 Mar 2018 18:16:41 -0700 (PDT) Received: from zebian (cbl-45-2-119-34.yyz.frontiernetworks.ca. [45.2.119.34]) by smtp.googlemail.com with ESMTPSA id c139sm5917050ioe.5.2018.03.12.18.16.40 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 12 Mar 2018 18:16:40 -0700 (PDT) From: Noam Postavsky To: Juri Linkov Subject: Re: bug#30786: Save text properties in desktop References: <87k1uhnehk.fsf@mail.linkov.net> Date: Mon, 12 Mar 2018 21:16:40 -0400 In-Reply-To: <87k1uhnehk.fsf@mail.linkov.net> (Juri Linkov's message of "Mon, 12 Mar 2018 23:57:59 +0200") Message-ID: <87o9jsydtz.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.90 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 30786 Cc: 30786@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.0 (/) Juri Linkov writes: > Why does desktop.el not save text properties? > Maybe for some historical reasons? > This is required for bug#22479. > I can't find a problem while trying this patch: > - (let ((copy (copy-sequence value))) > - (set-text-properties 0 (length copy) nil copy) > - ;; Get rid of text properties because we cannot read them. I guess this comment is relevant, you can easily have non-readable property values, e.g.: (put-text-property 1 2 'foo (point-marker)). Maybe solving Bug#24982 would help? From debbugs-submit-bounces@debbugs.gnu.org Tue Mar 13 17:59:06 2018 Received: (at 30786) by debbugs.gnu.org; 13 Mar 2018 21:59:06 +0000 Received: from localhost ([127.0.0.1]:60102 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1evrwo-0002Go-Fu for submit@debbugs.gnu.org; Tue, 13 Mar 2018 17:59:06 -0400 Received: from sub3.mail.dreamhost.com ([69.163.253.7]:40781 helo=homiemail-a18.g.dreamhost.com) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1evrwn-0002GG-1e for 30786@debbugs.gnu.org; Tue, 13 Mar 2018 17:59:05 -0400 Received: from homiemail-a18.g.dreamhost.com (localhost [127.0.0.1]) by homiemail-a18.g.dreamhost.com (Postfix) with ESMTP id BF9A8258067; Tue, 13 Mar 2018 14:59:03 -0700 (PDT) Received: from localhost.linkov.net (m91-129-107-5.cust.tele2.ee [91.129.107.5]) (using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) (Authenticated sender: jurta@jurta.org) by homiemail-a18.g.dreamhost.com (Postfix) with ESMTPSA id DA850258066; Tue, 13 Mar 2018 14:59:02 -0700 (PDT) From: Juri Linkov To: Noam Postavsky Subject: Re: bug#30786: Save text properties in desktop Organization: LINKOV.NET References: <87k1uhnehk.fsf@mail.linkov.net> <87o9jsydtz.fsf@gmail.com> Date: Tue, 13 Mar 2018 23:52:04 +0200 In-Reply-To: <87o9jsydtz.fsf@gmail.com> (Noam Postavsky's message of "Mon, 12 Mar 2018 21:16:40 -0400") Message-ID: <877eqfabjv.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 30786 Cc: 30786@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.0 (/) >> Why does desktop.el not save text properties? >> Maybe for some historical reasons? >> This is required for bug#22479. >> I can't find a problem while trying this patch: > >> - (let ((copy (copy-sequence value))) >> - (set-text-properties 0 (length copy) nil copy) >> - ;; Get rid of text properties because we cannot read them. > > I guess this comment is relevant, you can easily have non-readable > property values, e.g.: (put-text-property 1 2 'foo (point-marker)). If the only problem is with non-readable property values then we could check for such values and not to write them to the desktop file. > Maybe solving Bug#24982 would help? This would help on reading the desktop, but maybe better not to save non-readable values in the first place. From debbugs-submit-bounces@debbugs.gnu.org Tue Mar 13 21:10:07 2018 Received: (at 30786) by debbugs.gnu.org; 14 Mar 2018 01:10:07 +0000 Received: from localhost ([127.0.0.1]:60178 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1evuvf-0007X1-BP for submit@debbugs.gnu.org; Tue, 13 Mar 2018 21:10:07 -0400 Received: from aserp2120.oracle.com ([141.146.126.78]:46972) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1evuvc-0007WQ-Ul for 30786@debbugs.gnu.org; Tue, 13 Mar 2018 21:10:05 -0400 Received: from pps.filterd (aserp2120.oracle.com [127.0.0.1]) by aserp2120.oracle.com (8.16.0.22/8.16.0.22) with SMTP id w2E16sbn070872; Wed, 14 Mar 2018 01:09:59 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=mime-version : message-id : date : from : sender : to : cc : subject : references : in-reply-to : content-type : content-transfer-encoding; s=corp-2017-10-26; bh=wQPQWBMTyaxwRNL93BO2Zy1/9bPuBeyJUt7JtoiqmJM=; b=eEnkf8cEPiryGKtgjCNhHraxg6WzvMb5W5IsWvrSpqgMEM2WlPDr1UOihJ3K26nw6/vY 3NwnsQSjdePPtzWHjV+qpfAQm6FVosGdRKlkdIH9SqnQJzATaeWdndSfNYa+pjcoDZXQ NCvZr9h6Xb7O06secok0lZNN9JotGgDLZcueJsk2zaBdia6vL8xaYLpmgcSaEvpDq/5J vFvk/RuklJqTE+93rLRGBIU5thGBD+vx3Zyp5jK1radoL5BXPvd8JlEUcBqokBaevy9Y tuqoW+nl2eSgzZABOLkIVl2v36yR83H5+hiBhbDSzmQBia8QH4Y5Y38obmK1BzXryzqu AQ== Received: from aserv0022.oracle.com (aserv0022.oracle.com [141.146.126.234]) by aserp2120.oracle.com with ESMTP id 2gprh4r6c6-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 14 Mar 2018 01:09:58 +0000 Received: from userv0121.oracle.com (userv0121.oracle.com [156.151.31.72]) by aserv0022.oracle.com (8.14.4/8.14.4) with ESMTP id w2E19voN019057 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 14 Mar 2018 01:09:58 GMT Received: from abhmp0007.oracle.com (abhmp0007.oracle.com [141.146.116.13]) by userv0121.oracle.com (8.14.4/8.13.8) with ESMTP id w2E19vpt017987; Wed, 14 Mar 2018 01:09:57 GMT MIME-Version: 1.0 Message-ID: Date: Tue, 13 Mar 2018 18:09:55 -0700 (PDT) From: Drew Adams To: Juri Linkov , Noam Postavsky Subject: RE: bug#30786: Save text properties in desktop References: <87k1uhnehk.fsf@mail.linkov.net> <87o9jsydtz.fsf@gmail.com> <877eqfabjv.fsf@mail.linkov.net> In-Reply-To: <877eqfabjv.fsf@mail.linkov.net> X-Priority: 3 X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.9.1 (1003210) [OL 16.0.4666.0 (x86)] Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=8831 signatures=668690 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=955 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1711220000 definitions=main-1803140009 X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 30786 Cc: 30786@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.0 (/) > > I guess this comment is relevant, you can easily have non-readable > > property values, e.g.: (put-text-property 1 2 'foo (point-marker)). >=20 > If the only problem is with non-readable property values then we could > check for such values and not to write them to the desktop file. >=20 > > Maybe solving Bug#24982 would help? >=20 > This would help on reading the desktop, but maybe better not to save > non-readable values in the first place. No. If the problem is reading then that's where the solution should be located - not writing. It has happened quite a few times that something unreadable by Emacs has later become readable. One of the important motivations behind bug #24982 is to let Emacs version N be able to read (by ignoring) constructs that it finds are unreadable but that are readable in Emacs version N + M. The sooner we get that bug fixed, the more versions of Emacs will be able to benefit from it. Users and code should be able to make Emacs tolerant of read errors (by ignoring them). We have `condition-case' for most errors. We have little or no control over read errors. Dunno whether we need a complete read-error-handling construct a la `condition-case', but we at least need a way to let Emacs ignore all read errors. And preferably within some scope (e.g. let-bind a variable). From debbugs-submit-bounces@debbugs.gnu.org Tue Mar 13 22:37:15 2018 Received: (at 30786) by debbugs.gnu.org; 14 Mar 2018 02:37:15 +0000 Received: from localhost ([127.0.0.1]:60260 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1evwHz-0007Su-FX for submit@debbugs.gnu.org; Tue, 13 Mar 2018 22:37:15 -0400 Received: from mail-it0-f44.google.com ([209.85.214.44]:34922) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1evwHx-0007Sf-Eu for 30786@debbugs.gnu.org; Tue, 13 Mar 2018 22:37:14 -0400 Received: by mail-it0-f44.google.com with SMTP id v194-v6so2779911itb.0 for <30786@debbugs.gnu.org>; Tue, 13 Mar 2018 19:37:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=AXXjVT+4Tr+cUYC9LcoOkXDmDbOf/hbhnx2x327V6D8=; b=Ok3JLkIwNVsFzC3Mrb2TTq185LaqtP2CCpWp1YvcaFSrGvkDJ6p0sw0nT9Ruinrbsk fPCMCzh1HrKvrzEaSrw9GFQxQrGmtFBFcLpHtpCipqpm+D+rOtMX4+s4oJELbyzzAlkz rSfv0bYSrikUmV7CzhPJPP8k97rMWunWfyGeRi9URll88/iwrTyEVw5h4cmvRHhE/ng2 WA31HmwITzS2sKQ4/5M381X8tmTvfUwcqHC04GO+80Som3tKclLb8b4o10Zm4bi6IPVE 00rc3qBvOD8rOlogQXzwux/nlT4sZapDVyfRwMGlE1IFLaV16ydFEPX1MrPaOy1mwOnR 0kuQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=AXXjVT+4Tr+cUYC9LcoOkXDmDbOf/hbhnx2x327V6D8=; b=L49qVOHA9o0QpHfrhhhXtwz/87LGoAW6UlxFEB7tt2IbPdKq8kAEUou/gAGtOyt2Za sdKL4j3+IC+6e6ngdR/L3muRuSfYPy5Wtn9QWse5FQWIguHEi91Y561swAYaIVYuPJIQ 4S3+X9K4JrVAd2tej0DQvfhU+iJNPYpBsMrFVfrCEg7yTWdOwO1I0EjcLrIjNdFL3Kwe e442+u+f975h4Axn2Dh/XIyICRmLPRjDH52I6jBTn0hnWvS7INsaZeyitm22i4CXEVvZ rTIfi72hUexZNQjcgJ37Lm+OlxCiRs8rw832e6ZV2YKDGxI5HGbaXwA+y0tdSrStUgcK QzhA== X-Gm-Message-State: AElRT7HJOAFqpPR4tVGxoUuJKiafgVqncP8R7+uHpHBnDJL9ko7XeRoi ZvXV+Ut4E+AdC3Bp2lkhXqKiOQ== X-Google-Smtp-Source: AG47ELtZoGn9888IDtbkVPGDZVgkhQyK+4RaYC1hJdqVCibw0S4HuxEtmpEL9FO+Dx44aO3LzW2lLg== X-Received: by 10.36.87.129 with SMTP id u123mr288659ita.92.1520995027884; Tue, 13 Mar 2018 19:37:07 -0700 (PDT) Received: from zebian (cbl-45-2-119-34.yyz.frontiernetworks.ca. [45.2.119.34]) by smtp.googlemail.com with ESMTPSA id c13-v6sm112372itd.31.2018.03.13.19.37.07 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 13 Mar 2018 19:37:07 -0700 (PDT) From: Noam Postavsky To: Drew Adams Subject: Re: bug#30786: Save text properties in desktop References: <87k1uhnehk.fsf@mail.linkov.net> <87o9jsydtz.fsf@gmail.com> <877eqfabjv.fsf@mail.linkov.net> Date: Tue, 13 Mar 2018 22:37:06 -0400 In-Reply-To: (Drew Adams's message of "Tue, 13 Mar 2018 18:09:55 -0700 (PDT)") Message-ID: <87vadzwffx.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.90 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 30786 Cc: 30786@debbugs.gnu.org, Juri Linkov X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.0 (/) Drew Adams writes: >> If the only problem is with non-readable property values then we could >> check for such values and not to write them to the desktop file. >> >> > Maybe solving Bug#24982 would help? >> >> This would help on reading the desktop, but maybe better not to save >> non-readable values in the first place. > > No. If the problem is reading then that's where the solution > should be located - not writing. It has happened quite a few > times that something unreadable by Emacs has later become > readable. You mean the print syntax changes to become readable? But not that Emacs can later read some unreadable #<...> syntax, right? > We have `condition-case' for most errors. We have little or > no control over read errors. > > Dunno whether we need a complete read-error-handling construct > a la `condition-case', but we at least need a way to let Emacs > ignore all read errors. And preferably within some scope (e.g. > let-bind a variable). `condition-case' works for read errors too, afaik, but you're suggesting a different kind of control is needed. Something more like Common Lisp restart-case, I guess? That could be useful in general, but solving this particular bug by avoiding writing unreadable objects as Juri suggests seems okay too (and much less work, hence more likely to actually happen instead of just sitting for years). From debbugs-submit-bounces@debbugs.gnu.org Wed Mar 14 16:09:57 2018 Received: (at 30786) by debbugs.gnu.org; 14 Mar 2018 20:09:57 +0000 Received: from localhost ([127.0.0.1]:33672 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ewCii-0003RN-Ti for submit@debbugs.gnu.org; Wed, 14 Mar 2018 16:09:57 -0400 Received: from aserp2120.oracle.com ([141.146.126.78]:38596) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ewCig-0003R7-7u for 30786@debbugs.gnu.org; Wed, 14 Mar 2018 16:09:54 -0400 Received: from pps.filterd (aserp2120.oracle.com [127.0.0.1]) by aserp2120.oracle.com (8.16.0.22/8.16.0.22) with SMTP id w2EK7QJx120946; Wed, 14 Mar 2018 20:09:48 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=mime-version : message-id : date : from : sender : to : cc : subject : references : in-reply-to : content-type : content-transfer-encoding; s=corp-2017-10-26; bh=7nhL4YsYcoxVWY3FY5ilrtymNE2TZw9ReROn0paeKLU=; b=AhuAQE1sleXHSRyi/zFQdw/FXkl75AEuv8vg6i5SC/zrs1qTde7lwq3bOKozh+loIvwd uPtHELGsgcbCYcjk5IfjVdD5K56rpGVeYpdY3xn7Lc5Pp6ZCt1+rsUodIhi8xDJ1e+Qo Jwqeu2XE9HifxG8wMQcIu7Dmq7EgB3hnwdIdxnctXFsoAr4apmgs1hwbQeILgwLTix0E JnAsKnabqLkXreU6gbgvX5HTyZFiFeWbWQ9vvV0E6Wq1FQIAjpscTZlXDdtyQYVH6jec I2oglGiizNlajr3O91Z+mnldbHSXkZmLAnAMIgY9ZXsDucCVkZp/195jVP5bJVmd342S yQ== Received: from aserv0022.oracle.com (aserv0022.oracle.com [141.146.126.234]) by aserp2120.oracle.com with ESMTP id 2gq81srrnm-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 14 Mar 2018 20:09:48 +0000 Received: from aserv0121.oracle.com (aserv0121.oracle.com [141.146.126.235]) by aserv0022.oracle.com (8.14.4/8.14.4) with ESMTP id w2EK9lol031726 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 14 Mar 2018 20:09:47 GMT Received: from abhmp0001.oracle.com (abhmp0001.oracle.com [141.146.116.7]) by aserv0121.oracle.com (8.14.4/8.13.8) with ESMTP id w2EK9lij014908; Wed, 14 Mar 2018 20:09:47 GMT MIME-Version: 1.0 Message-ID: <2f8ba042-de03-4b34-9141-5fc11e9cb231@default> Date: Wed, 14 Mar 2018 20:09:46 +0000 (UTC) From: Drew Adams To: Noam Postavsky Subject: RE: bug#30786: Save text properties in desktop References: <87k1uhnehk.fsf@mail.linkov.net> <87o9jsydtz.fsf@gmail.com> <877eqfabjv.fsf@mail.linkov.net> <87vadzwffx.fsf@gmail.com> In-Reply-To: <87vadzwffx.fsf@gmail.com> X-Priority: 3 X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.9.1 (1003210) [OL 16.0.4666.0 (x86)] Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=8832 signatures=668690 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=771 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1711220000 definitions=main-1803140217 X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 30786 Cc: 30786@debbugs.gnu.org, Juri Linkov X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.0 (/) > >> > Maybe solving Bug#24982 would help? > >> > >> This would help on reading the desktop, but maybe better not to save > >> non-readable values in the first place. > > > > No. If the problem is reading then that's where the solution > > should be located - not writing. It has happened quite a few > > times that something unreadable by Emacs has later become > > readable. >=20 > You mean the print syntax changes to become readable? But not that > Emacs can later read some unreadable #<...> syntax, right? I mean what I said further down: a given syntax is not readable in Emacs version N (e.g. 20), and so raises an error there, but it is readable in Emacs N+M (e.g. 22). If we had provided a way in version N of ignoring such error raising then that would let you read the rest of a file (for example), ignoring syntax that is illegal in Emacs N. > > We have `condition-case' for most errors. We have little or > > no control over read errors. > > > > Dunno whether we need a complete read-error-handling construct > > a la `condition-case', but we at least need a way to let Emacs > > ignore all read errors. And preferably within some scope (e.g. > > let-bind a variable). >=20 > `condition-case' works for read errors too, afaik, Can you specify a particular read error to handle/ignore? > but you're suggesting a different kind of control is needed. > Something more like Common Lisp restart-case, I guess? Dunno. I actually am not familiar with CL `restart-case', or else I've forgotten it. Perhaps it was added after CLTL1? > That could be useful in general, but solving this particular bug by > avoiding writing unreadable objects as Juri suggests seems okay too (and > much less work, hence more likely to actually happen instead of just > sitting for years). It's fine not to write unreadable objects here. It's better to provide a simple way to not provoke a read error for such objects. It's a read problem, not a write problem. From debbugs-submit-bounces@debbugs.gnu.org Mon Apr 02 15:55:47 2018 Received: (at 30786) by debbugs.gnu.org; 2 Apr 2018 19:55:47 +0000 Received: from localhost ([127.0.0.1]:35425 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1f35YQ-0003m5-U5 for submit@debbugs.gnu.org; Mon, 02 Apr 2018 15:55:47 -0400 Received: from sub3.mail.dreamhost.com ([69.163.253.7]:36410 helo=homiemail-a11.g.dreamhost.com) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1f35YP-0003lx-5o for 30786@debbugs.gnu.org; Mon, 02 Apr 2018 15:55:45 -0400 Received: from homiemail-a11.g.dreamhost.com (localhost [127.0.0.1]) by homiemail-a11.g.dreamhost.com (Postfix) with ESMTP id 95F51314C069; Mon, 2 Apr 2018 12:55:44 -0700 (PDT) Received: from localhost.linkov.net (m91-129-105-236.cust.tele2.ee [91.129.105.236]) (using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) (Authenticated sender: jurta@jurta.org) by homiemail-a11.g.dreamhost.com (Postfix) with ESMTPSA id 7BE04314C066; Mon, 2 Apr 2018 12:55:43 -0700 (PDT) From: Juri Linkov To: Noam Postavsky Subject: Re: bug#30786: Save text properties in desktop Organization: LINKOV.NET References: <87k1uhnehk.fsf@mail.linkov.net> <87o9jsydtz.fsf@gmail.com> <877eqfabjv.fsf@mail.linkov.net> <87vadzwffx.fsf@gmail.com> Date: Mon, 02 Apr 2018 22:41:13 +0300 In-Reply-To: <87vadzwffx.fsf@gmail.com> (Noam Postavsky's message of "Tue, 13 Mar 2018 22:37:06 -0400") Message-ID: <877eppv8yu.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 30786 Cc: 30786@debbugs.gnu.org, Drew Adams X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.0 (/) --=-=-= Content-Type: text/plain >>> If the only problem is with non-readable property values then we could >>> check for such values and not to write them to the desktop file. >>> >>> > Maybe solving Bug#24982 would help? There is also bug#17090. >>> This would help on reading the desktop, but maybe better not to save >>> non-readable values in the first place. >> >> No. If the problem is reading then that's where the solution >> should be located - not writing. It has happened quite a few >> times that something unreadable by Emacs has later become >> readable. > > You mean the print syntax changes to become readable? But not that > Emacs can later read some unreadable #<...> syntax, right? Even when the print syntax becomes readable in later versions, we still can't write such syntax because earlier Emacs versions should be able to read the same desktop file. > That could be useful in general, but solving this particular bug by > avoiding writing unreadable objects as Juri suggests seems okay too (and > much less work, hence more likely to actually happen instead of just > sitting for years). Do you think this patch covers all possible unreadable cases on writing? --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=desktop-text-properties.patch diff --git a/lisp/desktop.el b/lisp/desktop.el index 55ec71c..4f98658 100644 --- a/lisp/desktop.el +++ b/lisp/desktop.el @@ -841,10 +841,12 @@ desktop--v2s ((or (numberp value) (null value) (eq t value) (keywordp value)) (cons 'may value)) ((stringp value) - (let ((copy (copy-sequence value))) - (set-text-properties 0 (length copy) nil copy) - ;; Get rid of text properties because we cannot read them. - (cons 'may copy))) + ;; Get rid of unreadable text properties. + (if (ignore-errors (read (format "%S" value))) + (cons 'may value) + (let ((copy (copy-sequence value))) + (set-text-properties 0 (length copy) nil copy) + (cons 'may copy)))) ((symbolp value) (cons 'must value)) ((vectorp value) --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Mon Apr 02 17:48:19 2018 Received: (at 30786) by debbugs.gnu.org; 2 Apr 2018 21:48:19 +0000 Received: from localhost ([127.0.0.1]:35508 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1f37JL-0006Mg-EI for submit@debbugs.gnu.org; Mon, 02 Apr 2018 17:48:19 -0400 Received: from mail-it0-f50.google.com ([209.85.214.50]:38013) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1f37JK-0006MT-0w for 30786@debbugs.gnu.org; Mon, 02 Apr 2018 17:48:18 -0400 Received: by mail-it0-f50.google.com with SMTP id 19-v6so20079603itw.3 for <30786@debbugs.gnu.org>; Mon, 02 Apr 2018 14:48:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=vgpDzYW/lX7nJNtTAmdC/9CAT/KNoZ/2UTXTxMxoUt4=; b=hBYYTQfzEdA8l23vwU44WPS1Io4OLsb6ZVHAQjQLtZU1Oec2jCCaGciN5XomnMCgqQ CghQaJHeQZ4Gi4at5UTxSFuOcdDUlvng7vM2+TVLPXg/00Cc+c3Sc8y9SFj3/tYAva+Y OS+wmw7qKqnvkl+VE+KP7POhh2X+/je0DVSNYUKYHBILpmkqcMi73gJyIm+VYbxUeSir kl1q3uyNAPkPURZVTtsbFQ9ZB2Ites5n5KMXNqBIkDQkqjwG+EsGuLJZCdZ0xMZJ2kTo Go3b3iNxtKrdA5yMHf/kU9DKtPINRrYci/wznq32RDVlzGZbBYNoem/sHzsdRE+egkc8 mTAg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=vgpDzYW/lX7nJNtTAmdC/9CAT/KNoZ/2UTXTxMxoUt4=; b=RA1RRD6cE5+RxEndnafRiVFe6CU2nT5lqiG/su30rd0rMDlsb1z44p1sN9xl2odkoa PlBJhcMYguMWtOufJgaNdbT4Ydj51LOQF4f04cDnTF4D5iDk9tmi9+d1tSGVEFmley53 7BveF1ZDLKh2dtHYxObGUhNA15/G+g58u5W99P1IarVi48dTY4vyAVPpzY9kOjpxej3g D3WAdhX/yOEpoREdBLVhgv2rQm4vItNFI3M08Pxp/p6w4ipYLBZ80Y/8L4BA9cYey4rD yOOJB6lSyCIaBL9liYuUA75EF1QhmtEGNtOB+W3Lpf1RGevPrXxhCdNQHMFsZrLYLXbq oOpQ== X-Gm-Message-State: AElRT7GlpeAghoXrPXqxO1q5RPtjJd6Z5DjPsydryzJd/Gfj0rd+IQ0O 4SMuQmmW2OQBzQGowtURaLs= X-Google-Smtp-Source: AIpwx4/di5Q4AqWmm0/R4k2WPi7qWmRy0dPI2OvqZ+9MOnGFzyg5ZEFSM/fJFSjI1yt5vMga5ua4hw== X-Received: by 2002:a24:1094:: with SMTP id 142-v6mr2738860ity.23.1522705692091; Mon, 02 Apr 2018 14:48:12 -0700 (PDT) Received: from zebian (cbl-45-2-119-34.yyz.frontiernetworks.ca. [45.2.119.34]) by smtp.googlemail.com with ESMTPSA id 7sm646138ioo.14.2018.04.02.14.48.10 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 02 Apr 2018 14:48:11 -0700 (PDT) From: Noam Postavsky To: Juri Linkov Subject: Re: bug#30786: Save text properties in desktop References: <87k1uhnehk.fsf@mail.linkov.net> <87o9jsydtz.fsf@gmail.com> <877eqfabjv.fsf@mail.linkov.net> <87vadzwffx.fsf@gmail.com> <877eppv8yu.fsf@mail.linkov.net> Date: Mon, 02 Apr 2018 17:48:09 -0400 In-Reply-To: <877eppv8yu.fsf@mail.linkov.net> (Juri Linkov's message of "Mon, 02 Apr 2018 22:41:13 +0300") Message-ID: <87370dp9eu.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.90 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 30786 Cc: 30786@debbugs.gnu.org, Drew Adams X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) Juri Linkov writes: > Even when the print syntax becomes readable in later versions, we still > can't write such syntax because earlier Emacs versions should be able > to read the same desktop file. > Do you think this patch covers all possible unreadable cases on writing? > + ;; Get rid of unreadable text properties. > + (if (ignore-errors (read (format "%S" value))) > + (cons 'may value) > + (let ((copy (copy-sequence value))) > + (set-text-properties 0 (length copy) nil copy) > + (cons 'may copy)))) I think it won't cover the case where an object's print syntax is only readable by the current Emacs version, and not an earlier one. To handle that you'll need to call desktop--v2s recursively, like in the vectorp and consp branches. From debbugs-submit-bounces@debbugs.gnu.org Tue Apr 03 16:14:18 2018 Received: (at 30786) by debbugs.gnu.org; 3 Apr 2018 20:14:18 +0000 Received: from localhost ([127.0.0.1]:37374 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1f3SJu-0007Dp-1b for submit@debbugs.gnu.org; Tue, 03 Apr 2018 16:14:18 -0400 Received: from sub3.mail.dreamhost.com ([69.163.253.7]:39335 helo=homiemail-a39.g.dreamhost.com) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1f3SJt-0007Db-00 for 30786@debbugs.gnu.org; Tue, 03 Apr 2018 16:14:17 -0400 Received: from homiemail-a39.g.dreamhost.com (localhost [127.0.0.1]) by homiemail-a39.g.dreamhost.com (Postfix) with ESMTP id 898C8150074; Tue, 3 Apr 2018 13:14:16 -0700 (PDT) Received: from localhost.linkov.net (m91-129-105-236.cust.tele2.ee [91.129.105.236]) (using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) (Authenticated sender: jurta@jurta.org) by homiemail-a39.g.dreamhost.com (Postfix) with ESMTPSA id 879E3150069; Tue, 3 Apr 2018 13:14:15 -0700 (PDT) From: Juri Linkov To: Noam Postavsky Subject: Re: bug#30786: Save text properties in desktop Organization: LINKOV.NET References: <87k1uhnehk.fsf@mail.linkov.net> <87o9jsydtz.fsf@gmail.com> <877eqfabjv.fsf@mail.linkov.net> <87vadzwffx.fsf@gmail.com> <877eppv8yu.fsf@mail.linkov.net> <87370dp9eu.fsf@gmail.com> Date: Tue, 03 Apr 2018 23:11:46 +0300 In-Reply-To: <87370dp9eu.fsf@gmail.com> (Noam Postavsky's message of "Mon, 02 Apr 2018 17:48:09 -0400") Message-ID: <87efjw59tp.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 30786 Cc: 30786@debbugs.gnu.org, Drew Adams X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.0 (/) >> Do you think this patch covers all possible unreadable cases on writin= g? >> >> + ;; Get rid of unreadable text properties. >> + (if (ignore-errors (read (format "%S" value))) >> + (cons 'may value) >> + (let ((copy (copy-sequence value))) >> + (set-text-properties 0 (length copy) nil copy) >> + (cons 'may copy)))) > > I think it won't cover the case where an object's print syntax is only > readable by the current Emacs version, and not an earlier one. To > handle that you'll need to call desktop--v2s recursively, like in the > vectorp and consp branches. I don't understand how calling desktop--v2s recursively will ensure its readability in earlier versions? For example, if Emacs 27 will write to the desktop file =E2=80=98#("foo" 0 3 (bar 42))=E2=80=99 how Emacs 19 can= read it? From debbugs-submit-bounces@debbugs.gnu.org Tue Apr 03 18:01:11 2018 Received: (at 30786) by debbugs.gnu.org; 3 Apr 2018 22:01:11 +0000 Received: from localhost ([127.0.0.1]:37417 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1f3TzL-0003DR-9h for submit@debbugs.gnu.org; Tue, 03 Apr 2018 18:01:11 -0400 Received: from mail-it0-f47.google.com ([209.85.214.47]:50946) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1f3TzK-0003DE-3K for 30786@debbugs.gnu.org; Tue, 03 Apr 2018 18:01:10 -0400 Received: by mail-it0-f47.google.com with SMTP id r19-v6so25393898itc.0 for <30786@debbugs.gnu.org>; Tue, 03 Apr 2018 15:01:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-transfer-encoding; bh=nHzOMnR4K+h0Nub5uCNY/N2vW/hVp0EGfqBAmQlwT/U=; b=lK0K4m7LaT9WXYaVoK+QH8fFquOAqkyw+pvq+KpIVh5+ObyuTlb422uCx8MYL5WQQZ RCpHY2CdksBuw6wOs1cyGWqxu9Zchw4Pi2v6tdnZepXquZl78pdBSH2xqX6m6v87I0iU z0Y2KsHj4vuCVGdG8pgjnhvmTws/sFqg5gq+ah8cMzh2WSO1lp1w52LPXqjxYDmQdotZ ieOaM/l2wxli+dUE+bPa5Si2hx9fZXVN1kluKdhIN6HNl9qSP2oSiS/DwBRPENiJadgk jsPWBGiZCbyNy6yLncuMowfcHBGuhbhRMBk/m5mGrzlVNfWNI4RDjOB9t4br5cYqgQfM SeOA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version:content-transfer-encoding; bh=nHzOMnR4K+h0Nub5uCNY/N2vW/hVp0EGfqBAmQlwT/U=; b=Yug533f+LkQBhat4MBUaH04++7Ae6oBcqP+XXzEw+0QrdI7+QdRBpYEcmZNutyv3a/ ArUozIrhAE+lqyN8myc7otvUMyxH1lAe7A+HG3blpppLdkhDY7y54R6GlbMvNBiwy676 eFHlpXYrLT9XVE0m/HzMj26k9uXXnfIiVf6HqB8qb64KZTT17WkJYGfGMEIlvajzUBcH mLdkuR4kRJVYEHN0rRCbWynolWH8Pc0C7Ggxt3nZh9ZFfyVorDmUoPeJC4cKvIdOfzqy 0CscpdiAgEH/meBwChr5+rhq5r4g0GAINR1kO38U/5IAVCFNEhwCrYkcJb4jx9qFIx2S mJDw== X-Gm-Message-State: ALQs6tAPlYuDUEgVuDOk+6Twciabp+fnlM60gqOUPsc4jftbifwKjYet jnyv1+qqfsZBEsIi++vIAKM= X-Google-Smtp-Source: AIpwx495rJ/W1Wn7lX/lVvxOYCcnsHLGuqMHlDCXIYMZzqGmlVL5OSoEUybsvR8VKnyBhVn92Ip7dg== X-Received: by 2002:a24:39c8:: with SMTP id l191-v6mr6870084ita.81.1522792864506; Tue, 03 Apr 2018 15:01:04 -0700 (PDT) Received: from zebian (cbl-45-2-119-34.yyz.frontiernetworks.ca. [45.2.119.34]) by smtp.googlemail.com with ESMTPSA id s142-v6sm1030423itb.4.2018.04.03.15.01.03 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 03 Apr 2018 15:01:03 -0700 (PDT) From: Noam Postavsky To: Juri Linkov Subject: Re: bug#30786: Save text properties in desktop References: <87k1uhnehk.fsf@mail.linkov.net> <87o9jsydtz.fsf@gmail.com> <877eqfabjv.fsf@mail.linkov.net> <87vadzwffx.fsf@gmail.com> <877eppv8yu.fsf@mail.linkov.net> <87370dp9eu.fsf@gmail.com> <87efjw59tp.fsf@mail.linkov.net> Date: Tue, 03 Apr 2018 18:01:02 -0400 In-Reply-To: <87efjw59tp.fsf@mail.linkov.net> (Juri Linkov's message of "Tue, 03 Apr 2018 23:11:46 +0300") Message-ID: <87po3gne5d.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.90 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 30786 Cc: 30786@debbugs.gnu.org, Drew Adams X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.0 (/) Juri Linkov writes: >>> Do you think this patch covers all possible unreadable cases on writing? >>> >>> + ;; Get rid of unreadable text properties. >>> + (if (ignore-errors (read (format "%S" value))) >>> + (cons 'may value) >>> + (let ((copy (copy-sequence value))) >>> + (set-text-properties 0 (length copy) nil copy) >>> + (cons 'may copy)))) >> >> I think it won't cover the case where an object's print syntax is only >> readable by the current Emacs version, and not an earlier one. To >> handle that you'll need to call desktop--v2s recursively, like in the >> vectorp and consp branches. > > I don't understand how calling desktop--v2s recursively will ensure its > readability in earlier versions? For example, if Emacs 27 will write to > the desktop file =E2=80=98#("foo" 0 3 (bar 42))=E2=80=99 how Emacs 19 can= read it? Ah, I wasn't thinking of the #(...) specifically, rather about the values of text properties, e.g., (cl-defstruct foo f1 f2) (desktop--v2s (make-foo :f1 1 :f2 2)) ;=3D> (may . "Unprintable entity") So desktop--v2s considers structs as unprintable, unlike read, hence using desktop--v2s recursively instead of read will catch properties that would otherwise be unreadable in Emacs 25. If we want to support Emacs versions that don't even know about #(...) then we can't write string properties at all, I guess. From debbugs-submit-bounces@debbugs.gnu.org Wed Apr 04 16:03:53 2018 Received: (at 30786) by debbugs.gnu.org; 4 Apr 2018 20:03:53 +0000 Received: from localhost ([127.0.0.1]:38661 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1f3odN-0001pB-1W for submit@debbugs.gnu.org; Wed, 04 Apr 2018 16:03:53 -0400 Received: from sub3.mail.dreamhost.com ([69.163.253.7]:46542 helo=homiemail-a19.g.dreamhost.com) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1f3odL-0001p3-Kx for 30786@debbugs.gnu.org; Wed, 04 Apr 2018 16:03:51 -0400 Received: from homiemail-a19.g.dreamhost.com (localhost [127.0.0.1]) by homiemail-a19.g.dreamhost.com (Postfix) with ESMTP id D5454604076; Wed, 4 Apr 2018 13:03:50 -0700 (PDT) Received: from localhost.linkov.net (m91-129-105-236.cust.tele2.ee [91.129.105.236]) (using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) (Authenticated sender: jurta@jurta.org) by homiemail-a19.g.dreamhost.com (Postfix) with ESMTPSA id BF57760406B; Wed, 4 Apr 2018 13:03:49 -0700 (PDT) From: Juri Linkov To: Noam Postavsky Subject: Re: bug#30786: Save text properties in desktop Organization: LINKOV.NET References: <87k1uhnehk.fsf@mail.linkov.net> <87o9jsydtz.fsf@gmail.com> <877eqfabjv.fsf@mail.linkov.net> <87vadzwffx.fsf@gmail.com> <877eppv8yu.fsf@mail.linkov.net> <87370dp9eu.fsf@gmail.com> <87efjw59tp.fsf@mail.linkov.net> <87po3gne5d.fsf@gmail.com> Date: Wed, 04 Apr 2018 23:01:02 +0300 In-Reply-To: <87po3gne5d.fsf@gmail.com> (Noam Postavsky's message of "Tue, 03 Apr 2018 18:01:02 -0400") Message-ID: <878ta2zqpt.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 30786 Cc: 30786@debbugs.gnu.org, Drew Adams X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.0 (/) >>>> Do you think this patch covers all possible unreadable cases on writ= ing? >>>> >>>> + ;; Get rid of unreadable text properties. >>>> + (if (ignore-errors (read (format "%S" value))) >>>> + (cons 'may value) >>>> + (let ((copy (copy-sequence value))) >>>> + (set-text-properties 0 (length copy) nil copy) >>>> + (cons 'may copy)))) >>> >>> I think it won't cover the case where an object's print syntax is onl= y >>> readable by the current Emacs version, and not an earlier one. To >>> handle that you'll need to call desktop--v2s recursively, like in the >>> vectorp and consp branches. >> >> I don't understand how calling desktop--v2s recursively will ensure it= s >> readability in earlier versions? For example, if Emacs 27 will write = to >> the desktop file =E2=80=98#("foo" 0 3 (bar 42))=E2=80=99 how Emacs 19 = can read it? > > Ah, I wasn't thinking of the #(...) specifically, rather about the > values of text properties, e.g., > > (cl-defstruct foo f1 f2) > (desktop--v2s (make-foo :f1 1 :f2 2)) ;=3D> (may . "Unprintable ent= ity") > > So desktop--v2s considers structs as unprintable, unlike read, hence > using desktop--v2s recursively instead of read will catch properties > that would otherwise be unreadable in Emacs 25. > > If we want to support Emacs versions that don't even know about #(...) > then we can't write string properties at all, I guess. If we can afford continuing incrementing the desktop file version in =E2=80=98desktop-file-version=E2=80=99 doing this every time when support= for reading more syntaxes is added, thus preventing incompatibilities, then the patch abov= e would be the most reliable solution. From debbugs-submit-bounces@debbugs.gnu.org Sat Apr 07 09:08:18 2018 Received: (at 30786) by debbugs.gnu.org; 7 Apr 2018 13:08:18 +0000 Received: from localhost ([127.0.0.1]:40860 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1f4nZq-0003us-3b for submit@debbugs.gnu.org; Sat, 07 Apr 2018 09:08:18 -0400 Received: from mail-it0-f51.google.com ([209.85.214.51]:35457) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1f4nZo-0003ue-P0 for 30786@debbugs.gnu.org; Sat, 07 Apr 2018 09:08:17 -0400 Received: by mail-it0-f51.google.com with SMTP id v194-v6so4984070itb.0 for <30786@debbugs.gnu.org>; Sat, 07 Apr 2018 06:08:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-transfer-encoding; bh=afmHyO0+dumxJ+r83h12B3CyHm+L1l7ECEuUKnHiozo=; b=Jy68CPvCdyYsGrT+ddwikXc6tsb7ur7acNpqYPiNrt5CNQNZf3gFwqw4UICK8jz1An qi9RSfRmGM9smFrjJooaWx46/9tgzZn+AJJmR9jiwLUL3lOFRuTJq0vjzHFVqOlKaSlT QQRGgaRD5loesEb7I+/Z2fJ3L61ZliK38z6cjNwgjk+kDS8UyoTB+d91kc8CyKH3fX0n 4QCpTLU4PYwvW22TdFRSTJ2+WqEZBP08zYGPW/iNvujaU1z9WPowqnwvvDL5h/PWuInI kn5V2ygOtGnO2gQdeAWm8L76OJKgWNOs4SlJIyktFeVOQlNxibTfJvX7kRfboVoQaVAK GlIw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version:content-transfer-encoding; bh=afmHyO0+dumxJ+r83h12B3CyHm+L1l7ECEuUKnHiozo=; b=lV7tNUlOsRQdJQtY6xhAoc4w08VBaY/+x3ui7iNdJ5O/dnRNcNKGprP6NV+RAzK1fJ P6dqcziEjlNmbqV26Q/fNRsPAsLphZfNRIAfhv+bmp+G9tKReepNZu4zLDZosh8JotQ5 S0aON2pcvCiAEu7g5h5z3NLQm4+18+LYXZieXQtqk1a3bXN8vx1yAn119Lp7T36om4B/ ARpYY9G6UWdgLO6XyryIhEA3S1l8Onz4txueRqfBpbgh29jG97M2TUomAG9jDz+8a3JN VfANvke5IH/iZuEAsjZSAodOvrWzj0Edzdj2BncVUrpJV/wF9AbO9AmEsuOi5ISHPOxh XpgQ== X-Gm-Message-State: ALQs6tBKjByI6Z4iP8r9vl7sz2i2X+iI6Co8wPxol/ai4SxjgTHoi5Wg bf/JqeMJbhoHvN7JTo9Pi1I= X-Google-Smtp-Source: AIpwx4/hsa2so9nK0dMQhETpQCtkz9u1QZY/Q7tzbeyt/T0SSJtu8ZOpC/CmaR0GV0KntODTkT4hrg== X-Received: by 2002:a24:25cb:: with SMTP id g194-v6mr22315598itg.85.1523106491257; Sat, 07 Apr 2018 06:08:11 -0700 (PDT) Received: from zebian (cbl-45-2-119-34.yyz.frontiernetworks.ca. [45.2.119.34]) by smtp.googlemail.com with ESMTPSA id w133-v6sm4650614itc.1.2018.04.07.06.08.09 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sat, 07 Apr 2018 06:08:10 -0700 (PDT) From: Noam Postavsky To: Juri Linkov Subject: Re: bug#30786: Save text properties in desktop References: <87k1uhnehk.fsf@mail.linkov.net> <87o9jsydtz.fsf@gmail.com> <877eqfabjv.fsf@mail.linkov.net> <87vadzwffx.fsf@gmail.com> <877eppv8yu.fsf@mail.linkov.net> <87370dp9eu.fsf@gmail.com> <87efjw59tp.fsf@mail.linkov.net> <87po3gne5d.fsf@gmail.com> <878ta2zqpt.fsf@mail.linkov.net> Date: Sat, 07 Apr 2018 09:08:08 -0400 In-Reply-To: <878ta2zqpt.fsf@mail.linkov.net> (Juri Linkov's message of "Wed, 04 Apr 2018 23:01:02 +0300") Message-ID: <877epjnozr.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.90 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 30786 Cc: 30786@debbugs.gnu.org, Drew Adams X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Juri Linkov writes: >>>>> + ;; Get rid of unreadable text properties. >>>>> + (if (ignore-errors (read (format "%S" value))) >>>>> + (cons 'may value) >>>>> + (let ((copy (copy-sequence value))) >>>>> + (set-text-properties 0 (length copy) nil copy) >>>>> + (cons 'may copy)))) > If we can afford continuing incrementing the desktop file version in > =E2=80=98desktop-file-version=E2=80=99 doing this every time when support= for reading more > syntaxes is added, thus preventing incompatibilities, then the patch above > would be the most reliable solution. You would also have to strip text properties according to the value of desktop-file-version, right? From debbugs-submit-bounces@debbugs.gnu.org Sat Apr 07 16:51:23 2018 Received: (at 30786) by debbugs.gnu.org; 7 Apr 2018 20:51:23 +0000 Received: from localhost ([127.0.0.1]:41597 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1f4unz-0001fs-0O for submit@debbugs.gnu.org; Sat, 07 Apr 2018 16:51:23 -0400 Received: from sub3.mail.dreamhost.com ([69.163.253.7]:45152 helo=homiemail-a18.g.dreamhost.com) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1f4unx-0001fl-V4 for 30786@debbugs.gnu.org; Sat, 07 Apr 2018 16:51:22 -0400 Received: from homiemail-a18.g.dreamhost.com (localhost [127.0.0.1]) by homiemail-a18.g.dreamhost.com (Postfix) with ESMTP id 7107D258068; Sat, 7 Apr 2018 13:51:21 -0700 (PDT) Received: from localhost.linkov.net (m91-129-105-236.cust.tele2.ee [91.129.105.236]) (using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) (Authenticated sender: jurta@jurta.org) by homiemail-a18.g.dreamhost.com (Postfix) with ESMTPSA id 695A8258067; Sat, 7 Apr 2018 13:51:20 -0700 (PDT) From: Juri Linkov To: Noam Postavsky Subject: Re: bug#30786: Save text properties in desktop Organization: LINKOV.NET References: <87k1uhnehk.fsf@mail.linkov.net> <87o9jsydtz.fsf@gmail.com> <877eqfabjv.fsf@mail.linkov.net> <87vadzwffx.fsf@gmail.com> <877eppv8yu.fsf@mail.linkov.net> <87370dp9eu.fsf@gmail.com> <87efjw59tp.fsf@mail.linkov.net> <87po3gne5d.fsf@gmail.com> <878ta2zqpt.fsf@mail.linkov.net> <877epjnozr.fsf@gmail.com> Date: Sat, 07 Apr 2018 23:46:41 +0300 In-Reply-To: <877epjnozr.fsf@gmail.com> (Noam Postavsky's message of "Sat, 07 Apr 2018 09:08:08 -0400") Message-ID: <87o9iuzqvi.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 30786 Cc: 30786@debbugs.gnu.org, Drew Adams X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) >>>>>> + ;; Get rid of unreadable text properties. >>>>>> + (if (ignore-errors (read (format "%S" value))) >>>>>> + (cons 'may value) >>>>>> + (let ((copy (copy-sequence value))) >>>>>> + (set-text-properties 0 (length copy) nil copy) >>>>>> + (cons 'may copy)))) > >> If we can afford continuing incrementing the desktop file version in >> =E2=80=98desktop-file-version=E2=80=99 doing this every time when supp= ort for reading more >> syntaxes is added, thus preventing incompatibilities, then the patch a= bove >> would be the most reliable solution. > > You would also have to strip text properties according to the value of > desktop-file-version, right? This won't help for the counterexample that you demonstrated earlier with (put-text-property 1 2 'foo (point-marker)). Whereas this patch does. From debbugs-submit-bounces@debbugs.gnu.org Sat Apr 07 21:55:01 2018 Received: (at 30786) by debbugs.gnu.org; 8 Apr 2018 01:55:01 +0000 Received: from localhost ([127.0.0.1]:41662 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1f4zXp-0000Fb-4C for submit@debbugs.gnu.org; Sat, 07 Apr 2018 21:55:01 -0400 Received: from mail-it0-f43.google.com ([209.85.214.43]:35398) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1f4zXn-0000FP-UZ for 30786@debbugs.gnu.org; Sat, 07 Apr 2018 21:55:00 -0400 Received: by mail-it0-f43.google.com with SMTP id v194-v6so6170451itb.0 for <30786@debbugs.gnu.org>; Sat, 07 Apr 2018 18:54:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-transfer-encoding; bh=HHLvJlMbadLdQwOeizYu1DS7mSA8gaT/Zs2cwhdCC0s=; b=Lqnk3uWx0+7ABvwviuwwN0ttUD4PnBJf1jRgioHgCAySuF1vXZzZVr1QasQdmV906h rkuGqo4Swge11NwDZ8n8mk8ZS9syaxnN3qzmeL1Drb4fpK9mbt0BwBg28rHz3W0TSQ5E +khNiRpyFvGObtdaf0uzRNqyht6RmEq2/Loo9u9QSMShTMCL+IU54dzb0GryzZHAySiI wjO2TID25nZjHS2M8uH9WQ+cSzgcVbyRZB+pIDDNsIXL8e1mT5fpMthfouURn4t0GrIq z4FmwVHrB+6fLUEZN4pq6X2ax1Cw9to5S9G1ItMzEjnb1aeS6DAF98OUMhU7WAbXSm/r FFiA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version:content-transfer-encoding; bh=HHLvJlMbadLdQwOeizYu1DS7mSA8gaT/Zs2cwhdCC0s=; b=mNQ74F6ovOJog7mXKhTTEPP3osOdEGVyCygrh5kAMfJU5P/bhLKhdP6nxRv95uccqy NDCqA7IhZMKpou8kShmVcbxSXXOV43X3Q5ROR8uqLk+RBuwi5U+TYoiI8L03Q7fKGQeX +u0bevK2x+KwfFEYC6T/z9aH0BMDNoJX6lsa2XIT4BVkrtcn48nznp5mXrtAjnkkrMqI q8cZg/vi4ulYV24lJ5YnID7fyKkFFOeZKJFGPGSpbkubyfMWIAum3IulU04k+yf23K5P Om8DB29HyvMpauNT1AYB6bSkZaj6RZqJKZ1mu0DmYCKnB1U+Yf27kk9qq+vcKE3RqC4n 22LA== X-Gm-Message-State: AElRT7G6Vk2GdmpYynaxBKBkNEmiLb924W/nIkT2i+lAR7Kqxxq/nm7p iCoofeQhtbCjFgilCAqz2hE= X-Google-Smtp-Source: AIpwx4+AXeDzMbH8lInLlfRNMmcdondVCVRAeP9HA26Q/LICH+gEfBiv77Ot3UpqZNLzh0RbM4vpEw== X-Received: by 2002:a24:2815:: with SMTP id h21-v6mr23614301ith.43.1523152494367; Sat, 07 Apr 2018 18:54:54 -0700 (PDT) Received: from zebian (cbl-45-2-119-34.yyz.frontiernetworks.ca. [45.2.119.34]) by smtp.googlemail.com with ESMTPSA id r79-v6sm8035500ita.24.2018.04.07.18.54.53 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sat, 07 Apr 2018 18:54:53 -0700 (PDT) From: Noam Postavsky To: Juri Linkov Subject: Re: bug#30786: Save text properties in desktop References: <87k1uhnehk.fsf@mail.linkov.net> <87o9jsydtz.fsf@gmail.com> <877eqfabjv.fsf@mail.linkov.net> <87vadzwffx.fsf@gmail.com> <877eppv8yu.fsf@mail.linkov.net> <87370dp9eu.fsf@gmail.com> <87efjw59tp.fsf@mail.linkov.net> <87po3gne5d.fsf@gmail.com> <878ta2zqpt.fsf@mail.linkov.net> <877epjnozr.fsf@gmail.com> <87o9iuzqvi.fsf@mail.linkov.net> Date: Sat, 07 Apr 2018 21:54:52 -0400 In-Reply-To: <87o9iuzqvi.fsf@mail.linkov.net> (Juri Linkov's message of "Sat, 07 Apr 2018 23:46:41 +0300") Message-ID: <87zi2emphv.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.90 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 30786 Cc: 30786@debbugs.gnu.org, Drew Adams X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Juri Linkov writes: >>>>>>> + ;; Get rid of unreadable text properties. >>>>>>> + (if (ignore-errors (read (format "%S" value))) >>>>>>> + (cons 'may value) >>>>>>> + (let ((copy (copy-sequence value))) >>>>>>> + (set-text-properties 0 (length copy) nil copy) >>>>>>> + (cons 'may copy)))) >> >>> If we can afford continuing incrementing the desktop file version in >>> =E2=80=98desktop-file-version=E2=80=99 doing this every time when suppo= rt for reading more >>> syntaxes is added, thus preventing incompatibilities, then the patch ab= ove >>> would be the most reliable solution. >> >> You would also have to strip text properties according to the value of >> desktop-file-version, right? > > This won't help for the counterexample that you demonstrated earlier with > (put-text-property 1 2 'foo (point-marker)). Whereas this patch does. Sorry, I don't think I explained my point very well above. Using `read' to check readability can only test which objects are readable in the current Emacs version. So if we rely on that, then we can only reliably produce desktop files compatible with the current version. Which means the only thing that desktop-file-version helps with is giving a slightly better error message, yes? (I don't think this is necessarily a deal-breaker, as long as it's well documented) From debbugs-submit-bounces@debbugs.gnu.org Sun Apr 08 16:15:18 2018 Received: (at 30786) by debbugs.gnu.org; 8 Apr 2018 20:15:18 +0000 Received: from localhost ([127.0.0.1]:42856 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1f5Gic-0002Mk-AP for submit@debbugs.gnu.org; Sun, 08 Apr 2018 16:15:18 -0400 Received: from sub3.mail.dreamhost.com ([69.163.253.7]:46737 helo=homiemail-a11.g.dreamhost.com) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1f5Gia-0002Mc-ML for 30786@debbugs.gnu.org; Sun, 08 Apr 2018 16:15:17 -0400 Received: from homiemail-a11.g.dreamhost.com (localhost [127.0.0.1]) by homiemail-a11.g.dreamhost.com (Postfix) with ESMTP id D4CE3314C06D; Sun, 8 Apr 2018 13:15:15 -0700 (PDT) Received: from localhost.linkov.net (m91-129-105-236.cust.tele2.ee [91.129.105.236]) (using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) (Authenticated sender: jurta@jurta.org) by homiemail-a11.g.dreamhost.com (Postfix) with ESMTPSA id B835F314C069; Sun, 8 Apr 2018 13:15:14 -0700 (PDT) From: Juri Linkov To: Noam Postavsky Subject: Re: bug#30786: Save text properties in desktop Organization: LINKOV.NET References: <87k1uhnehk.fsf@mail.linkov.net> <87o9jsydtz.fsf@gmail.com> <877eqfabjv.fsf@mail.linkov.net> <87vadzwffx.fsf@gmail.com> <877eppv8yu.fsf@mail.linkov.net> <87370dp9eu.fsf@gmail.com> <87efjw59tp.fsf@mail.linkov.net> <87po3gne5d.fsf@gmail.com> <878ta2zqpt.fsf@mail.linkov.net> <877epjnozr.fsf@gmail.com> <87o9iuzqvi.fsf@mail.linkov.net> <87zi2emphv.fsf@gmail.com> Date: Sun, 08 Apr 2018 23:13:13 +0300 In-Reply-To: <87zi2emphv.fsf@gmail.com> (Noam Postavsky's message of "Sat, 07 Apr 2018 21:54:52 -0400") Message-ID: <87tvslpszy.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 30786 Cc: 30786@debbugs.gnu.org, Drew Adams X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) >>>>>>>> + ;; Get rid of unreadable text properties. >>>>>>>> + (if (ignore-errors (read (format "%S" value))) >>>>>>>> + (cons 'may value) >>>>>>>> + (let ((copy (copy-sequence value))) >>>>>>>> + (set-text-properties 0 (length copy) nil copy) >>>>>>>> + (cons 'may copy)))) >>> >>>> If we can afford continuing incrementing the desktop file version in >>>> =E2=80=98desktop-file-version=E2=80=99 doing this every time when su= pport for reading more >>>> syntaxes is added, thus preventing incompatibilities, then the patch= above >>>> would be the most reliable solution. >>> >>> You would also have to strip text properties according to the value o= f >>> desktop-file-version, right? >> >> This won't help for the counterexample that you demonstrated earlier w= ith >> (put-text-property 1 2 'foo (point-marker)). Whereas this patch does. > > Sorry, I don't think I explained my point very well above. > > Using `read' to check readability can only test which objects are > readable in the current Emacs version. So if we rely on that, then we > can only reliably produce desktop files compatible with the current > version. Which means the only thing that desktop-file-version helps > with is giving a slightly better error message, yes? > > (I don't think this is necessarily a deal-breaker, as long as it's well > documented) Yes, just better error handling (like what in bug#24982 was asked to do), nothing more, so it's not a deal-breaker. Currently I see no better way than in the aforementioned patch. At least it provides 100% guarantee of readability of the desktop file in the same version that wrote it. But earlier versions will have an incompatibility problem anyway. Let's suppose that Emacs 27 will support reading point-markers and writes them to the desktop file for good. Then naturally Emacs 26 will fail to read such desktop files either way: explicitly by comparing version numbers, or implicitly by inability to parse the new syntax. From debbugs-submit-bounces@debbugs.gnu.org Thu Apr 19 16:33:03 2018 Received: (at 30786-done) by debbugs.gnu.org; 19 Apr 2018 20:33:03 +0000 Received: from localhost ([127.0.0.1]:33277 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1f9GEp-0003sm-D9 for submit@debbugs.gnu.org; Thu, 19 Apr 2018 16:33:03 -0400 Received: from sub3.mail.dreamhost.com ([69.163.253.7]:57172 helo=homiemail-a18.g.dreamhost.com) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1f9GEn-0003s5-Vd for 30786-done@debbugs.gnu.org; Thu, 19 Apr 2018 16:33:02 -0400 Received: from homiemail-a18.g.dreamhost.com (localhost [127.0.0.1]) by homiemail-a18.g.dreamhost.com (Postfix) with ESMTP id 428D925806A; Thu, 19 Apr 2018 13:33:01 -0700 (PDT) Received: from localhost.linkov.net (m91-129-110-22.cust.tele2.ee [91.129.110.22]) (using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) (Authenticated sender: jurta@jurta.org) by homiemail-a18.g.dreamhost.com (Postfix) with ESMTPSA id D6CD6258068; Thu, 19 Apr 2018 13:32:59 -0700 (PDT) From: Juri Linkov To: Noam Postavsky Subject: Re: bug#30786: Save text properties in desktop Organization: LINKOV.NET References: <87k1uhnehk.fsf@mail.linkov.net> <87o9jsydtz.fsf@gmail.com> <877eqfabjv.fsf@mail.linkov.net> <87vadzwffx.fsf@gmail.com> <877eppv8yu.fsf@mail.linkov.net> <87370dp9eu.fsf@gmail.com> <87efjw59tp.fsf@mail.linkov.net> <87po3gne5d.fsf@gmail.com> <878ta2zqpt.fsf@mail.linkov.net> <877epjnozr.fsf@gmail.com> <87o9iuzqvi.fsf@mail.linkov.net> <87zi2emphv.fsf@gmail.com> <87tvslpszy.fsf@mail.linkov.net> Date: Thu, 19 Apr 2018 23:32:14 +0300 In-Reply-To: <87tvslpszy.fsf@mail.linkov.net> (Juri Linkov's message of "Sun, 08 Apr 2018 23:13:13 +0300") Message-ID: <87d0yv2bu6.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 30786-done Cc: 30786-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Version: 27.0.50 > Currently I see no better way than in the aforementioned patch. > At least it provides 100% guarantee of readability of the desktop file > in the same version that wrote it. Additionally I found out that savehist uses the same solution, so it's consistent to do the same, pushed to master as 99de04e. From unknown Fri Jun 20 07:14:51 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Fri, 18 May 2018 11:24:04 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator