all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* where to start emacs --deamon in debian?
@ 2009-12-05  1:59 Jonas Stein
  2009-12-05 10:09 ` Peter Dyballa
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Jonas Stein @ 2009-12-05  1:59 UTC (permalink / raw)
  To: gnu-emacs-help

Hi 
what is the best way to start emacs --deamon in a debian (testing) system?
Should i put it in a selfmade init script to /etc/init.d or into /etc/profiles 
or some elsewhere?

kind regards,
Jonas




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

* Re: where to start emacs --deamon in debian?
       [not found] <mailman.12252.1259993777.2239.help-gnu-emacs@gnu.org>
@ 2009-12-05  6:32 ` Teemu Likonen
  2009-12-06  0:32   ` Tim X
  2009-12-06  0:30 ` Tim X
  1 sibling, 1 reply; 8+ messages in thread
From: Teemu Likonen @ 2009-12-05  6:32 UTC (permalink / raw)
  To: help-gnu-emacs

On 2009-12-05 02:59 (+0100), Jonas Stein wrote:

> what is the best way to start emacs --deamon in a debian (testing)
> system? Should i put it in a selfmade init script to /etc/init.d or
> into /etc/profiles or some elsewhere?

I suggest using emacsclient with -a '' option. It connects to the daemon
or starts it if it's not running already. For example, I have Bash alias

    alias em="emacsclient -t -a '' --"

and my KDE has a shortcut key which executes command

    emacsclient -c -n -a ''


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

* Re: where to start emacs --deamon in debian?
  2009-12-05  1:59 Jonas Stein
@ 2009-12-05 10:09 ` Peter Dyballa
  2009-12-05 11:00 ` Daniel Dalton
  2009-12-06 13:25 ` barriehie
  2 siblings, 0 replies; 8+ messages in thread
From: Peter Dyballa @ 2009-12-05 10:09 UTC (permalink / raw)
  To: Jonas Stein; +Cc: gnu-emacs-help


Am 05.12.2009 um 02:59 schrieb Jonas Stein:

> what is the best way to start emacs --deamon in a debian (testing)  
> system?
> Should i put it in a selfmade init script to /etc/init.d or into / 
> etc/profiles
> or some elsewhere?


A system file is not the appropriate choice (you won't own the  
process). A script which is executed at your (personal) login time is  
more suitable – but it must not launch GNU Emacs whenever a login  
shell is initiated! This can be achieved by checking before whether  
GNU Emacs is running, whether an environment variable is set (set when  
GNU Emacs was launched as daemon the first time), whether a semaphore  
file exists (created when GNU Emacs was launched as daemon the first  
time)...

--
Greetings

   Pete

Genius may have its limitations, but stupidity is not thus handicapped.
				– Elbert Hubbard





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

* Re: where to start emacs --deamon in debian?
  2009-12-05  1:59 Jonas Stein
  2009-12-05 10:09 ` Peter Dyballa
@ 2009-12-05 11:00 ` Daniel Dalton
  2009-12-06 13:25 ` barriehie
  2 siblings, 0 replies; 8+ messages in thread
From: Daniel Dalton @ 2009-12-05 11:00 UTC (permalink / raw)
  To: help-gnu-emacs

