From the documentation I can see I can access command line arguments (command-line-args).
I’d like to add my own arguments but Emacs complains at start up that it doesn’t recognize them.
E.g.
emacs -my_argument
I get:
command-line-1: Unknown option `-my_argument'
What’s a proper way to define my custom arguments and provide information to my Emacs session?
Is there a way to pop an argument from a command line?
Add something like this to your
~/.emacs,~/.emacs.el, or~/.emacs.d/init.elfile:Then you can execute
emacs -my_argumentand it should printi was passed -my_argumentto the minibuffer. You can find more information in the GNU elisp reference.