[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Independent differently-configured instances running concurrently
From: |
W . Greenhouse |
Subject: |
Re: Independent differently-configured instances running concurrently |
Date: |
Tue, 29 Apr 2014 15:23:47 +0000 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) |
Hans,
Hans BKK <hansbkk@gmail.com> writes:
> Any other comments welcome, expect perhaps those along the lines of
> "your learning process is too complicated" 8-)
1. If you are interested in reading in-depth about Emacs initialization,
see (info "(elisp) Startup Summary"). This will help answer where the
user initfile and other user config elements fit in to the session
startup.
2. I am a fan of the Emacs daemon. Multiple daemons can be initialized
by giving them distinct socket filenames, similar to named screen or
tmux sessions. Each daemon can persist in the background and have its
own set of emacsclient frames, possibly on different terminals or X
servers.
I don't normally use multiple instances, because I find it more
convenient to have kill ring/command history/buffers shared and
available from any of my emacsclients, but sometimes when testing a
new configuration I will start up a second daemon with "emacs
--daemon=test", which enables emacsclients to be connected to the new
instance with "emacsclient -c -s test". You can read about
emacsclient/daemon at (info "(emacs) Emacs Server").
If you consistently wanted to have multiple sessions with the added
flexibility of the daemon, one option might be to have a function run
from `after-init-hook' (run just after the daemon is up and running)
and detect which value of `server-name' was set during
initialization.
For example:
--8<---------------cut here---------------start------------->8---
(defun server-specific-init ()
"Conditionally load a secondary initfile by Emacs daemon name."
(if (server-running-p)
(load-file (concat user-emacs-directory "init-" server-name))))
(add-hook 'after-init-hook 'server-specific-init)
--8<---------------cut here---------------end--------------->8---
With this you could have an init-personal.el, init-work.el,
init-testing.el, etc. and boot into those environments by starting a
daemon with that name. Setting ALTERNATE_EDITOR to "" in your shell
environment it becomes even more convenient, because then you can
start the daemon implicitly by launching an emacsclient with its
name: "emacsclient -c -s personal", etc.
Nonetheless I've never found such a setup easy to come to terms with,
because one of the reasons I stick with Emacs is that I love to have
my whole session accessible.
3. Most importantly, use Emacs. This is the best way to learn. :) Start
with a particular task and build from there; by learning the elisp
and commands that help with this task, you will gain much familiarity
with the runtime in general. In the end it's all pretty
interconnected.
David,
David Hume <David.Hume@example.com> writes:
> At the moment I am running various instances but I just run them as
> different users. For example using gnus to send mail, I am not sure how
> I would have different smtp servers, without them getting mixed up, so
> to play it safe I set up different linux users.
Gnus supports multiple SMTP accounts through the X-Message-SMTP-Method
header, or alternatively by using an SMTP client binary that picks a
mail host based on the From: header, like msmtp. Just as a small
aside. :)
--
Best,
WGG
Reply to list only, please.
Off-list replies will be filtered and deleted.
- Independent differently-configured instances running concurrently, Hans BKK, 2014/04/28
- Re: Independent differently-configured instances running concurrently, Javier, 2014/04/28
- Re: Independent differently-configured instances running concurrently, Michael Heerdegen, 2014/04/28
- Re: Independent differently-configured instances running concurrently, Hans BKK, 2014/04/28
- Re: Independent differently-configured instances running concurrently, Robert Thorpe, 2014/04/28
- Re: Independent differently-configured instances running concurrently, Hans BKK, 2014/04/28
- Message not available
- Re: Independent differently-configured instances running concurrently,
W . Greenhouse <=
- Re: Independent differently-configured instances running concurrently, Hans BKK, 2014/04/29