6

C-u C-SPC is used to

Move point to where the mark was, and restore the mark from the ring of former marks.

When trying to get the function bound to C-u C-SPC with describe-key it just stops processing the query, with reason, in C-u and returns the universal-argument description.

So the question can also extend to "How do you get the function bound to a keymap starting with C-u where it acts differently from an ordinary argument"?

1
  • If you're trying to bind some key to something normally done with this prefix argument, you could curry the function. Jun 12, 2015 at 17:18

3 Answers 3

9

Leave the C-u off and check the binding for C-SPC (or whatever you're interested in). The universal argument (the C-u) is often used to make commands do different things. However, the docstring of the command will (or at least should) explain what the command does when preceded by universal arguments.

8

"How do you get the function bound to a keymap starting with C-u where it acts differently from an ordinary argument"?

C-u C-SPC and C-SPC will run the same function, just with different arguments.

You'll need to read the documentation or the source code to figure out exactly what the difference are.

4

C-u C-SPC is not bound to a single key sequence. C-u is bound to universal-argument, and C-SPC is bound to set-mark-command. If you consult the doc for each of those you will get the answer to your question.

C-u provides a prefix argument for the following command, in this case for command set-mark-command. Consulting the doc for set-mark-command tells you how it interprets a prefix argument:

With prefix argument (e.g., C-u C-SPC), jump to the mark, and set the mark from position popped off the local mark ring (this does not affect the global mark ring). Use C-x C-SPC to jump to a mark popped off the global mark ring (see pop-global-mark).

If set-mark-command-repeat-pop is non-nil, repeating the C-SPC command with no prefix argument pops the next position off the local (or global) mark ring and jumps there.

With C-u C-u as prefix argument, unconditionally set mark where point is, even if set-mark-command-repeat-pop is non-nil.

Consult the Emacs manual for more info about prefix arguments: C-h r i prefix arguments RET. That takes you to node Numeric Arguments of the manual.

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.