all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Determine if emacs or emacsclient was run with filename(s) as commandline argument.
@ 2013-05-10 20:40 Constantin Kulikov
  2013-05-12  7:26 ` Bernardo
  0 siblings, 1 reply; 4+ messages in thread
From: Constantin Kulikov @ 2013-05-10 20:40 UTC (permalink / raw)
  To: help-gnu-emacs

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.


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2013-05-12 10:56 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-05-10 20:40 Determine if emacs or emacsclient was run with filename(s) as commandline argument Constantin Kulikov
2013-05-12  7:26 ` Bernardo
     [not found]   ` <CAFkz2yoey4G0pTbu2f_9kcZTVxNYbnyBr1w=9K77CQA_NcoMkg@mail.gmail.com>
2013-05-12  7:41     ` Fwd: " Constantin Kulikov
2013-05-12 10:56       ` Constantin Kulikov

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.