As I'm running out of easy key bindings I'm trying to overload C-SPC to either call set-mark-command or er/expand-region depending on if I have moved since I set the mark. However the two functions take slight different prefix constructs "P" vs "p". How can I declare a function that wraps the two functions and passes the right sort of prefix to them?
Here is the code I have so far:
(defun my-mark-or-expand-dwim (arg)
"Set the mark or if mark already set call expand-region."
(interactive "P")
(if (and mark-active
(eq (point) (mark)))
(er/expand-region arg)
(set-mark-command arg)))
EDIT TO EXPLAIN ANSWER: I accepted my own answer as that solved the question as-posed however using call-interactively is the solution I ended up using in my own init file.