[-- Attachment #1: Type: text/plain, Size: 338 bytes --]

On Sat, Dec 05, 2009 at 02:59:04AM +0100, Jonas Stein wrote:
> what is the best way to start emacs --deamon in a debian (testing) system?

I do this in .bash_profile for the users who I wish to set this up for:

if ! killall -q -s 0 emacs ; then
  emacs --daemon
fi

-- 
Cheers,
Dan

http://members.iinet.net.au/~ddalton/


[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

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

* Re: where to start emacs --deamon in debian?
       [not found] <mailman.12252.1259993777.2239.help-gnu-emacs@gnu.org>
  2009-12-05  6:32 ` where to start emacs --deamon in debian? Teemu Likonen
@ 2009-12-06  0:30 ` Tim X
  1 sibling, 0 replies; 8+ messages in thread
From: Tim X @ 2009-12-06  0:30 UTC (permalink / raw)
  To: help-gnu-emacs

Jonas Stein <news@jonasstein.de> writes:

> Hi 
> what is the best way to start emacs --deamon in a debian (testing) system?
> Should i put it in a selfmade init script to /etc/init.d or into /etc/profiles 
> or some elsewhere?
>
> kind regards,
> Jonas
>
>

don't do it as a /etc/init.d script. This overly complicates things and
buys you very little. Remember that emacs daemon mode is not designed to
be a multi-user daemon, its a user daemon. 

My advice would be to put it in your ~/.bash_profile or ~/profile or
whatever script is run by your shell when you login. Another
alternative, if you run X, wold be to put it in your X startup script
(depends on what X environment your running). Just ensure your code
checks to make sure its not already running before you start it.

I find all such setups more hassle to setup and maintain than benefits
they provide. I just use emacsclient when I want an emacs
frame and have it setup such that if emacs is not running, it will start
it up in daemon mode. I'm runing the CVS version and this seems to be
the efault behavior anyway, but I'm not sure if that is also the case
with the released version.

Tim

-- 
tcross (at) rapttech dot com dot au


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

* Re: where to start emacs --deamon in debian?
  2009-12-05  6:32 ` where to start emacs --deamon in debian? Teemu Likonen
@ 2009-12-06  0:32   ` Tim X
  0 siblings, 0 replies; 8+ messages in thread
From: Tim X @ 2009-12-06  0:32 UTC (permalink / raw)
  To: help-gnu-emacs

Teemu Likonen <tlikonen@iki.fi> writes:

> On 2009-12-05 02:59 (+0100), Jonas Stein wrote:
>
>> what is the best way to start emacs --deamon in a debian (testing)
>> system? Should i put it in a selfmade init script to /etc/init.d or
>> into /etc/profiles or some elsewhere?
>
> I suggest using emacsclient with -a '' option. It connects to the daemon
> or starts it if it's not running already. For example, I have Bash alias
>
>     alias em="emacsclient -t -a '' --"
>
> and my KDE has a shortcut key which executes command
>
>     emacsclient -c -n -a ''

Yep, thats the way to do it IMO. No hassles with scripting to ensure it
isn't already running, no complications with issues in your .emacs
screwing up your startup scripts etc. Nice and simple and easy to
maintain and lets emacs to all the heavy lifting!

Tim
-- 
tcross (at) rapttech dot com dot au


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

* Re: where to start emacs --deamon in debian?
  2009-12-05  1:59 Jonas Stein
  2009-12-05 10:09 ` Peter Dyballa
  2009-12-05 11:00 ` Daniel Dalton
@ 2009-12-06 13:25 ` barriehie
  2009-12-06 15:16   ` Richard Riley
  2 siblings, 1 reply; 8+ messages in thread
From: barriehie @ 2009-12-06 13:25 UTC (permalink / raw)
  To: Help-gnu-emacs



Jonas Stein wrote:
> 
> Hi 
> what is the best way to start emacs --deamon in a debian (testing) system?
> Should i put it in a selfmade init script to /etc/init.d or into
> /etc/profiles 
> or some elsewhere?
> 
> kind regards,
> Jonas
> 

I agree with the prior posts re: not starting the process via system init
files!  The wiki has an article on doing just that if you must.  Personally
I've got (server-start) in my .emacs and thereafter every file is opened
with the client. 

Barrie


-----
Hardy 8.04

-- 
View this message in context: http://old.nabble.com/where-to-start-emacs---deamon-in-debian--tp26653279p26664977.html
Sent from the Emacs - Help mailing list archive at Nabble.com.





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

* Re: where to start emacs --deamon in debian?
  2009-12-06 13:25 ` barriehie
@ 2009-12-06 15:16   ` Richard Riley
  0 siblings, 0 replies; 8+ messages in thread
From: Richard Riley @ 2009-12-06 15:16 UTC (permalink / raw)
  To: help-gnu-emacs

barriehie <barriehie@bluebottle.com> writes:

> Jonas Stein wrote:
>> 
>> Hi 
>> what is the best way to start emacs --deamon in a debian (testing) system?
>> Should i put it in a selfmade init script to /etc/init.d or into
>> /etc/profiles 
>> or some elsewhere?
>> 
>> kind regards,
>> Jonas
>> 
>
> I agree with the prior posts re: not starting the process via system init
> files!  The wiki has an article on doing just that if you must.  Personally
> I've got (server-start) in my .emacs and thereafter every file is opened
> with the client. 

Only if you issue emacsclient as the command. However, there is no need
with emacs 23 to specifically do a server start. Just set your editor
env to something like "edit" where edit is a small bash script like
this:-

,----
| #!/bin/bash
| # edit
| export GDK_NATIVE_WINDOWS=1
| exec emacsclient --alternate-editor="" -c "$@"
`----

NB: the export is to get around a menu bug in emacs 23.

In my .bash_env I have

,----
| export EDITOR="~/bin/edit"
`----

Since you need to emacsclient anyway if you specifically do a
server-start then you might as well issue "edit" or whatever you want it
to be and let emacs take care of it. If the daemon is not running it
automatically starts it for you.





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

end of thread, other threads:[~2009-12-06 15:16 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <mailman.12252.1259993777.2239.help-gnu-emacs@gnu.org>
2009-12-05  6:32 ` where to start emacs --deamon in debian? Teemu Likonen
2009-12-06  0:32   ` Tim X
2009-12-06  0:30 ` Tim X
2009-12-05  1:59 Jonas Stein
2009-12-05 10:09 ` Peter Dyballa
2009-12-05 11:00 ` Daniel Dalton
2009-12-06 13:25 ` barriehie
2009-12-06 15:16   ` Richard Riley

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.