New answers tagged


Several variables contain the command line arguments (“arguments” includes both options and file names), in particular command-line-args-left which contains the arguments that haven't been processed yet at each point during startup. However, it's unusual to access the command line arguments in a user's init file. If there are things you load based on which ...


If you start Emacs specifying a file to visit as a command-line argument, as you describe, and that's pretty much all you do wrt the command line, and your init file doesn't visit any other files or buffers, then this sexp will give you the name of the visited file, which will be the one you specified on the command line: (buffer-file-name)


If you run M-x describe-variable user-emacs-directory or the following commands in a emacs-lisp buffer, you will find it. (find-file (expand-file-name "init.el" user-emacs-directory)) (describe-variable 'user-emacs-directory) It's usually in %AppData%\.emacs.d but could be in %UserProfile%\.emacs.d if you run emacs from Start-menu. In Powershell, ...

Top 50 recent answers are included