[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Determine if emacs or emacsclient was run with filename(s) as commandlin
From: |
Constantin Kulikov |
Subject: |
Determine if emacs or emacsclient was run with filename(s) as commandline argument. |
Date: |
Sat, 11 May 2013 00:40:41 +0400 |
Is there a way to know if emacs was run with filename argument?
Example:
emacsclinet -c "/some/path/some_file"
It'l create new emacs frame and open 'some_file'. Can I somehow determine
or detect opening files from commandline?
I tried setting up `before-make-frame-hook', `after-make-frame-functions'
and `find-file-hook' and I discovered that find-file-hook is last hook that
executed so I can't differentiate 'command line file opening' from regular
user action.
Why I need it:
I wrote some elisp code that saves window configuration on frame
destruction and restores it on new frame creation. emacsclient -c is set as
my $EDITOR. I need some way to detect case when some program calls the
$EDITOR with file name as argument because in that case I don't need to
restore window configuration.
- Determine if emacs or emacsclient was run with filename(s) as commandline argument.,
Constantin Kulikov <=