kmacro-call-macro without the message for the repeat key

/ Published in: Emacs Lisp
Save to your folder(s)

From Emacs 23.1, an edited version of kmacro-call-macro that removes the call to message reminding the user that they can repeat the macro with a single key.

Copy this code and paste it in your HTML
  1. (defun kmacro-call-macro (arg &optional no-repeat end-macro)
  2. "Call the last keyboard macro that you defined with \\[kmacro-start-macro].
  3. A prefix argument serves as a repeat count. Zero means repeat until error.
  5. When you call the macro, you can call the macro again by repeating
  6. just the last key in the key sequence that you used to call this
  7. command. See `kmacro-call-repeat-key' and `kmacro-call-repeat-with-arg'
  8. for details on how to adjust or disable this behavior.
  10. To make a macro permanent so you can call it even after defining
  11. others, use \\[kmacro-name-last-macro]."
  12. (interactive "p")
  13. (let ((repeat-key (and (null no-repeat)
  14. (> (length (this-single-command-keys)) 1)
  15. last-input-event))
  16. repeat-key-str)
  17. (if end-macro
  18. (kmacro-end-macro arg)
  19. (call-last-kbd-macro arg #'kmacro-loop-setup-function))
  20. (when (consp arg)
  21. (setq arg (car arg)))
  22. (when (and (or (null arg) (> arg 0))
  23. (setq repeat-key
  24. (if (eq kmacro-call-repeat-key t)
  25. repeat-key
  26. kmacro-call-repeat-key)))
  27. (setq repeat-key-str (format-kbd-macro (vector repeat-key) nil))
  28. (while repeat-key
  29. (if (equal repeat-key (read-event))
  30. (progn
  31. (clear-this-command-keys t)
  32. (call-last-kbd-macro (and kmacro-call-repeat-with-arg arg)
  33. #'kmacro-loop-setup-function)
  34. (setq last-input-event nil))
  35. (setq repeat-key nil)))
  36. (when last-input-event
  37. (clear-this-command-keys t)
  38. (setq unread-command-events (list last-input-event))))))

Report this snippet


RSS Icon Subscribe to comments

You need to login to post a comment.