Giter Site home page Giter Site logo

Comments (14)

bdarcus avatar bdarcus commented on August 19, 2024

Hi @apc - it definitely should work as you expect. The first screenshot on the README is what you should see if you have which-key setup and after invoking embark-act.

First, questions:

Did you set the embark variable mentioned in the README:

https://github.com/bdarcus/bibtex-actions#basic

It occurs to me it's possible that section is too brief ATM.

If, as I assume, yes, then two additional questions:

  1. do you have marginalia installed and active? I think this is necessary for embark to be able to associate these commands with that keymap.
  2. do you have embark configured to load the menus? You may have to do something there.

Once setup, it should just work.

BTW, there's some handy test scripts at the selectrum repo, which will setup this up for you to test with emacs -Q.

Edit: link https://github.com/raxod502/selectrum/tree/master/test

You should just be able to install bibtex-actions from MELPA from there and be good to go for testing.

Can you take a look this, and let me know if you think I need to add to that README section, and ideally suggest what I should add?

from citar.

bdarcus avatar bdarcus commented on August 19, 2024

PS: you don't actually need to deactivate ivy in your config. You just need to turn it off, and turn on selectrum, etc.

from citar.

apc avatar apc commented on August 19, 2024

Hi @bdarcus, thanks for your quick reply! This is my current setup for bibtex-actions:

(use-package bibtex-actions
  :demand t
  :config
  (setf (alist-get 'bibtex embark-keymap-alist) 'bibtex-actions-map)
  (setq bibtex-completion-bibliography '("~/bib/apcmain.bib")))

I figured out that if I type C-h after calling embark-act I see the list of available bindings. Before doing that, all I see is this:

image

This may well be the intended behavior. Coming from ivy-bibtex, though, I was used to seeing the menu of options when calling ivy-dispatching-done from the list of bib entries. Maybe that's why I got confused?

I'll think about your question re: the README section. In the meantime, here are a few thoughts.

  • I had previously set all variables from bibtex-completion (including bibtex-completion-bibliography) in my use-package declaration for bibtex. I suspect most people trying out bibtex-actions may have set those values in their init. I could have used a reminder to move all those settings to the use-package declaration for bibtex-actions. So, something like: "You may have already set values for many of the bibtex-completion variables that bibtex-actions relies on; you want to make sure those variables are set the way you want before you first call any of the bibtex-actions- commands."
  • A sample use-package declaration, listing all the values that are needed for most of the actions to work as expected (bibtex-completion-library-path, bibtex-completion-bibliography, etc.) would be nice to have.
  • It might be helpful to explain that you need to have embark loaded for the setting of embark-keymap-alist not to give an error. (So, perhaps having :after embark in the example declaration?)
  • Finally, just a line saying "to see the list of available bibtex-actions, call embark-bindings" would have been super helpful. (Or perhaps something much like this section of the helm-bibtex documentation?)

from citar.

apc avatar apc commented on August 19, 2024

PS: when I call embark-bindings I see a list of available actions for the selected entry, but it's embedded in this much longer listing of actions available. Is there some way of just seeing bibtex-actions related bindings?

from citar.

bdarcus avatar bdarcus commented on August 19, 2024

PS: when I call embark-bindings I see a list of available actions for the selected entry, but it's embedded in this much longer listing of actions available. Is there some way of just seeing bibtex-actions related bindings?

You shouldn't need to call embark-binding if this is setup right.

Does something like this setup, from the selectrum test scripts, work for you?

https://github.com/raxod502/selectrum/blob/master/test/selectrum-orderless.el

from citar.

bdarcus avatar bdarcus commented on August 19, 2024

I'll think about your question re: the README section. In the meantime, here are a few thoughts.

Thank you!

What do you think about explicitly including how to get this running using the selectrum test scripts, and then moving the more detailed examples to the wiki?

from citar.

apc avatar apc commented on August 19, 2024

I'll think about your question re: the README section. In the meantime, here are a few thoughts.

Thank you!

What do you think about explicitly including how to get this running using the selectrum test scripts, and then moving the more detailed examples to the wiki?

That would be great!

from citar.

apc avatar apc commented on August 19, 2024

PS: when I call embark-bindings I see a list of available actions for the selected entry, but it's embedded in this much longer listing of actions available. Is there some way of just seeing bibtex-actions related bindings?

You shouldn't need to call embark-binding if this is setup right.

Does something like this setup, from the selectrum test scripts, work for you?

https://github.com/raxod502/selectrum/blob/master/test/selectrum-orderless.el

That helps! I ended up adding

(setq embark-prompter #'embark-completing-read-prompter)
(global-set-key (kbd "M-o") #'embark-act)

and that gave me a much more user-friendly experience. I'd still like to be able to only see the list of bibtex-actions available, rather than all the options I now see. Do you know if there's an easy way to make that happen?

from citar.

bdarcus avatar bdarcus commented on August 19, 2024

I'd still like to be able to only see the list of bibtex-actions available, rather than all the options I now see. Do you know if there's an easy way to make that happen?

I strongly agree!

Two things:

First, I had a recent chat with embark author @oantolin about just this, and he noted it's on his todo.

oantolin/embark#197 (comment)

Would it help for one of us to add an explicit issue @oantolin?

Second, in the meantime, I sort the commands in the menu, so the bibtex-actions ones come first.

https://github.com/bdarcus/bibtex-actions/wiki/Configuration#which-key

That's for which-key though; not sure if or how to do that with the default one.

from citar.

bdarcus avatar bdarcus commented on August 19, 2024

BTW, marginalia is also generally useful, beyond its connection to embark.

from citar.

apc avatar apc commented on August 19, 2024

I'd still like to be able to only see the list of bibtex-actions available, rather than all the options I now see. Do you know if there's an easy way to make that happen?

I strongly agree!

Two things:

First, I had a recent chat with embark author @oantolin about just this, and he noted it's on his todo.

oantolin/embark#197 (comment)

Would it help for one of us to add an explicit issue @oantolin?

Second, in the meantime, I sort the commands in the menu, so the bibtex-actions ones come first.

https://github.com/bdarcus/bibtex-actions/wiki/Configuration#which-key

That's for which-key though; not sure if or how to do that with the default one.

Very helpful! I should have checked the wiki first. Using which-key is fine by me for now. (I take it the which-key settings work because bibtex- appears first when actions are sorted alphabetically, right?)

And yes, I've installed marginalia as well. I'm still very new to all of this, though, so I'm sure there's plenty for me to learn before I can get things where I wanted.

from citar.

bdarcus avatar bdarcus commented on August 19, 2024

I take it the which-key settings work because bibtex- appears first when actions are sorted alphabetically, right?)

Right. I can't say I chose the package name for that reason though!

And yes, I've installed marginalia as well. I'm still very new to all of this, though, so I'm sure there's plenty for me to learn before I can get things where I wanted.

There's a bit of a learning curve to move from monolithic solutions like ivy and helm to deliberately decomposed, but collaboratively developed, solutions like these.

It probably took me two weeks to "get it".

Many of the decisions here reflect now having understood it. My hope is the wiki can flourish as users start to experiment.

from citar.

bdarcus avatar bdarcus commented on August 19, 2024

Last question: would it help others, do you think, to move this to the discussion forum?

It's easy enough for me to do.

from citar.

apc avatar apc commented on August 19, 2024

from citar.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.