In org-mode, C-u C-u C-u Tab
expands all trees. When I wanted to check what it's bound to, I wasn't able to do that using C-h k
as it quickly told me what C-u
is bound to. From experiments, I know that pressing C-u
n
times sets the prefix argument to 4^n
. So why doesn't C-u 6 4 Tab
do the same thing as C-u C-u C-u Tab
?
1 Answer
There is a subtle distinction between C-u C-u C-u Tab
and C-u 64 Tab
. When you use only the C-u
key, without using digits (i.e., 64), what actually gets passed to the org-cycle
function (which is what Tab
calls here) is a list: (64)
. If you use C-u 64 Tab
, the argument passed to org-cycle
is the integer 64
.
It's up to the author of a function to decide how they handle this difference. In the case of org-mode, at least in the case of org-cycle
, the underlying code assumes that users will only use C-u
. It does this in a cond
statement, where the tests take the form (equal arg '(64))
. This will only be true when you use pass a list, not when you pass an integer.
You can find a full explanation in the Elisp manual: (elisp) Prefix Command Arguments, and also (elisp) Interactive Codes.
prefix-numeric-value
of that raw prefix arg. See @Tyler's answer for more info.