all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Drew Adams <drew.adams@oracle.com>
To: Jean Louis <bugs@gnu.support>
Cc: Uwe Brauer <oub@mat.ucm.es>,
	"help-gnu-emacs@gnu.org" <help-gnu-emacs@gnu.org>
Subject: RE: [External] : Re: filemananger for emacs with meta information about a file without opening it
Date: Sat, 5 Nov 2022 21:05:09 +0000	[thread overview]
Message-ID: <SJ0PR10MB548825C9703CAAEDE7FF127DF33A9@SJ0PR10MB5488.namprd10.prod.outlook.com> (raw)
In-Reply-To: <Y2ZqF0IOTUqGCIzU@protected.localdomain>

> > Bookmark `aaa.el'
> > -----------------
> >
> > File:			aaa.el
> > Directory:		z:/foo/bar/toto/
> > Position:	          1
> > Visits:			5
> > Last visit:		7/30/2017 6:00:12 PM
> > Tags:
> >  "magenta"
> >  "orange"
> >  "blue"
>
>
> There it is, full tagging system without renaming files.
> But where are tags stored?

The tags for a bookmark are stored in the bookmark itself
(the bookmark record), under property `tags'.  See:

https://www.emacswiki.org/emacs/BookmarkPlus#BookmarkRecords

See here, for more description of tags, what their values
can be, and how you can use them:

https://www.emacswiki.org/emacs/BookmarkPlus#BookmarkTags

___

BTW, you say "full tagging system" - and you're right.
But I didn't say anything about that.  This tells you
about it:

https://www.emacswiki.org/emacs/BookmarkPlus#TagsAsAttributes

A tag is a string with any text - any length, any chars.
Beyond that, it can instead be a key-value pair: a cons
whose car is the tag name and whose cdr is an associated
value.  Here's a `tags' property from a bookmark record:

 (tags "bmkp-jump" ("bookmark-jump" lambda nil (message "Hello!"))
       "tata tuto titi"
       ("titi" . 42)
       ("foobar" foo bar)
       "beta"
       ("alpha"))

There are six tags there. Their names are "bmkp-jump",
"tata tuto titi", "titi", "foobar", "beta", and "alpha".

The value of "titi" is 42; the value of "foobar" is
`(foo bar)', the value of "alpha" is nil, and the value
of "bmkp-jump" is `("bookmark-jump" lambda nil (message
"Hello!"))'.  The tags named "tata tuto titi" and "beta"
have no associated value.  ("bmkp-jump" is a predefined
tag name - it's explained at the above link.)

___

BTW - Wrt the example you quoted above, I misspoke.
Instead of saying that a non-positive prefix arg means
include the autofile (bookmark) description, I should
have said this (from the `diredp-describe-file' doc):

  If the file has an autofile bookmark and you use
  library `Bookmark+', then show also the bookmark
  information (tags etc.).  In this case, a
  non-positive prefix arg shows the internal form
  of the bookmark.

So what that example shows is what you get with just
`C-h RET': if the file is an autofile then its description
includes the bookmark description.  With a non-positive
prefix arg you see the internal (i.e., Lisp) form of the
bookmark record:

_________________________________________

Bookmark `aaa.el'
-----------------

("aaa.el"
 (end-position . 1)
 (time 22910 33052 672000)
 (visits . 5)
 (tags "magenta" "orange" "blue")
 (filename . "z:/foo/bar/toto/aaa.el")
 (position . 1))


z:/foo/bar/toto/aaa.el
----------------------

File type:                  Normal file
Content type:               Lisp/Scheme program, UTF-8 Unicode text
Permissions:                -rw-rw-rw-
Size in bytes:              96476
Time of last access:        Sat Nov  5 13:17:36 2022 (Pacific Daylight Time)
Time of last modification:  Thu Feb 27 09:04:48 2014 (Pacific Standard Time)
Time of last status change: Wed Jul 25 07:58:32 2018 (Pacific Daylight Time)
Number of links:            1
User ID (UID):              37786
Group ID (GID):             513
Inode:                      281474976868278
Device number:              315267003
_________________________________________

Actually, by default the string that names the bookmark,
"aaa.el" in this example, is propertized, like this:

  #("aaa.el" 0 6 (bmkp-full-record #0))

That is, the bookmark name, which is the car of the
bookmark record, is a string with a property whose
value is the entire record (the cons whose car is that
string!).  This means the string itself is all that
any code needs, to get the full bookmark record.

(This is a kind of circular/self-referential object:
a list whose car is a string that contains that same
list as one of its text properties.  Another case of
Lisp chasing its tail.)

If the name is propertized then you can effectively
have more than one bookmark with the same name.

This is important, for example, for autofiles, whose
names are the nondir part of the file name.  You can
have the same autofile name for files with the same
name in different dirs.

Whether the name is thus propertized is controlled
by option `bmkp-propertize-bookmark-names-flag'.

  reply	other threads:[~2022-11-05 21:05 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-31 20:49 filemananger for emacs with meta information about a file without opening it Uwe Brauer
2022-11-02 12:26 ` Michael Heerdegen
2022-11-03  9:14   ` Uwe Brauer
2022-11-03  9:20     ` Emanuel Berg
2022-11-03 15:44       ` Uwe Brauer
2022-11-03 15:49         ` Emanuel Berg
2022-11-04 13:05           ` Uwe Brauer
2022-11-04 13:43             ` Eli Zaretskii
2022-11-04 17:48               ` Marcin Borkowski
2022-11-04  5:13     ` [External] : " Drew Adams
2022-11-04  7:28       ` Uwe Brauer
2022-11-04 16:00         ` Drew Adams
2022-11-05 13:50       ` Jean Louis
2022-11-05 21:05         ` Drew Adams [this message]
2022-11-03  6:49 ` Jean Louis
2022-11-03  7:56   ` tomas
2022-11-03  8:17     ` Yuri Khan
2022-11-03  8:44       ` tomas
2022-11-03 11:15       ` Michael Heerdegen
2022-11-04  3:22       ` Jean Louis
2022-11-04  3:21     ` Jean Louis
2022-11-03  9:01   ` Emanuel Berg

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=SJ0PR10MB548825C9703CAAEDE7FF127DF33A9@SJ0PR10MB5488.namprd10.prod.outlook.com \
    --to=drew.adams@oracle.com \
    --cc=bugs@gnu.support \
    --cc=help-gnu-emacs@gnu.org \
    --cc=oub@mat.ucm.es \
    /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.