all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Andreas Schwab <schwab@suse.de>
Cc: Juanma Barranquero <lekktu@gmail.com>,
	romain@orebokech.com, rms@gnu.org,
	Stefan Monnier <monnier@iro.umontreal.ca>,
	emacs-devel@gnu.org
Subject: Re: The emacsclient socket vs. etc/emacs.bash
Date: Fri, 15 Dec 2006 22:07:29 +0100	[thread overview]
Message-ID: <jebqm47tri.fsf@sykes.suse.de> (raw)
In-Reply-To: <m3zm9pcmbf.fsf@kfs-l.imdomain.dk> (Kim F. Storm's message of "Fri, 15 Dec 2006 14:37:08 +0100")

storm@cua.dk (Kim F. Storm) writes:

> I typically have a "master emacs" instance running all the time.
> Sometimes I start another instance (e.g. in a terminal window)
> just to make some small change to a config file - and blammo - 
> the server is no longer associated with the master emacs.

I have this in my .emacs:

(when (and (file-exists-p (expand-file-name server-name server-socket-dir))
	   (let ((status (call-process "/usr/bin/lsof"
				       nil nil nil
				       (expand-file-name server-name
							 server-socket-dir))))
	     (or (not (numberp status)) (equal status 0))))
  (setq server-name (format "%s-%d" server-name (emacs-pid)))
  (add-hook 'kill-emacs-hook
    (lambda () (condition-case nil
		   (delete-file (expand-file-name server-name
						  server-socket-dir))
		 (error nil))))
  (setenv "EDITOR" (concat "emacsclient -s " server-name)))

I regularily have 2 or 3 instances of Emacs running, this way I can
control each of them as necessary.

Andreas.

-- 
Andreas Schwab, SuSE Labs, schwab@suse.de
SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany
PGP key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."

  parent reply	other threads:[~2006-12-15 21:07 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-12-08 13:15 The emacsclient socket vs. etc/emacs.bash Romain Francoise
2006-12-08 13:46 ` Stefan Monnier
2006-12-08 14:06   ` Romain Francoise
2006-12-08 18:38     ` Stefan Monnier
2006-12-08 19:10       ` Juanma Barranquero
2006-12-08 23:33         ` Stefan Monnier
2006-12-08 23:47           ` Juanma Barranquero
2006-12-09  1:28             ` Stefan Monnier
2006-12-09 11:36           ` Romain Francoise
2006-12-09  1:26 ` Richard Stallman
2006-12-09  3:55   ` Stefan Monnier
2006-12-09 18:25     ` Richard Stallman
2006-12-15 12:45       ` Juanma Barranquero
2006-12-15 13:37         ` Kim F. Storm
2006-12-15 14:05           ` Juanma Barranquero
2006-12-15 23:40             ` Stefan Monnier
2006-12-15 23:47               ` Juanma Barranquero
2006-12-16  9:54                 ` Eli Zaretskii
2006-12-16 11:07                   ` Juanma Barranquero
2006-12-15 21:07           ` Andreas Schwab [this message]
  -- strict thread matches above, loose matches on Subject: below --
2006-12-15 13:54 LENNART BORGMAN
2006-12-15 15:18 ` Kim F. Storm
2006-12-15 15:24   ` Lennart Borgman
2006-12-15 15:38     ` Kim F. Storm
2006-12-15 15:48       ` Lennart Borgman
2006-12-15 23:21         ` Kim F. Storm

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=jebqm47tri.fsf@sykes.suse.de \
    --to=schwab@suse.de \
    --cc=emacs-devel@gnu.org \
    --cc=lekktu@gmail.com \
    --cc=monnier@iro.umontreal.ca \
    --cc=rms@gnu.org \
    --cc=romain@orebokech.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.