From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Noam Postavsky Newsgroups: gmane.emacs.bugs Subject: bug#30786: Save text properties in desktop Date: Mon, 02 Apr 2018 17:48:09 -0400 Message-ID: <87370dp9eu.fsf@gmail.com> References: <87k1uhnehk.fsf@mail.linkov.net> <87o9jsydtz.fsf@gmail.com> <877eqfabjv.fsf@mail.linkov.net> <87vadzwffx.fsf@gmail.com> <877eppv8yu.fsf@mail.linkov.net> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1522705633 9217 195.159.176.226 (2 Apr 2018 21:47:13 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 2 Apr 2018 21:47:13 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.90 (gnu/linux) Cc: 30786@debbugs.gnu.org To: Juri Linkov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Apr 02 23:47:09 2018 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1f37IC-0002Hn-ST for geb-bug-gnu-emacs@m.gmane.org; Mon, 02 Apr 2018 23:47:09 +0200 Original-Received: from localhost ([::1]:37686 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f37KG-0004xf-Ev for geb-bug-gnu-emacs@m.gmane.org; Mon, 02 Apr 2018 17:49:16 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:53216) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f37K5-0004wS-CQ for bug-gnu-emacs@gnu.org; Mon, 02 Apr 2018 17:49:06 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1f37K2-0000xN-An for bug-gnu-emacs@gnu.org; Mon, 02 Apr 2018 17:49:05 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:55848) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1f37K2-0000xA-7C for bug-gnu-emacs@gnu.org; Mon, 02 Apr 2018 17:49:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1f37K2-0006Nz-13 for bug-gnu-emacs@gnu.org; Mon, 02 Apr 2018 17:49:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Noam Postavsky Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 02 Apr 2018 21:49:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 30786 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 30786-submit@debbugs.gnu.org id=B30786.152270569924474 (code B ref 30786); Mon, 02 Apr 2018 21:49:01 +0000 Original-Received: (at 30786) by debbugs.gnu.org; 2 Apr 2018 21:48:19 +0000 Original-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 Original-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 Original-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) Original-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) In-Reply-To: <877eppv8yu.fsf@mail.linkov.net> (Juri Linkov's message of "Mon, 02 Apr 2018 22:41:13 +0300") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:144810 Archived-At: 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.