Function: mc/make-a-note-of-the-command-being-run

mc/make-a-note-of-the-command-being-run is a natively compiled function defined in multiple-cursors-core.el.

Signature

(mc/make-a-note-of-the-command-being-run)

Documentation

Used with pre-command-hook to store the original command being run.

Since that cannot be reliably determined in the post-command-hook.

Specifically, this-original-command isn't always right, because it could have been remapped. And certain modes (cua comes to mind) will change their remapping based on state. So a command that changes the state will afterwards not be recognized through the command-remapping lookup.

Source Code

;; Defined in /nix/store/5q7a78ihkz25lf4xmxaa9m7b2ym63m36-emacs-packages-deps/share/emacs/site-lisp/elpa/multiple-cursors-20260419.931/multiple-cursors-core.el
(defun mc/make-a-note-of-the-command-being-run ()
  "Used with pre-command-hook to store the original command being run.
Since that cannot be reliably determined in the post-command-hook.

Specifically, this-original-command isn't always right, because it could have
been remapped. And certain modes (cua comes to mind) will change their
remapping based on state. So a command that changes the state will afterwards
not be recognized through the command-remapping lookup."
  (unless mc--executing-command-for-fake-cursor
    (let ((cmd (or (command-remapping this-original-command)
                   this-original-command)))
      (setq mc--this-command (and (not (eq cmd 'god-mode-self-insert))
                                  cmd)))))