all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Drew Adams <drew.adams@oracle.com>
To: Michael Heerdegen <michael_heerdegen@web.de>
Cc: Help Gnu Emacs mailing list <help-gnu-emacs@gnu.org>
Subject: RE: Temporary notes in Emacs buffers?
Date: Thu, 2 Jan 2020 07:41:25 -0800 (PST)	[thread overview]
Message-ID: <55128372-5012-407d-9b70-cbbd5e9225e0@default> (raw)
In-Reply-To: <1d24a14a-b38a-4a66-b6d0-cca8aff7dacc@default>

> You can define a bookmark handler for any type of
> bookmark.  The handler could ignore the directory
> part of the recorded file name, and get the needed
> directory from somewhere else, e.g., from a global
> variable or a function.  (It has to come from
> somewhere.)  E.g., a variable could have an alist
> value with keys for your different whatevers (even
> nondir-filename keys) and with dirs as the values.
> 
> But then you'd have to update the variable value
> when you move the targeted files.  As I said before,
> you can write code that does something like that
> (my earlier suggestion was code that changes the
> target-file names in the bookmarks, but that's not
> great) - e.g. code that's kicked off by a bespoke
> file-move command.  (But then you have to remember
> to use that command to move such files...)
> 
> However you look at it, the target file is separate
> from bookmarks that refer to it - that's the nature
> of the thing.  Something has to let either the
> bookmarks themselves or the bookmark-handling code
> know where you moved the target file.

Let me add this:

If your use case is limited to being in the same
directory as the file targeted by your bookmark(s),
then you can just use `default-directory' in your
handler, as the directory in which to look up the
file name (ignoring any recorded directory).

This could be the case, e.g., if you always accessed
your bookmarks from the file itself (e.g., at their
highlighted locations there).  That's the case we've
been discussing, at least in part.

It's also possible to use `default-directory' if
you want to use a relative file name that includes
more than just the non-directory part.  E.g., if
your file is in a subdir of `default-directory`
(current pwd), then you could look it up using
the relevant part of the recorded absolute file
name.  (Or your new bookmark type could record
only such a relevant part as the target location.)

This could be the case if you access the bookmarks
from a parent or other directory (relative file
names can include `../' etc.), but you'll know
where you'll access them from, so the handler can
assume that directory - no need to look it up
somewhere.

There are various possibilities, depending on just
what you might want to do.



  reply	other threads:[~2020-01-02 15:41 UTC|newest]

Thread overview: 60+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-27 10:19 Temporary notes in Emacs buffers? Marcin Borkowski
2019-12-27 10:43 ` Mpho Jele
2019-12-27 11:51   ` tomas
2020-01-01 21:48     ` Marcin Borkowski
2019-12-27 15:54 ` Drew Adams
2020-01-02 17:49   ` Marcin Borkowski
2020-01-05  2:37   ` Michael Heerdegen
2020-01-05 17:54     ` Drew Adams
2020-01-06  5:18       ` Jean-Christophe Helary
2020-01-06 15:12         ` Drew Adams
2020-01-09  1:03           ` Michael Heerdegen
2020-01-09 23:35             ` arthur miller
2020-01-10  4:58               ` Michael Heerdegen
2020-01-10  9:30                 ` Robert Pluim
2020-01-10 10:01                   ` Michael Heerdegen
2020-01-10 17:04                   ` Drew Adams
2020-01-10  9:10               ` Unknown
2019-12-27 17:48 ` Sharon Kimble
2020-01-01  1:42 ` Michael Heerdegen
2020-01-01  4:45   ` Drew Adams
2020-01-01  5:00     ` Michael Heerdegen
2020-01-01  6:25       ` Drew Adams
2020-01-01 20:34         ` John Yates
2020-01-01 21:19           ` Drew Adams
2020-01-01 21:47           ` Marcin Borkowski
2020-01-02  1:25         ` Michael Heerdegen
2020-01-02  3:16           ` Drew Adams
2020-01-02  3:45             ` Michael Heerdegen
2020-01-02  5:30               ` Drew Adams
2020-01-02 15:41                 ` Drew Adams [this message]
2020-01-03  1:07                 ` Michael Heerdegen
2020-01-03  3:35                   ` John Yates
2020-01-03  6:38                     ` Drew Adams
2020-01-03  7:06                     ` Drew Adams
2020-01-04  6:39                     ` Michael Heerdegen
2020-01-04 16:04                       ` Drew Adams
2020-01-06 14:18                         ` John Yates
2020-01-06 14:34                           ` tomas
2020-01-06 15:19                             ` John Yates
2020-01-06 15:31                               ` tomas
2020-01-06 16:28                               ` arthur miller
2020-01-03  7:00                   ` Drew Adams
2020-01-03 13:31                   ` arthur miller
2020-01-05  2:18                     ` Michael Heerdegen
2020-01-11  7:36         ` Michael Heerdegen
2020-01-11 10:00           ` Jean-Christophe Helary
2020-01-11 11:38             ` Michael Heerdegen
2020-01-11 16:00           ` Drew Adams
2020-01-11 23:46             ` John Yates
2020-01-12  2:47               ` Drew Adams
2020-01-12  7:31             ` Michael Heerdegen
2020-01-12 16:37               ` Drew Adams
2020-01-14  7:08                 ` Michael Heerdegen
2020-01-14 17:32                   ` Drew Adams
2020-01-15 23:10                     ` Drew Adams
2020-01-02 17:48     ` Marcin Borkowski
2020-01-02 17:48   ` Marcin Borkowski
2020-01-09  3:57 ` Michael Heerdegen
2020-01-15 18:43   ` Marcin Borkowski
2020-01-20 12:40     ` Michael Heerdegen

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=55128372-5012-407d-9b70-cbbd5e9225e0@default \
    --to=drew.adams@oracle.com \
    --cc=help-gnu-emacs@gnu.org \
    --cc=michael_heerdegen@web.de \
    /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.