Reputation: 8357
What I want to do is, when I find myself using a function that prompts me for a value, and this value is ALWAYS the right one, to be able to bind the function to a key and auto-accept the answer, simulating a RET in the minibuffer.
Take for instance "ido-switch-buffer". When entered, it prompts you for a buffer name, and proposes the last visited one.
(It can do a lot more, that's why I dont want to re-define it, I just want a wrapper around it)
Say I want to switch between the last visited two buffers, how would I say that in my .emacs ?
Upvotes: 2
Views: 479
Reputation: 26539
You may bind any keyboard macro, which is essentially a sequence of keys, to a key. For example,
(global-set-key (kbd "C-c b") (kbd "C-x b <return>"))
Upvotes: 3