help-gnu-emacs
[Top][All Lists]
Advanced

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

RE: [External] : On Bookmarks+ package


From: Drew Adams
Subject: RE: [External] : On Bookmarks+ package
Date: Thu, 16 Feb 2023 17:38:25 +0000

> > Emacs bookmarks can "hold" anything you like.  For bookmarks that
> > you want to persist, the "anything" needs to be persistable and
> > readable.
> 
> I have 53111 elementary objects currently. While I call them
> Hyperdocuments and elementary objects, you call it bookmarks.
> 
> I was thinking bookmarks in Emacs are more narrowed types of
> objects. And did not expand my personal use of them.
> 
> Do you think that bookmarks(+) with it's implementation could scale to
> that number of objects without losing speed?

No idea.

As I said in the emacs-devel thread, typically bookmarks hold relatively little 
content.  They can refer to other content.  They can also hold however much 
content you like.  That doesn't mean it's a great idea to store all of the text 
from all of Wikipedia in a bookmark.  YMMV.

> > But typically bookmarks don't "hold" much data.  Instead, they point
> > to data that's available somewhere else (whether it's persisted or
> > not at that "somewhere else").
> 
> ...
> If I would keep LaTeX object or LaTeX text in bookmark, I would not
> know where it is stored really, it would be one file, but that file is
> not protected from influences from file system, and then single
> bookmark file would be bloated with hundreds or thousands of such
> objects, and external access to such objects, beyond Emacs Lisp, would
> not be possible. With the database it is easy, I can use external
> scripts to insert or share any objects.

Don't use bookmarks to hold tons of data.
Use a database for that, if you like, or
just files.  It's easy to store Lisp code
in a file, any file: see `write-file' and
`write-region', to start with.
 
> > There should be no inherent problem bookmarking a "non-file database
> > entry".  You just have to decide what you need to put in the
> > bookmark, to later get to it (e.g. restore it).
> 
> Exactly, I understand it, that is how it works here too. Though you
> speak in terms of programming capability, not of something that is
> already implemented.

You can bookmark any buffer, OOTB.

However, if just creating to or going to the
buffer isn't sufficient to restore what you
want there, then yes, of course, you need to
put into your bookmark data whatever you need
to get the buffer content/state you want.

