all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / 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

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.