Elisp: How do you combine interactive "r" with interactive "p"?
elisp, emacs
Solution
C-hf `interactive` RET
"To get several arguments, concatenate the individual strings, separating them by newline characters."
(defun increment-numbers-in-region (start end arg)
(interactive "r\np")
...)
Problem
I have an existing command (`increment-numbers-in-region`) which is declared using `interactive "r"` to get region start and end points as arguments. I would now like to extend this command to take a prefix argument as well. Is there a way to combine `interactive "r"` with `interactive "p"` or should I go about it in some other way? I guess I could write a command which uses `interactive "p"` only, and then read point and mark from the command body, but it feels like that might not be the most idiomatic way. Any ideas?