emacs-devel
[Top][All Lists]
Advanced

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

RE: Friendlier dired experience [CODE INCLUDED]


From: Drew Adams
Subject: RE: Friendlier dired experience [CODE INCLUDED]
Date: Sun, 8 Nov 2020 08:48:51 -0800 (PST)

> > > So, I suppose a way to 'hijack' the bookmark process would be to
> > > advise around function bookmark-default-handler checking for the
> > > current buffer's major-mode, the state of variable diredc-mode and
> > > whether the bookmark is a directory. The ugly part of the 'hijack'
> > > is keeping the code of the advice in sync with the underlying
> > > function.
> >
> > Are you looking for a way to have your own bookmark-handling code do
> > what you want with a vanilla bookmark for a directory? Is that it?
> 
> Don't pin this on me, Drew. I was just responding
> to Stefan Monnier's proposal.

Excuse me?  I'm not pinning anything on anyone.

I was trying to help, by suggesting that a custom
bookmark handler might be an alternative to your
needing to "'hijack' the bookmark process" by
advising `bookmark-default-handler'".

If that suggestion doesn't help, just ignore it.

> > Why not instead define your own bookmark handler for directory
> > bookmarks? That's what bookmark handlers are for.
> 
> Because a specific bookmark's handler is hard-coded into the
> data-structure when added, so which ever function creates the bookmark,
> be it ye olde function bookmark-set or the new kid diredc, that's the
> function that defines the handler to be used.

OK.  So you don't want specific data in the bookmark
itself, right?  You instead want a plain vanilla
bookmark, but you want it to be handled specially,
right?  And I guess you want _all_ plain bookmarks
to be handled in the same special way (since they're
plain, they presumably can't be distinguished by
their data), right?

If so, then another alternative might be to advise
`bookmark-handle-bookmark'.  Not that that would
make much/any difference from advising the default
handler function.

> > FWIW - In Bookmark+ Dired buffers have their
> > own bookmark handler.
> 
> That's very sensible and should be what function bookmark-set does
> instead of what it does now which is run through a set of conditionals.

The only conditionals I see in vanilla `bookmark-set'
have to do with handling the arg `overwrite-or-push'.
I don't see what that has to do with Dired bookmarking.

But it's not very important that I understand you,
especially if my comments aren't welcome.  I mention
that only in case you want to clarify for others.

> > Bookmarking a Dired buffer records not just the directory location
> > but also its `ls' switches, which files are marked, which subdirs are
> > inserted, and which (sub)dirs are hidden. Jumping to a Dired bookmark
> > restores all of that.
> 
> That's why I never end up actually ever using your extensions, Drew. I
> think they're great and I enjoy reading them, but it always ends up
> intimidating me with a sense of overkill.

Sorry.  Luckily, no one's forced to download or use them.



reply via email to

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