unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* check if another emacs instance is running
@ 2009-11-29 12:22 harven
  2009-11-29 13:41 ` Juanma Barranquero
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: harven @ 2009-11-29 12:22 UTC (permalink / raw)
  To: help-gnu-emacs


Is there a function that checks if another instance of emacs 
is currently running ?

I didn't find anything. Yet there is a command that tests if a server
is running, and it seems to be reliable (works on all architectures, does not
depend on the way the server was started). Unfortunately I don't see how
it can be modified so as to detect emacs instances. I tried some workarounds
but none seems to be very satisfying.

  Use some external utility to list current processes e.g.
  (when (< 1 (string-to-number 
              (shell-command-to-string "ps -A |grep -c emacs23")))
    (message "ok"))
  ;; but this is system-specific.

  Set an environment variable from emacs at start
  ;; won't detect instances launched as emacs -Q.

  Open a file and see if there is a lock
  ;; I had a look at userlock.el but did not understand how it works.



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

end of thread, other threads:[~2009-11-29 17:45 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-11-29 12:22 check if another emacs instance is running harven
2009-11-29 13:41 ` Juanma Barranquero
2009-11-29 15:12 ` tomas
     [not found] ` <mailman.11769.1259507965.2239.help-gnu-emacs@gnu.org>
2009-11-29 17:45   ` harven

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).