all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#12503: 24.2.50; `bookmark-write-file' should bind `print-circle' to t
@ 2012-09-24 16:11 Drew Adams
  2012-10-01  3:48 ` bug#12503: " Karl Fogel
  0 siblings, 1 reply; 2+ messages in thread
From: Drew Adams @ 2012-09-24 16:11 UTC (permalink / raw
  To: 12503

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'
 






^ permalink raw reply	[flat|nested] 2+ messages in thread

* bug#12503: `bookmark-write-file' should bind `print-circle' to t
  2012-09-24 16:11 bug#12503: 24.2.50; `bookmark-write-file' should bind `print-circle' to t Drew Adams
@ 2012-10-01  3:48 ` Karl Fogel
  0 siblings, 0 replies; 2+ messages in thread
From: Karl Fogel @ 2012-10-01  3:48 UTC (permalink / raw
  To: 12503-done

Done:

  revno: 110307
  revision-id: kfogel@red-bean.com-20121001034459-o8irfybe8zo6mum6
  parent: kfogel@red-bean.com-20121001033402-6jrmk69xzz30h3zw
  committer: Karl Fogel <kfogel@red-bean.com>
  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.





^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2012-10-01  3:48 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-09-24 16:11 bug#12503: 24.2.50; `bookmark-write-file' should bind `print-circle' to t Drew Adams
2012-10-01  3:48 ` bug#12503: " Karl Fogel

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.