Currently emacs has useful imenu
thing which allow me to see list of functions in current buffer. To achieve this i need to type M-x
, then type imenu
, then press return
key, then it will display prompt in minibuffer "Index item:" and i need to type func
, then it displays another minibuffer prompt with aoutocompletion of all functions in current buffer.
This is very good and useful, but now i'd like to reduce amount of typing and to macrosify somehow first part of sequence. I tried this approach:
(defun my-imenu-go-function-list ()
(interactive)
(imenu "func"))
(global-set-key (kbd "C-x C-o") 'my-imenu-go-function-list)
Another try:
(defun my-imenu-go-function-list ()
(interactive)
(imenu)
(execute-kbd-macro [?f ?u ?n ?c return]))
But none worked, is there another possibility ?
You need to call your function interactively.
Try the following. It should work.
UPDATED:
If you are in Windows you might have to change the carriage return to "\r" or "\r\n"