5

There is a common convention that a numeric prefix argument means “do it this many times”. If a command follows this convention, a prefix argument of 0 is useless. However, not all commands follow this convention or the other common convention of having two behaviors, one with no argument and one with a prefix argument other than 1. For example, save-buffer ...


5

You need to set universal-prefix-argument and call shell interactively: (global-set-key (kbd "C-c s") (lambda () (interactive) (let ((current-prefix-arg '(4))) (call-interactively #'shell))))


3

@gilles and @npostavs have given use cases. To summarize what they said: When you're already using C- or M- for part of a key sequence, it can be easier to specify a zero prefix arg using C-0 or M-0 than using, say, C-u 0. A zero numeric prefix arg can have a specific (not necessarily numeric) meaning for a given command. @Gilles mentioned save-buffer, ...


2

I cannot think any use case... It just makes entering numeric prefix arguments a little easier. For example, with numeric argument of 0, C-k (kill-line) will delete from point to the beginning of line. You can invoke this with C-0 C-k which is easier than typing C-u 0 C-k.


2

Your string example shows that you already know how to separate multiple interactive arguments, by putting a newline between each one in the interactive spec. So rather than: (interactive "PstEins: \nstZwei: ") You wanted: (interactive "P\nstEins: \nstZwei: ")


Only top voted, non community-wiki answers of a minimum length are eligible