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: Sat, 07 Apr 2018 21:54:52 -0400 Message-ID: <87zi2emphv.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> <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> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: blaine.gmane.org 1523152387 314 195.159.176.226 (8 Apr 2018 01:53:07 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sun, 8 Apr 2018 01:53:07 +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 Sun Apr 08 03:53:03 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 1f4zVv-0008Si-5W for geb-bug-gnu-emacs@m.gmane.org; Sun, 08 Apr 2018 03:53:03 +0200 Original-Received: from localhost ([::1]:40951 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f4zY0-00034h-RT for geb-bug-gnu-emacs@m.gmane.org; Sat, 07 Apr 2018 21:55:12 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:52595) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f4zXt-00032v-SB for bug-gnu-emacs@gnu.org; Sat, 07 Apr 2018 21:55:06 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1f4zXq-0005iC-Q3 for bug-gnu-emacs@gnu.org; Sat, 07 Apr 2018 21:55:05 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:33765) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1f4zXq-0005hp-Kt for bug-gnu-emacs@gnu.org; Sat, 07 Apr 2018 21:55:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1f4zXq-0000Ft-5u for bug-gnu-emacs@gnu.org; Sat, 07 Apr 2018 21:55: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: Sun, 08 Apr 2018 01:55:02 +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.1523152501971 (code B ref 30786); Sun, 08 Apr 2018 01:55:02 +0000 Original-Received: (at 30786) by debbugs.gnu.org; 8 Apr 2018 01:55:01 +0000 Original-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 Original-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 Original-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) Original-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) In-Reply-To: <87o9iuzqvi.fsf@mail.linkov.net> (Juri Linkov's message of "Sat, 07 Apr 2018 23:46:41 +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:144974 Archived-At: 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)