From unknown Tue Jun 17 01:47:05 2025 X-Loop: help-debbugs@gnu.org Subject: bug#12503: 24.2.50; `bookmark-write-file' should bind `print-circle' to t Resent-From: "Drew Adams" Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 24 Sep 2012 16:14:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 12503 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: 12503@debbugs.gnu.org X-Debbugs-Original-To: Received: via spool by submit@debbugs.gnu.org id=B.134850323813628 (code B ref -1); Mon, 24 Sep 2012 16:14:01 +0000 Received: (at submit) by debbugs.gnu.org; 24 Sep 2012 16:13:58 +0000 Received: from localhost ([127.0.0.1]:53408 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TGBID-0003Xk-Bn for submit@debbugs.gnu.org; Mon, 24 Sep 2012 12:13:57 -0400 Received: from eggs.gnu.org ([208.118.235.92]:51668) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TGBIA-0003Xb-RG for submit@debbugs.gnu.org; Mon, 24 Sep 2012 12:13:55 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TGBGI-0005xW-Uj for submit@debbugs.gnu.org; Mon, 24 Sep 2012 12:11:59 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_HI, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.2 Received: from lists.gnu.org ([208.118.235.17]:56330) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TGBGI-0005xS-RC for submit@debbugs.gnu.org; Mon, 24 Sep 2012 12:11:58 -0400 Received: from eggs.gnu.org ([208.118.235.92]:52676) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TGBGH-0003JF-ME for bug-gnu-emacs@gnu.org; Mon, 24 Sep 2012 12:11:58 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TGBGC-0005wa-W4 for bug-gnu-emacs@gnu.org; Mon, 24 Sep 2012 12:11:57 -0400 Received: from rcsinet15.oracle.com ([148.87.113.117]:49711) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TGBGC-0005wT-P7 for bug-gnu-emacs@gnu.org; Mon, 24 Sep 2012 12:11:52 -0400 Received: from acsinet21.oracle.com (acsinet21.oracle.com [141.146.126.237]) by rcsinet15.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with ESMTP id q8OGBois007755 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Mon, 24 Sep 2012 16:11:51 GMT Received: from acsmt358.oracle.com (acsmt358.oracle.com [141.146.40.158]) by acsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id q8OGBoLr013409 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Mon, 24 Sep 2012 16:11:50 GMT Received: from abhmt108.oracle.com (abhmt108.oracle.com [141.146.116.60]) by acsmt358.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id q8OGBoWQ014268 for ; Mon, 24 Sep 2012 11:11:50 -0500 Received: from dradamslap1 (/10.159.184.43) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Mon, 24 Sep 2012 09:11:49 -0700 From: "Drew Adams" Date: Mon, 24 Sep 2012 09:11:36 -0700 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Office Outlook 11 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.6157 Thread-Index: Ac2ab0V0dcONe3Q6RfmnXhedeA7S3Q== X-Source-IP: acsinet21.oracle.com [141.146.126.237] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 1) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 208.118.235.17 X-Spam-Score: -6.1 (------) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -6.1 (------) Users can define their own bookmark types, which can store anything at all in bookmark records, that is, any Lisp objects. Such objects can contain circularities: one part referring to another part or to the whole - IOW circular lists. When `bookmark-write-file' writes a bookmark list to the bookmark file, it takes care to bind `print-length' and `print-level' to nil, but it does yet not bind `print-circle' to t. It should do that as well. The result currently is that a user's bookmark file can be corrupted, becoming unreadable because it contains invalid Lisp `read' syntax. I have seen this a couple of times now, with users of Bookmark+. Bookmark+ does use bookmarks that have circular structure, and it saves them correctly by binding `print-circle' to t. A user can read such a bookmark file into vanilla Emacs, and s?he can use the bookmarks there. But if s?he then saves the file again, in vanilla Emacs, the result is invalid Lisp. The file cannot be read (in either vanilla Emacs or Bookmark+). The user has lost bookmarks and can recuperate them only by hand-editing the corrupted file, which is laborious and error prone. The simple change of binding `print-circle' to t will have no negative effect on bookmark.el behavior, and it will solve the problem, preventing data loss if users have defined bookmark structures that are circular. In GNU Emacs 24.2.50.1 (i386-mingw-nt5.1.2600) of 2012-09-17 on MARVIN Bzr revision: 110062 cyd@gnu.org-20120917054104-r93rtwkrtva73ewe Windowing system distributor `Microsoft Corp.', version 5.1.2600 Configured using: `configure --with-gcc (4.7) --no-opt --enable-checking --cflags -ID:/devel/emacs/libs/libXpm-3.5.8/include -ID:/devel/emacs/libs/libXpm-3.5.8/src -ID:/devel/emacs/libs/libpng-dev_1.4.3-1/include -ID:/devel/emacs/libs/zlib-dev_1.2.5-2/include -ID:/devel/emacs/libs/giflib-4.1.4-1/include -ID:/devel/emacs/libs/jpeg-6b-4/include -ID:/devel/emacs/libs/tiff-3.8.2-1/include -ID:/devel/emacs/libs/gnutls-3.0.9/include -ID:/devel/emacs/libs/libiconv-1.13.1-1-dev/include -ID:/devel/emacs/libs/libxml2-2.7.8/include/libxml2' From unknown Tue Jun 17 01:47:05 2025 MIME-Version: 1.0 X-Mailer: MIME-tools 5.428 (Entity 5.428) X-Loop: help-debbugs@gnu.org From: help-debbugs@gnu.org (GNU bug Tracking System) To: "Drew Adams" Subject: bug#12503: closed (Re: `bookmark-write-file' should bind `print-circle' to t) Message-ID: References: <87obkmhmxk.fsf@floss.red-bean.com> X-Gnu-PR-Message: they-closed 12503 X-Gnu-PR-Package: emacs Reply-To: 12503@debbugs.gnu.org Date: Mon, 01 Oct 2012 03:50:02 +0000 Content-Type: multipart/mixed; boundary="----------=_1349063402-4195-1" This is a multi-part message in MIME format... ------------=_1349063402-4195-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Your bug report #12503: 24.2.50; `bookmark-write-file' should bind `print-circle' to t which was filed against the emacs package, has been closed. The explanation is attached below, along with your original report. If you require more details, please reply to 12503@debbugs.gnu.org. --=20 12503: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D12503 GNU Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1349063402-4195-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 12503-done) by debbugs.gnu.org; 1 Oct 2012 03:49:27 +0000 Received: from localhost ([127.0.0.1]:35333 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TIX0Z-00014n-4v for submit@debbugs.gnu.org; Sun, 30 Sep 2012 23:49:27 -0400 Received: from mail-ie0-f172.google.com ([209.85.223.172]:53856) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TIX0W-00014d-V5 for 12503-done@debbugs.gnu.org; Sun, 30 Sep 2012 23:49:25 -0400 Received: by iec9 with SMTP id 9so11839026iec.3 for <12503-done@debbugs.gnu.org>; Sun, 30 Sep 2012 20:49:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:subject:reply-to:date:message-id:mime-version :content-type; bh=zoh3Kh/fH515nJhqogCJCM6wRfKtz/Zjk8sPwg4F4KM=; b=MztVEjJCO0oacqRUXiRZnzrhJCYSzM8wU+yuS1Jf/1myO2XGKPyMUTca3wrL7gVF2U lIs8hZya36RfoR5NMLHaCNpGU1cnukN0aaPVj9/BbT6IuK4WcdC/9cHl63AWaxHV8qDs 6MOwCV9BGchYTM2zh5PgZa6+mtt6T4VSNeqtSYxlk64q+7D/wrNwp8jkgZRige1mqnZB UNxOgFTidURyK3WBBiupRoIeQ6qEvh9oGUqAfOp+vspIml/zEtaNUIZi2hSh0hnwA2Pv eZlZETjbRxRo2OrOUeBQ4PAiMxxngwbW0MRJ7WYEhpT7MQNwJP8Z4iydeUHgAzOdRZEm vUmg== Received: by 10.50.163.70 with SMTP id yg6mr4458956igb.30.1349063340373; Sun, 30 Sep 2012 20:49:00 -0700 (PDT) Received: from floss.red-bean.com (173-109-178-220.pools.spcsdns.net. [173.109.178.220]) by mx.google.com with ESMTPS id uj6sm6195183igb.4.2012.09.30.20.48.58 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 30 Sep 2012 20:48:59 -0700 (PDT) From: Karl Fogel To: 12503-done@debbugs.gnu.org Subject: Re: `bookmark-write-file' should bind `print-circle' to t Date: Sun, 30 Sep 2012 22:48:55 -0500 Message-ID: <87obkmhmxk.fsf@floss.red-bean.com> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 12503-done X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list Reply-To: Karl Fogel List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -0.7 (/) Done: revno: 110307 revision-id: kfogel@red-bean.com-20121001034459-o8irfybe8zo6mum6 parent: kfogel@red-bean.com-20121001033402-6jrmk69xzz30h3zw committer: Karl Fogel branch nick: trunk timestamp: Sun 2012-09-30 22:44:59 -0500 message: * lisp/bookmark.el (bookmark-write-file): Bind `print-circle' to `t' here to allow circular custom bookmark types. (Bug#12503) Diff: --- lisp/bookmark.el 2012-10-01 03:34:02 +0000 +++ lisp/bookmark.el 2012-10-01 03:41:42 +0000 @@ -1359,7 +1359,12 @@ (goto-char (point-min)) (delete-region (point-min) (point-max)) (let ((print-length nil) - (print-level nil)) + (print-level nil) + ;; See bug #12503 for why we bind `print-circle'. Users + ;; can define their own bookmark types, which can result in + ;; arbitrary Lisp objects being stored in bookmark records, + ;; and some users create objects containing circularities. + (print-circle t)) (bookmark-insert-file-format-version-stamp) (insert "(") ;; Rather than a single call to `pp' we make one per bookmark. ------------=_1349063402-4195-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by debbugs.gnu.org; 24 Sep 2012 16:13:58 +0000 Received: from localhost ([127.0.0.1]:53408 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TGBID-0003Xk-Bn for submit@debbugs.gnu.org; Mon, 24 Sep 2012 12:13:57 -0400 Received: from eggs.gnu.org ([208.118.235.92]:51668) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TGBIA-0003Xb-RG for submit@debbugs.gnu.org; Mon, 24 Sep 2012 12:13:55 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TGBGI-0005xW-Uj for submit@debbugs.gnu.org; Mon, 24 Sep 2012 12:11:59 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_HI, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.2 Received: from lists.gnu.org ([208.118.235.17]:56330) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TGBGI-0005xS-RC for submit@debbugs.gnu.org; Mon, 24 Sep 2012 12:11:58 -0400 Received: from eggs.gnu.org ([208.118.235.92]:52676) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TGBGH-0003JF-ME for bug-gnu-emacs@gnu.org; Mon, 24 Sep 2012 12:11:58 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TGBGC-0005wa-W4 for bug-gnu-emacs@gnu.org; Mon, 24 Sep 2012 12:11:57 -0400 Received: from rcsinet15.oracle.com ([148.87.113.117]:49711) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TGBGC-0005wT-P7 for bug-gnu-emacs@gnu.org; Mon, 24 Sep 2012 12:11:52 -0400 Received: from acsinet21.oracle.com (acsinet21.oracle.com [141.146.126.237]) by rcsinet15.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with ESMTP id q8OGBois007755 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Mon, 24 Sep 2012 16:11:51 GMT Received: from acsmt358.oracle.com (acsmt358.oracle.com [141.146.40.158]) by acsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id q8OGBoLr013409 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Mon, 24 Sep 2012 16:11:50 GMT Received: from abhmt108.oracle.com (abhmt108.oracle.com [141.146.116.60]) by acsmt358.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id q8OGBoWQ014268 for ; Mon, 24 Sep 2012 11:11:50 -0500 Received: from dradamslap1 (/10.159.184.43) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Mon, 24 Sep 2012 09:11:49 -0700 From: "Drew Adams" To: Subject: 24.2.50; `bookmark-write-file' should bind `print-circle' to t Date: Mon, 24 Sep 2012 09:11:36 -0700 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Office Outlook 11 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.6157 Thread-Index: Ac2ab0V0dcONe3Q6RfmnXhedeA7S3Q== X-Source-IP: acsinet21.oracle.com [141.146.126.237] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 1) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 208.118.235.17 X-Spam-Score: -6.1 (------) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -6.1 (------) Users can define their own bookmark types, which can store anything at all in bookmark records, that is, any Lisp objects. Such objects can contain circularities: one part referring to another part or to the whole - IOW circular lists. When `bookmark-write-file' writes a bookmark list to the bookmark file, it takes care to bind `print-length' and `print-level' to nil, but it does yet not bind `print-circle' to t. It should do that as well. The result currently is that a user's bookmark file can be corrupted, becoming unreadable because it contains invalid Lisp `read' syntax. I have seen this a couple of times now, with users of Bookmark+. Bookmark+ does use bookmarks that have circular structure, and it saves them correctly by binding `print-circle' to t. A user can read such a bookmark file into vanilla Emacs, and s?he can use the bookmarks there. But if s?he then saves the file again, in vanilla Emacs, the result is invalid Lisp. The file cannot be read (in either vanilla Emacs or Bookmark+). The user has lost bookmarks and can recuperate them only by hand-editing the corrupted file, which is laborious and error prone. The simple change of binding `print-circle' to t will have no negative effect on bookmark.el behavior, and it will solve the problem, preventing data loss if users have defined bookmark structures that are circular. In GNU Emacs 24.2.50.1 (i386-mingw-nt5.1.2600) of 2012-09-17 on MARVIN Bzr revision: 110062 cyd@gnu.org-20120917054104-r93rtwkrtva73ewe Windowing system distributor `Microsoft Corp.', version 5.1.2600 Configured using: `configure --with-gcc (4.7) --no-opt --enable-checking --cflags -ID:/devel/emacs/libs/libXpm-3.5.8/include -ID:/devel/emacs/libs/libXpm-3.5.8/src -ID:/devel/emacs/libs/libpng-dev_1.4.3-1/include -ID:/devel/emacs/libs/zlib-dev_1.2.5-2/include -ID:/devel/emacs/libs/giflib-4.1.4-1/include -ID:/devel/emacs/libs/jpeg-6b-4/include -ID:/devel/emacs/libs/tiff-3.8.2-1/include -ID:/devel/emacs/libs/gnutls-3.0.9/include -ID:/devel/emacs/libs/libiconv-1.13.1-1-dev/include -ID:/devel/emacs/libs/libxml2-2.7.8/include/libxml2' ------------=_1349063402-4195-1--