emacselispido

ido-completing-read - how to bind C-j to another action?


I am using ido-completing-read to select songs from a database.

(song (ido-completing-read "Play: " db))

How do I use keys like C-j here to select songs in a different way. I just need to know if the song was selected by pressing RET or C-j.


Solution

  • If I understand the question correctly, you could examine last-command-event right after calling ido-completing-read: it will be 10(?\n) for C-j, 13(?\r) for RET.