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: Boruch Baum
Subject: Re: Friendlier dired experience [CODE INCLUDED]
Date: Fri, 6 Nov 2020 04:15:25 -0500
User-agent: NeoMutt/20180716

On 2020-11-05 10:05, Stefan Monnier wrote:
> >> How do you do bookmarks? I just bookmarked a folder with your shortcut
> >> C-c b a; and the bookmark does not show in bookmarks list.
> > diredc-bookmark-* doesn't share the generic emacs bookmark list. The
> > consideration was not mix directory locations with locations within
> > files. I know that emacs bookmarks works on directories and opens a
> > dired buffer for them, but it made no sense to me mix the two forms
>
> Do you think it could make sense to keep diredc bookmarks in the normal
> bookmarks by arranging for the normal "directory bookmarks" to be
> "hijacked" by diredc

Hmm. I'm looking at the code for bookmarks and the variable
bookmark-alist, and what I see is that directory bookmarks have a NIL
handler, ie. function bookmark-default-handler, which runs function
find-file-noselect, which is directly or indirectly called by
"everyone", including diredc. 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.

> (i.e. not to open a new dired buffer but to open the dir within
> diredc)

The diredc interest isn't only in the buffer management; it also needs
to maintain the history stack (it's not a simple push/pop, see there)
for each new navigation.

>  when called from diredc?

What about the case of diredc-mode being enabled, but the current-frame
isn't the diredc frame (ie. the user is not currently using dired)? You
wouldn't want to jump to that frame and open the directory in one of its
windows?

> You'd still have the downside that the general bookmarks include all the
> other non-directory bookmarks, so maybe it's not a good idea anyway.

Your intuition or my intuition doesn't matter. For me the mixing
certainly is a huge down-side, but you've seen from some of the reaction
to your post that people just do things their own way to their own
preference. The filtering feature that Drew mentioned exists in
bookmarks+ sounds good, in that it retains the standard emacs bookmark
code and allows the completion candidates to be filtered.

> [ I'm not using bookmarks very much, so my intuition here is poor.  ]

I use them a lot, but for the past many years only for temporary
place marks.

--
hkp://keys.gnupg.net
CA45 09B5 5351 7C11 A9D1  7286 0036 9E45 1595 8BC0



reply via email to

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