all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Start the emacs-server once...
@ 2008-08-20 12:48 Alex Bennee
  0 siblings, 0 replies; 4+ messages in thread
From: Alex Bennee @ 2008-08-20 12:48 UTC (permalink / raw)
  To: help-gnu-emacs

Hi,

I want to set-up emacs to start the server once per X sessions (and I
guess once per screen session once I get multi-tty working). However
there doesn't seem to be way to check in emacs if the server is
currently running.

So far the best I can come up with is having my start-up emacs with the
args:

emacs --eval (defvar this-is-the-master t)

And appropriate hackery in the .emacs. Is there a nicer way to deal with
this?

-- 
Alex Bennee, Software Engineer
Civilization, as we know it, will end sometime this evening. See SYSNOTE
tomorrow for more information.





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

* Start the emacs-server once...
@ 2008-08-21 11:55 Alex Bennee
  2008-08-21 14:41 ` Allan Gottlieb
  0 siblings, 1 reply; 4+ messages in thread
From: Alex Bennee @ 2008-08-21 11:55 UTC (permalink / raw)
  To: help-gnu-emacs

Hi,

I want to set-up emacs to start the server once per X sessions (and I
guess once per screen session once I get multi-tty working). However
there doesn't seem to be way to check in emacs if the server is
currently running.

So far the best I can come up with is having my start-up emacs with the
args:

emacs --eval (defvar this-is-the-master t)

And appropriate hackery in the .emacs. Is there a nicer way to deal with
this?

-- 
Alex Bennee, Software Engineer
Civilization, as we know it, will end sometime this evening. See SYSNOTE
tomorrow for more information.





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

* Re: Start the emacs-server once...
  2008-08-21 11:55 Start the emacs-server once Alex Bennee
@ 2008-08-21 14:41 ` Allan Gottlieb
  0 siblings, 0 replies; 4+ messages in thread
From: Allan Gottlieb @ 2008-08-21 14:41 UTC (permalink / raw)
  To: help-gnu-emacs

At Thu, 21 Aug 2008 12:55:00 +0100 Alex Bennee <ajb-ml@cbnl.com> wrote:

> Hi,
>
> I want to set-up emacs to start the server once per X sessions (and I
> guess once per screen session once I get multi-tty working). However
> there doesn't seem to be way to check in emacs if the server is
> currently running.
>
> So far the best I can come up with is having my start-up emacs with the
> args:
>
> emacs --eval (defvar this-is-the-master t)
>
> And appropriate hackery in the .emacs. Is there a nicer way to deal with
> this?

I don't know if it is nicer (I suspect it is similar)
but I use the following so that the invocation of emacs is not changed.

;; Use emacsclient/emacsserver
;;
;; Using code from Tassilo Horn so a server started on first emacs only
;; The code should remove the file when the server ends.
;; Sometimes the file remains (why?) so I explicitly invoke the removal
;; function from ~/bin/Xinitialize.
(defvar ajg-server-lock-file "~/.emacs.d/server.lock" "Emacs server lock file.")

(defun ajg-server-start ()
  (interactive)
  (shell-command (concat "touch " ajg-server-lock-file))
  (server-start)
  (message "Emacs Server started...")
  (setq frame-title-format '("Emacs (Server): %b <%f>")))

(if (and (not (file-exists-p ajg-server-lock-file))
         (not noninteractive))
    (ajg-server-start)
  (message "Emacs Server NOT started, because lockfile exists.")
  (setq frame-title-format
        '("Emacs: %b <%f>")))

(defun ajg-server-remove-lock-file ()
  (interactive)
  (when (boundp 'server-process)
    (shell-command (concat "rm " ajg-server-lock-file))))

;; Remove lock file when emacs server ends
(add-hook 'kill-emacs-hook
          'ajg-server-remove-lock-file)


HTH
allan




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

* Re: Start the emacs-server once...
       [not found] <mailman.17232.1219324446.18990.help-gnu-emacs@gnu.org>
@ 2008-08-22  0:26 ` Rupert Swarbrick
  0 siblings, 0 replies; 4+ messages in thread
From: Rupert Swarbrick @ 2008-08-22  0:26 UTC (permalink / raw)
  To: help-gnu-emacs


[-- Attachment #1.1: Type: text/plain, Size: 753 bytes --]

Alex Bennee <ajb-ml@cbnl.com> writes:

> Hi,
>
> I want to set-up emacs to start the server once per X sessions (and I
> guess once per screen session once I get multi-tty working). However
> there doesn't seem to be way to check in emacs if the server is
> currently running.
>
> So far the best I can come up with is having my start-up emacs with the
> args:
>
> emacs --eval (defvar this-is-the-master t)
>
> And appropriate hackery in the .emacs. Is there a nicer way to deal with
> this?
>

You might be interested in the page on the emacswiki about this [1]. My
config is detailed on there (along with lots of other peoples'
solutions!).

The one thing that I use that I really like is a function called
delete-frame-ex, which is hopefully below


[-- Attachment #1.2: delete-frame-ex.el --]
[-- Type: application/emacs-lisp, Size: 653 bytes --]

[-- Attachment #1.3: Type: text/plain, Size: 369 bytes --]


I bind this to C-x C-c, which means that you can call the "magic emacs"
command on a load of files, edit them in different frames and when you
hit C-x C-c, you don't kill something you were working on in a different
desktop. For me, this is at least as important as spawning the frames in
the first place!

Rupert


[1] http://www.emacswiki.org/cgi-bin/wiki/GnuClient

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

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

end of thread, other threads:[~2008-08-22  0:26 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-08-21 11:55 Start the emacs-server once Alex Bennee
2008-08-21 14:41 ` Allan Gottlieb
     [not found] <mailman.17232.1219324446.18990.help-gnu-emacs@gnu.org>
2008-08-22  0:26 ` Rupert Swarbrick
  -- strict thread matches above, loose matches on Subject: below --
2008-08-20 12:48 Alex Bennee

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.