From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Matthew Newton Newsgroups: gmane.emacs.bugs Subject: bug#24576: 25.1; desktop.el does not fully preserve registers with macros Date: Wed, 22 May 2019 13:58:06 -0700 Message-ID: <45ED012D-B370-473A-AF83-2165F5CD3DE3@knosis.org> References: <874m4wwu6n.fsf@gmail.com> <87v9yhi3ux.fsf@gmail.com> Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.11\)) Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="212252"; mail-complaints-to="usenet@blaine.gmane.org" Cc: dpaduchikh@gmail.com, 24576@debbugs.gnu.org To: Noam Postavsky Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed May 22 23:05:19 2019 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hTYQG-000t2y-MA for geb-bug-gnu-emacs@m.gmane.org; Wed, 22 May 2019 23:05:17 +0200 Original-Received: from localhost ([127.0.0.1]:51349 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hTYQF-0004G9-Nq for geb-bug-gnu-emacs@m.gmane.org; Wed, 22 May 2019 17:05:15 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:33247) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hTYQ7-0004BU-Vb for bug-gnu-emacs@gnu.org; Wed, 22 May 2019 17:05:09 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hTYKF-0007ly-KA for bug-gnu-emacs@gnu.org; Wed, 22 May 2019 16:59:05 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:57816) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hTYKE-0007lO-C6 for bug-gnu-emacs@gnu.org; Wed, 22 May 2019 16:59:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1hTYKE-0006wt-9e for bug-gnu-emacs@gnu.org; Wed, 22 May 2019 16:59:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Matthew Newton Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 22 May 2019 20:59:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 24576 X-GNU-PR-Package: emacs Original-Received: via spool by 24576-submit@debbugs.gnu.org id=B24576.155855869626653 (code B ref 24576); Wed, 22 May 2019 20:59:02 +0000 Original-Received: (at 24576) by debbugs.gnu.org; 22 May 2019 20:58:16 +0000 Original-Received: from localhost ([127.0.0.1]:43127 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hTYJT-0006vp-KS for submit@debbugs.gnu.org; Wed, 22 May 2019 16:58:16 -0400 Original-Received: from out2-smtp.messagingengine.com ([66.111.4.26]:51083) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hTYJR-0006vZ-Qz for 24576@debbugs.gnu.org; Wed, 22 May 2019 16:58:14 -0400 Original-Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.nyi.internal (Postfix) with ESMTP id 49BBE21B2A; Wed, 22 May 2019 16:58:08 -0400 (EDT) Original-Received: from mailfrontend1 ([10.202.2.162]) by compute5.internal (MEProxy); Wed, 22 May 2019 16:58:08 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=knosis.org; h= content-type:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; s=fm3; bh=X i7TyfFJJUbPdKZtmJ4Rmp8i6hTa9gjRbUzaAhO+JeQ=; b=0BW7kfvQWowOts03s KLjMUD1DZR8VSlcXBMioXM4v1jvf4ZjMpXymwtuK/aKYGE3K8ovNl4cuIYXgSIW0 nmc5ga23sWQ22oS/+eLMcBpmY1UJs4l5Vd0VVZKXr+riC/aBTZ5ce+/mz//GZXAc QEXmZHr4N/4gTEaMn/XDPwDh3W/JZTg146+nnxjksCatPWqpSHeZC46zvkgtTcxE PUiwQwCO0xMDqeZ7nzETmHpxLMaVxDv/x5eATvmGSdllxULpjv5ljUIfpSYePp8V wvWwdng+0tdfJeJVmtpU+jbG0n/kim3Jrd6rLXU+O3eonGPE5/4c0BlL/UY8UAcS 5tcSw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm2; bh=Xi7TyfFJJUbPdKZtmJ4Rmp8i6hTa9gjRbUzaAhO+J eQ=; b=rHs2uBV/L19W6+VGX1GCQgxky2BUfXTmXPWsfR7socjTdIDnt+BB/ZTCV cGIG1XjBWMGc9MwUF9J3sItGHorcnu+jGWFDoHzxbQH4hSuoyiubwcVzJpUyuqIX DNb4pCs7f3odlIOqYO+CciMFhh+DJ+ohF4Xjk+dTHZ663McNrLTuynbufYztptXX j1oOYQrurMKN8GbQZaBubN8sqO5Wy5FbgJZhfY6E4oDvNeTPuuJmw9gZkTEkWxsQ wkcuz77IJoVEk2GtNsp9/cN/D6rqOSrwklXWtvv8UBGk61AeXynzFQJqgKAN2jwQ uYnSggUySYS24gfY3UW+8kqprFb9g== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduuddrudduvddgudehiecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpegtggfuhfgjfffgkfhfvffosehtqhhmtdhhtdejnecuhfhrohhmpeforght thhhvgifucfpvgifthhonhcuoehmrghttheskhhnohhsihhsrdhorhhgqeenucfkphepud ehjedrudefuddrvdehuddrgeelnecurfgrrhgrmhepmhgrihhlfhhrohhmpehmrghtthes khhnohhsihhsrdhorhhgnecuvehluhhsthgvrhfuihiivgeptd X-ME-Proxy: Original-Received: from [192.168.0.112] (157-131-251-49.fiber.dynamic.sonic.net [157.131.251.49]) by mail.messagingengine.com (Postfix) with ESMTPA id 643028005B; Wed, 22 May 2019 16:58:07 -0400 (EDT) In-Reply-To: <87v9yhi3ux.fsf@gmail.com> X-Mailer: Apple Mail (2.3445.104.11) 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: 209.51.188.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:159659 Archived-At: It seems that the more pressing issue is desktop handling byte code. > On May 11, 2019, at 5:15 AM, Noam Postavsky = wrote: >=20 > Matthew Newton writes: >=20 >> Apologies for reviving a stale bug but it appears to not be resolved = yet. >=20 > No apologies needed, on the contrary, thank you for looking at it. >=20 >> So there seem to be two bugs: >>=20 >> 1. `desktop-save-mode` doesn=E2=80=99t serialize/deserialize keyboard = macros >> properly (is it difficult to serialize a function object?) Would it make sense to simply do something like this? (defun desktop--v2s (value) ... (cond ((byte-code-function-p value) (let* ((pass1 (mapcar #'desktop--v2s value)) (special (assq nil pass1))) (if special (cons nil `(make-byte-code ,@(mapcar (lambda (el) (if (eq (car el) 'must) `',(cdr el) (cdr el))) pass1))) (cons 'may `[,@(mapcar #'cdr pass1)])))) =E2=80=A6)) I copied that from the `cond` clause for vector. It works in my limited = testing. Are there security concerns or other considerations? >=20 >> 2. Either :print-func and :insert-func should never be set to >> =E2=80=9CUnprintable entity=E2=80=9D or `register-val-describe` = should handle the case >> where they are set to that value instead of a function. >=20 > The "unprintable entity" comes from desktop--v2s, looks like it = doesn't > handle compiled function values, so that's why :print-func and > :insert-func get messed up like that. >=20 >> I=E2=80=99ve also seen =E2=80=9CUnprintable entity=E2=80=9D show up = when a buffer position >> register points to a nonexistent buffer. Not sure how to reproduce >> that one. >=20 > I guess if you save a position in a buffer, then kill the buffer. >=20 Here is what I found: if the killed buffer visits a file, it gets = converted into a file-query. If there is no `buffer-file-name` then it = stays a file marker pointing to nowhere. Desktop handles both of those = cases correctly. So while I have seen it happen I=E2=80=99m not sure of = the case where a buffer position register becomes an =E2=80=9CUnprintable = entity=E2=80=9D. Did you find reproduction steps? Cheers, Matt