Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Question] How to integrate dogears.el as a consult-buffer source? #430

Closed
skyler544 opened this issue Oct 2, 2021 · 5 comments
Closed
Labels
question Further information is requested

Comments

@skyler544
Copy link

skyler544 commented Oct 2, 2021

My Elisp-fu is distinctly lacking and I'm not really sure how to go about this. In case you've never seen/used it, here https://github.com/alphapapa/dogears.el is Dogears. It seems to automatically create bookmark-like objects for recent places in files you've been visiting/editing. Based on this project's Readme, I attempted to configure a new source for consult-buffer with the following code inside consult's use-package:config block:

  (add-to-list 'consult-buffer-sources
	       (list :name     "Dogears"
		     :category 'bookmark
		     :items    #'dogears-list)
	       'append)

This however simply breaks consult-buffer and shows dogears-list instead, which is a buffer. It was at this point that I realized that while I might be on the track of why it isn't working as I expect (passing a buffer instead of a list), I don't understand Elisp or how these functions work internally well enough to fix it myself.
Can this be done easily, or am I barking up the wrong tree?

@minad
Copy link
Owner

minad commented Oct 2, 2021 via email

@minad minad added the question Further information is requested label Oct 4, 2021
@minad
Copy link
Owner

minad commented Oct 5, 2021 via email

@minad minad closed this as completed Oct 5, 2021
@skyler544
Copy link
Author

Thank you for doing this!

@ST-Saint
Copy link

Thanks for the script.

I notice that the candidates are sorted by some property (file name + line number I guess). There is any way to disable sorting?

Thank you for building this amazing project again

@ST-Saint
Copy link

ST-Saint commented Aug 26, 2024

Thanks for the script.

I notice that the candidates are sorted by some property (file name + line number I guess). There is any way to disable sorting?

Thank you for building this amazing project again

In case someone also has the question, simply do

(consult--multi '(consult--source-dogears) :sort nil)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants