code_junkie

Is there a (repeat-last-command) in Emacs?

Nov 12th, 2011
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.82 KB | None | 0 0
  1. (defun describe-last-function()
  2. (interactive)
  3. (describe-function last-command))
  4.  
  5. C-x M-ESC runs the command repeat-complex-command
  6. which is an interactive compiled Lisp function in `simple.el'.
  7. It is bound to <again>, <redo>, C-x M-:, C-x M-ESC.
  8. (repeat-complex-command ARG)
  9.  
  10. Edit and re-evaluate last complex command, or ARGth from last.
  11. A complex command is one which used the minibuffer.
  12. The command is placed in the minibuffer as a Lisp form for editing.
  13. The result is executed, repeating the command as changed.
  14. If the command has been changed or is not the most recent previous command
  15. it is added to the front of the command history.
  16. You can use the minibuffer history commands M-n and M-p
  17. to get different commands to edit and resubmit.
  18.  
  19. (defun repeat-last-command()
  20. (interactive)
  21. (eval (car (command-history)))
  22. )
Add Comment
Please, Sign In to add comment