[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: Temporary notes in Emacs buffers?

From: Drew Adams
Subject: RE: Temporary notes in Emacs buffers?
Date: Tue, 31 Dec 2019 22:25:37 -0800 (PST)

> > Bookmarks are pretty flexible.  You can use
> > them in lots of different ways.
> Yeah - probably.  What I dislike I think: if I move a file to a
> different location, the relation to the notes is lost, and I have to
> manually relocate the file.  That might be annoying.  That's why my
> favorite approach would be to save the data in the file itself or at
> least in its directory instead of a central place.  Or is there a
> solution for that problem using bookmarks, too?

If you move the destination of a bookmark (the
file or the positions in it) then, when you try
to jump to it:

* If the file is available, but the contexts for
  the recorded positions within it can't be
  found, then an attempt is made to relocate -
  searching for the recorded contexts (text
  before & after the positions.

  If that's not successful, because the file has
  changed too much, then you're prompted to
  relocate the positions.

* If the general location (e.g. file) has moved,
  then you're prompted to relocate it.

You can also manually relocate a bookmark's
target any time, of course.

But normally, if the file has not moved, when
you jump to a bookmark the target positions are
automatically updated (well, it's optional):
The recorded positions are used as a starting
point, and then the recorded contexts are found.
If those have moved then the new location is


There are advantages to saving annotations (e.g.
bookmarks) in a separate file from their targets.
And there are advantages of saving them in the
same file.

An annotation is a kind of metadata - a note
about the file content or a location.  There
are pros and cons for storing metadata and data
together.  This isn't special to file annotations.


You can have any number of bookmark files, and
they can be stored anywhere.  You can, as you
mention, store a file of bookmarks in the same
directory as the file or files that they target.

So you can, if you like, easily move both at
the same time, e.g. to another directory.

However, yes, the target file names recorded in
the bookmarks are absolute names.  So you would
want to define a command that not only moves the
bookmark file and its targeted files, together,
to the same new directory, but also updates the
recorded file names in the bookmarks, to reflect
the new target directory.  That wouldn't be hard.

You can also have bookmark lists composed of
bookmark lists.  And mappings between bookmark
files and bookmark lists need not be 1:1.  You
can have a bookmark file for a book you're
writing, and bookmark lists for each of its
chapters.  Or separate bookmark files for the

And you can bookmark a bookmark list, e.g.,
switch to a different chapter just by jumping
to a bookmark-list bookmark.

The only requirement is that a bookmark file
be separate from the files targeted by its
bookmarks.  Why?  Because, like a directory,
a bookmark file is a list of a bunch of files
and their metadata.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]