unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* server-running-p: not detect server running by other emacs instance
@ 2008-04-05 12:29 Liang Wang
  2008-04-05 17:55 ` Stefan Monnier
       [not found] ` <mailman.10048.1207418159.18990.bug-gnu-emacs@gnu.org>
  0 siblings, 2 replies; 3+ messages in thread
From: Liang Wang @ 2008-04-05 12:29 UTC (permalink / raw)
  To: bug-gnu-emacs

I modify server-running-p in server.el to make it to detect server
running by other emacs instance.  With this modification, server
started by first emacs instance won't be killed by successive
instances.

(unless (server-running-p)
  (server-start))

I replace server-socket-dir with (or server-socket-dir (format "/tmp/
emacs%d" (user-uid))) since server-socket-dir only set by server-
start.  Here is whole function.

(defun server-running-p  (&optional name)
  "Test whether server NAME is running."
  (interactive
   (list (if current-prefix-arg
	     (read-string "Server name: " nil nil server-name))))
  (unless name (setq name server-name))
  (condition-case nil
      (progn
	(delete-process
	 (make-network-process
	  :name "server-client-test" :family 'local :server nil :noquery t
	  :service (expand-file-name name (or server-socket-dir
					      (format "/tmp/emacs%d" (user-uid))))))
	t)
    (file-error nil)))

Does this make sense to be a patch to emacs?


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

* Re: server-running-p: not detect server running by other emacs instance
  2008-04-05 12:29 server-running-p: not detect server running by other emacs instance Liang Wang
@ 2008-04-05 17:55 ` Stefan Monnier
       [not found] ` <mailman.10048.1207418159.18990.bug-gnu-emacs@gnu.org>
  1 sibling, 0 replies; 3+ messages in thread
From: Stefan Monnier @ 2008-04-05 17:55 UTC (permalink / raw)
  To: Liang Wang; +Cc: bug-gnu-emacs

> I modify server-running-p in server.el to make it to detect server
> running by other emacs instance.  With this modification, server
> started by first emacs instance won't be killed by successive
> instances.

If I understand correctly, you're reporting a bug that server-running-p
doesn't work if you haven't called server-start before.  I believe I've
just fixed it in the trunk,


        Stefan




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

* Re: server-running-p: not detect server running by other emacs  instance
       [not found] ` <mailman.10048.1207418159.18990.bug-gnu-emacs@gnu.org>
@ 2008-04-06  2:58   ` Liang Wang
  0 siblings, 0 replies; 3+ messages in thread
From: Liang Wang @ 2008-04-06  2:58 UTC (permalink / raw)
  To: bug-gnu-emacs

On Apr 6, 1:55 am, Stefan Monnier <monn...@iro.umontreal.ca> wrote:
> > I modify server-running-p in server.el to make it to detect server
> > running by other emacs instance.  With this modification, server
> > started by first emacs instance won't be killed by successive
> > instances.
>
> If I understand correctly, you're reporting a bug that server-running-p
> doesn't work if you haven't called server-start before.  I believe I've
> just fixed it in the trunk,
>
>         Stefan

Thanks.  I didn't check latest version carefully.


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

end of thread, other threads:[~2008-04-06  2:58 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-04-05 12:29 server-running-p: not detect server running by other emacs instance Liang Wang
2008-04-05 17:55 ` Stefan Monnier
     [not found] ` <mailman.10048.1207418159.18990.bug-gnu-emacs@gnu.org>
2008-04-06  2:58   ` Liang Wang

Code repositories for project(s) associated with this public inbox

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

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).