Some predefined bookmark types for non-file
buffers do exactly that.  `man' bookmarks,
for example.  And Dired bookmarks.

If you're adding bookmarks for some kind of
buffer that doesn't have a predefined bookmark
type, then yes, just define what you need.

The rule is simple: whatever you store in a
bookmark is what's used to restore/"jump" to
its target.  Garbage in, or not enough info
in, means garbage out, or not enough info out.

> > You can sort, edit, tag – whatever non-invokable bookmarks, i.e.,
> > you can use bookmarks just to organize things.  (And you have
> > bookmarks that are invokable only in certain contexts.)
> 
> Please let me know, do you dwell in Bookmarks?

Nope.  I dwell on Earth.  Nor do bookmarks
dwell within me, AFAIK.

> That is what I do. My workspace is in Hyperscope and people. I have
> dashboard, reminders, and often dwell, spend time in that
> organization, finishing a document, sharing, editing, generated
> mixed-object document, sharing it, like that. All time there.
> 
> Do you actually use your bookmarks?

Yes.  Probably not as much as some others use theirs.

> How many times per day?

No idea.  Why?

> Here is how it works on my side, there are 215 elementary objects from
> last week. In a way they are similar to bookmarks, though I did not
> put much thinking into it. Is that how you spend time as well in your
> bookmarks?

I don't spend time in my bookmarks.

> > Bookmark tags are a good way to categorize things
> > and access them by combinations of such categories.
> 
> I understand tags, and I use them too, though in Hyperscope
> system. Each elementary object may be tagged. There are types of tags
> in my system, so there may be "subject tag" like "Computer tag", where
> meanining need not be same to other tag of same name. By using
> database, there is privilege that tags may be renamed, edited,
> described, they are objects itself, not only a word.

Bookmark+ tags are arbitrary strings, by default.
They're not jsut words.  And they can also be
conses: (STRING . ANYTHING), where ANYTHING is
any Lisp value.

If the tagged bookmark is to be persisted
(which is typical), then ANYTHING needs to be
persistable and Lisp-readable.

I've mentioned this (all of this, in fact) to
you before.  Maybe you're really wanting to
talk about your database setup and what you do
with it?  If so, I have nothing to say about
your setup; sorry.

I don't say you should use Bookmark+ or bookmarks,
or in particular that you should use them instead
of what you're using now.

I can tell that you're somewhat interested in
Bookmark+ and bookmarks.  Then I'd say try using
bookmarks for some things, and see if you like
that and it helps.  If not, don't bother with
bookmarks.

> > Org mode, for example, lets you embed different kinds of things in
> > an Org buffer/file.  You can tag them, link them, annotate them, and
> > act on them in any number of ways.  A big difference here is that
> > the info/data of the things, and the tags and links and
> > annotations... are in the Org file, along with the other things and
> > any "main" text.
> 
> Ok, that gives me idea that your bookmark+ bookmarks can also be
> tasks, notes, right?

Dunno what you have in mind.  Maybe.  A bookmark
is just a persisted bit of text (code) that you
can use to do something.  It can do anything you
like.  As I said, it's essentially a named,
persistent (doesn't have to be, but can be),
closure.  What you define it to be, it is.  What
you use it for is up to you.

> Then by using tags, or other associations, you could reconstruct whole
> document, right?

I suppose so.  I can't really help with your
imaginings, and I'm sure you can imagine what
you want/need.  If bookmarks help you get what
you imagine, great.  If not, open the tool
chest and try another tool.

> [Ideas about Org and LaTeX...]

Bookmarks and Bookmark+ are not a replacement
for Org mode or LaTeX etc.  They're a basic
tool.  If you want to build an alternative to
Org or whatever, maybe you can make use of
bookmarks somehow to help you do that.  Dunno.

> With bookmarks, or elementary objects, I could use tags, or various
> intersections, mark some objects and with single key press produce the
> mixed-object document.

Yes, I suppose you could.  You'll need to do
some coding, to get there, I expect.

> > The implementation of bookmarks, as text files of Lisp code, is fine
> > for many use cases.  It fits the use of any number of bookmark
> > files, each of which is not gigantic.
> 
> Could they really work with 50000 objects? Did you ever test the speed
> of accessing, using them?

No, I haven't.  What would be in your 50,000
Lisp codelets?  How would they be put to use?

You're asking whether 50,000 snippets of Lisp
code can be used.   W a y   t o o   abstract.

> > But yes, Someone (TM), sometime, will hopefully do things such as:
> >
> > 1. Allow (also) for binary ("compiled") bookmark
> >    formats (and thus files).
> 
> Is that for reasons of speed?

If you expect bookmarks to be large code
blocks or large data blocks, then obviously
text isn't the most performant or disk-space
conserving.

It's a bit like Elisp vs Common Lisp.  Most
uses of Elisp don't require hyperperformance.
Common Lisp is a much more general programming
language, and it's important (for some apps)
that it be as performant as Fortran or C (or
better).

Not so (so far), for most Elisp uses.  Same
thing for most bookmark uses.  If you want to
push the envelope then you might want binary
bookmark data.  Bookmark+ doesn't have/support
that now.  And I doubt that I, at least, will
ever get around to adding that.  But sure, it
would be a good thing to have - why not?

> I asked you if that following is also possible with Bookmarks Plus:
> - create bookmark, let us say "ABC"
> - edit ABC as text, representing note, task
> 
> I understand that it can be done programmatically in future, but is it
> already there maybe? I know annotations are there, so in the sense it
> is very similar to my use cases.

Didn't know that you asked me that.

You can edit the source code of any bookmark,
yes.  The Edit submenu of menu Bookmark+ has
these items for that:

 Edit Full Record (Lisp)            - bound to `e'
 Edit Full Records of Marked (Lisp) - bound to `E'       

(You can also do the same for just bookmark
annotations.)

> I cannot find [function `bmkp-types-alist' using `grep']
> When I load "bookmark+" I cannot find that function.
> Debugger entered--Lisp error: (void-function bmkp-types-alist)
> I cannot find the function.

It's been in Bookmark+ since 2021/03/04.  It's in
file bookmark+-1.el.  The latest published version
of the file is this - maybe you need to update?

;; Last-Updated: Wed Sep  7 15:50:09 2022 (-0700)
;;           By: dradams
;;     Update #: 9488

HTH.

reply via email to

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