[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: bookmark+ help required
From: |
Guido Van Hoecke |
Subject: |
Re: bookmark+ help required |
Date: |
Wed, 15 Apr 2015 23:14:15 +0200 |
Thanks Milan, Tomas and Drew.
I adopted Drew's solution and updated the wiki
Guido
On 15 April 2015 at 22:23, Drew Adams <drew.adams@oracle.com> wrote:
> > I switched to bookmark+ and some of my bookmarks now have a different
> > format:
> >
> > Old format:
> > #1=(#("past.org" 0 8
> > (bmkp-full-record #1#))
> > (filename . "~/org/past.org")
> > (front-context-string . "* DONE <2013-04-")
> > (rear-context-string)
> > (position . 1))
> >
> > New format:
> > #1=(#("agenda.org" 0 10
> > (bmkp-full-record #1#))
> > (end-position . 12206)
> > (time 21790 27563 50717 0)
> > (visits . 0)
> > (filename . "~/org/agenda.org")
> > (front-context-string . "* TODO <2013-05-")
> > (rear-context-string . "g niet gestart!\n")
> > (position . 12206))
> >
> > I have an eshell function that allows me to type `j bookmark` (got it
> > from http://www.emacswiki.org/emacs/EshellBmk (thanks!)) and it fails
> > with the new format: it expects the 'filename' cell up front in the
> > record. That works with the old records, but not the new ones. In the
> > above 'agenda.org' bookmark it thinks that the filename is '12206'.
> >
> > Here's the relevant code:
> > (if (setq filename (cdr (car (bookmark-get-bookmark-record bookmark))))
>
> That code is mistaken. This is the proper code to access the `filename'
> field of bookmark BOOKMARK:
>
> (bookmark-get-filename BOOKMARK)
>
> And for any field that does not have its own dedicated access function
> (such as field `filename' has with `bookmark-get-filename'), code should
> use `bookmark-prop-get' to access that field value.
>
> This is not Bookmark+-specific. This is what is used for vanilla
> bookmark.el also. The order of the field recorded in a bookmark is
> (must be) irrelevant. The only positional requirement is that the
> bookmark name be the car of the full bookmark record.
>
> > My lisp is not up to turning this into an expression that would
> > correctly load the filename from old formats as well as from the newer
> > format. Any help and suggestion would be most welcome and appreciated.
>