minad / vertico

:dizzy: vertico.el - VERTical Interactive COmpletion
GNU General Public License v3.0
1.49k stars 60 forks source link

Vertico and org-cite do not work well #261

Closed juanjosegarciaripoll closed 2 years ago

juanjosegarciaripoll commented 2 years ago

Steps to reproduce:

  1. Set up vertico-mode
  2. Create an org-mode file with an initial #+bibliography key that points to some bibtex file
  3. Attempt to insert a citation using C-c C-x @
  4. Vertico will offer one option, but whenever C-j or RET is pressed, it simply adds one more key Wallquist2009: to the citation list, never finishing.
  5. More generally, this seems to be caused by the fact that vertico-mode never allows for empty input on certain fields.

Example file example.org

#+bibliography: ./example.bib

Example bibliography example.bib

@article{Wallquist2009,
  title = {Hybrid Quantum Devices and Quantum Engineering},
  author = {Wallquist, M. and Hammerer, K. and Rabl, P. and Lukin, M. and Zoller, P.},
  year = {2009},
  month = dec,
  journal = {Physica Scripta},
  volume = {T137},
  pages = {014001},
  publisher = {{IOP Publishing}},
  issn = {1402-4896},
  doi = {10.1088/0031-8949/2009/T137/014001},
  langid = {english}
}
minad commented 2 years ago

Try M-RET to submit the empty string. Please let me know if it works for you.

juanjosegarciaripoll commented 2 years ago

Why is this not offered as option in the C-h mode description?

El mar., 9 ago. 2022 20:16, Daniel Mendler @.***> escribió:

Try M-RET.

— Reply to this email directly, view it on GitHub https://github.com/minad/vertico/issues/261#issuecomment-1209716325, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAQWH7UNV4W4YF6YK6UZ2OTVYKOATANCNFSM56A3MQUQ . You are receiving this because you authored the thread.Message ID: @.***>

minad commented 2 years ago

I think it doesn't appear in the mode description since the vertico-map is only installed in the minibuffer. The command M-RET is also documented in the readme.

But org-cite could probably do a little better by passing the empty string as default argument. Then Vertico would directly accept RET to submit the empty string and the first candidate wouldn't get selected immediately.