consult-dir icon indicating copy to clipboard operation
consult-dir copied to clipboard

Handle dired bookmarks from Bookmarks+

Open legendre6891 opened this issue 3 years ago • 12 comments

Hi! Fantastic package -- what do you think about adding support for bmkp's dired directories? They have a non-nil handler.

legendre6891 avatar Oct 08 '21 02:10 legendre6891

@karthink Wondering if you’ve had time to take a look? Thanks!

legendre6891 avatar Oct 26 '21 14:10 legendre6891

Sorry for the delay. Integrating bmkp bookmarks is a good idea. But there are two alternatives I'd like to think about:

  1. Make a separate bmkp source. This is the intended way to customize consult-dir to your needs. This is straightforward to do, there's an example in the README.
  2. Make a defcustom consult-dir-bookmark-handlers for bookmark handlers to consider (beside the nil value). Then you can add bmkp-dired-jump to that list.

I would prefer not to hardcode tests for features provided by libraries not included in Emacs. (I know that I made an exception for Projectile but I'm rethinking that too.)

What do you think of options 1 and 2?

karthink avatar Oct 28 '21 04:10 karthink

Not a problem at all, @karthink, and thanks for your thoughts. Here are my opinions regarding your two points:

  1. I would prefer not to make bmkp a separate source. The reason is that someone (like me :-)) who is using bmkp is unlikely to be using the vanilla bookmarks, and vice-versa. Moreover, in so far as consult-dir is concerned, there is not much semantic difference about whether a dired bookmark came from vanilla bookmarks or bmkp.

  2. I think this is a great idea, I guess it will suffice for consult-dir-bookmark-handlers to be a list of symbols for which to filter against (by eq, say).

If you are happy with going with option 2, I'll take a stab at implementing it this weekend. What do you think?

Cheers

legendre6891 avatar Oct 29 '21 07:10 legendre6891

Option 2 sounds good. Please continue at your convenience.

Incidentally, some bookmark types that have filename entries in their bookmark-record alist (besides bookmark plus dired entries) include eshell and vc-dir bookmarks. Do you know of any others?

karthink avatar Oct 29 '21 07:10 karthink

That's a good point! I'm not aware of others at the moment (and TIL that vc-dir could be used as a bookmark!).

legendre6891 avatar Oct 30 '21 11:10 legendre6891

Hi @karthink, I made a small patch regarding consult-dir-bookmark-handlers above. Would you like to give it a try?

I also added a fbound, since I noticed that project--read-project-list is not defined in OOTB Emacs 27.2 (need to update package.el, which requires an Internet connection).

legendre6891 avatar Oct 30 '21 11:10 legendre6891

@karthink bump on this to see if you've had any time to look at it.

Appreciate that pre-Thankgiving November is the busiest part of the year :-) Cheers

legendre6891 avatar Nov 07 '21 16:11 legendre6891

Looks good! Thank you for the effort. I added a couple of comments.

karthink avatar Nov 08 '21 00:11 karthink

Thanks @karthink! Looking forward to the addition, if there are no fixes requested (I couldn’t see your comments, so I guess they are in a local/offline branch.) cheers

legendre6891 avatar Nov 08 '21 04:11 legendre6891

Looks good! Thank you for the effort. I added a couple of comments.

@legendre6891 The comments are part of a review, it should be visible directly above this comment.

karthink avatar Nov 10 '21 07:11 karthink

Sorry @karthink, I could not see any comments? This is what I see on my screen -- not very familiar with Github, unfortunately

image

legendre6891 avatar Nov 11 '21 04:11 legendre6891

not very familiar with Github, unfortunately

Neither am I! Here's what I see:

2021-11-10-213801_1068x1154_scrot

karthink avatar Nov 11 '21 05:11 karthink