This question already has an answer here:

I would like to call an interactive function that requires user input (projectile-test-project, for instance) by using a predefined argument and therefore executes without asking the user anything. I am guessing it's possible to call the interactive function with initial content followed by a simulated RETURN stroke but that seems a bit wonky.

marked as duplicate by DoMiNeLa10 Feb 10 at 13:20


  • 1
    Look at C-h f projectile-test-project to read about the arguments it takes, and then pass whatever you need to. What have you tried? – phils Feb 8 at 12:29
  • You can also do the thing you're trying to do interactively, and then use C-x M-: to call repeat-complex-command which (provided there was prompting involved in the interactive call) will show you how the function was actually called. You can then copy and/or adapt that to whatever your needs are. – phils Feb 8 at 12:35
  • I'm pretty sure this is a duplicate (how to pass an arg to a command invoked non-interactively), but I don't have time now to search for it. Maybe someone else will. ;-) – Drew Feb 8 at 19:38

Browse other questions tagged or ask your own question.