all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "Drew Adams" <drew.adams@oracle.com>
To: "'Sebastien Vauban'" <wxhgmqzgwmuf@spammotel.com>,
	<help-gnu-emacs@gnu.org>
Subject: RE: Bookmarks: (invalid-read-syntax "#")
Date: Thu, 13 Sep 2012 07:43:24 -0700	[thread overview]
Message-ID: <9DBFE2669D194EB1B20134AE5DF7A212@us.oracle.com> (raw)
In-Reply-To: <80fw6n2he8.fsf@somewhere.org>

Hi Seb,

Please feel free to follow up with me off list.  I've had 2 other reports of the
same problem over the past year.  Somehow your file bookmark got corrupted.
This is no doubt a problem due to Bookmark+, but I don't yet know how/why.  I
would like to get more info, if possible.

The bottom line about the fix is that you will need to either revert to a backup
copy of your bookmark file or edit it by hand.  See below.  (See also option
`bookmark-version-control' - you might want to set it to `t' from now on, to be
sure of having a good backup file.)

Bookmark+ can optionally save propertized strings (e.g., the bookmark name) to
your bookmark file - see option 'bmkp-propertize-bookmark-names-flag'.  And
somehow the printout to your bookmark file produced bad `read' syntax, so the
file cannot be loaded.

The advantages of saving propertized strings include having multiple bookmarks
with the same name.  This is important for autofile bookmarks because the
bookmark name is only the non-directory part of the file name. This Bookmark+
feature lets you have different autofile bookmarks for files of the same name in
different directories.

The bookmark name saved in the bookmark has a text property that contains the
complete bookmark information, so that all that is needed is that string.  Such
a bookmark is (should be) saved like this:

#1=(#("foo" 0 13 (bmkp-full-record #1#))
    (filename . "c:/mydir/foo")
    (buffer-name . "foo")
    (front-context-string)
    (rear-context-string)
    (front-context-region-string)
    (rear-context-region-string)
    (visits . 0)
    (time 20442 4422 172000)
    (created 20442 4422 172000)
    (position . 1)
    (end-position . 1))

The bookmark name, `foo', is this propertized string:
#("foo" 0 13 (bmkp-full-record #1#)

The #1= and #1# syntax is how Emacs writes a circular reference.  #1 refers to
the entire bookmark structure, and you can see that the string "foo" is
propertized with property `bmkp-full-record' which has the value #1#, which is a
reference to #1, i.e., to the entire bookmark structure.

But somehow, with the problem you are seeing, it got saved like this, which has
invalid read syntax:

#("foo" 0 13 (bmkp-full-record #0))

See also these parts of the doc:
http://www.emacswiki.org/cgi-bin/wiki/BookmarkPlus#toc65
http://www.emacswiki.org/cgi-bin/wiki/BookmarkPlus#toc34

If you do any hand editing of your bookmarks file, be sure to 
back it up first, even if it is corrupted.  It is a 
plain-text file, so it can always be edited to fix things.

> ((#("lit fait mvmt" 0 16
>    (bmkp-full-record #0))
>  (filename . "~/Projects/entr.awk")
>  (buffer-name . "entr.awk")
>  (front-context-string . "function lit_fai")
>  (rear-context-string . "nes incorrectes\n")
>  (front-context-region-string)
>  (rear-context-region-string)
>  (visits . 0)
>  (time 20521 6580 48000)
>  (created 20521 6580 48000)
>  (position . 59496)
>  (end-position . 59496))
>
> but I don't dare modifying that file by hand, as I'm not 
> supposed to do it.

You will have to edit it by hand, or else revert to a backup copy of your
bookmark file.  The editing is no big deal (but could take a while if you have
many such invalid bookmarks): Just replace the #("..." ...) with "...".  So in
this case, you get (("lit fait mvmt" (filename ....) (buffer-name...)...)

Again, please feel free to follow up with me off list.  I would like to figure
out what is sometimes causing this problem.  Sorry for the trouble.

Thx - Drew




  reply	other threads:[~2012-09-13 14:43 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-12 19:03 Bookmarks: (invalid-read-syntax "#") Sebastien Vauban
2012-09-13 14:43 ` Drew Adams [this message]
2012-09-24 16:36   ` Drew Adams

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=9DBFE2669D194EB1B20134AE5DF7A212@us.oracle.com \
    --to=drew.adams@oracle.com \
    --cc=help-gnu-emacs@gnu.org \
    --cc=wxhgmqzgwmuf@spammotel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.