2

I learnt that C-u default is to repeat 4 times.

For example: C-u t is input tttt

However, when I type C-u M-x, it prompts a function list

enter image description here

What does invoking C-u mean here?

6
  • 4
    It's the "prefix argument", an interactive function (a.k.a. command, something that you usually run by pressing M-x) can use this argument to change its behavior. It is useful for commands that would normally be bound to some key and would not ask for your input interactively after being called. However, it is entirely within the purview of the author of the command how to interpret the argument. Often times its the number of repetitions of the command, but it could be something else entirely.
    – wvxvw
    Commented Jan 2, 2019 at 7:12
  • 2
    ty, could you please transmit the comment to answer. @wvxvw Commented Jan 2, 2019 at 8:16
  • Presumably, you must have some package installed that alters the behaviour of M-x. Normally, M-x runs the command execute-extended-command, which does nothing but run the named command. If you give it a prefix with C-u, that information is merely passed to the executed command. execute-extended-command itself doesn't do anything else with it. Commented Jan 2, 2019 at 9:43
  • ty, very clear. @HaraldHanche-Olsen Commented Jan 2, 2019 at 10:07
  • so C-x is internal command, M-x is extended command? @HaraldHanche-Olsen Commented Jan 2, 2019 at 10:18

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.