navgeet
navgeet

Reputation: 1007

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.

Upvotes: 2

Views: 115

Answers (1)

Anton Kovalenko
Anton Kovalenko

Reputation: 21507

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.

Upvotes: 2

Related Questions