all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Emacs Daemon Service
@ 2024-05-12 21:41 Andrew Wong
  2024-05-15 12:45 ` Guillaume Le Vaillant
  0 siblings, 1 reply; 3+ messages in thread
From: Andrew Wong @ 2024-05-12 21:41 UTC (permalink / raw)
  To: help-guix

Greetings!

Recently I’ve been trying to have an Emacs daemon start in the background on login. On Guix, I’ve found some interesting behavior in that an Emacs started with no args and then the command “server-start” will then be available to subsequent emacsclient calls, but an “emacs —daemon” is inaccessible, even if I call the command from my WM startup.

1. Does anyone understand why Guix’s design results in this behavior?
2. How can I set up a service in my configure-home.scm to start emacs —daemon (and have it be available) on login? I found a post from 2019 about it, but it must be outdated as it doesn’t mention the Guix home feature.

Thank you for your assistance,
Andrew

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

* Re: Emacs Daemon Service
  2024-05-12 21:41 Emacs Daemon Service Andrew Wong
@ 2024-05-15 12:45 ` Guillaume Le Vaillant
  2024-05-15 21:53   ` Andrew Wong
  0 siblings, 1 reply; 3+ messages in thread
From: Guillaume Le Vaillant @ 2024-05-15 12:45 UTC (permalink / raw)
  To: Andrew Wong; +Cc: help-guix

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

Andrew Wong <brosasaki@gmail.com> skribis:

> Greetings!
>
> Recently I’ve been trying to have an Emacs daemon start in the background on
> login. On Guix, I’ve found some interesting behavior in that an Emacs started
> with no args and then the command “server-start” will then be available to
> subsequent emacsclient calls, but an “emacs —daemon” is inaccessible, even if
> I call the command from my WM startup.
>
> 1. Does anyone understand why Guix’s design results in this behavior?
> 2. How can I set up a service in my configure-home.scm to start emacs —daemon
> (and have it be available) on login? I found a post from 2019 about it, but it
> must be outdated as it doesn’t mention the Guix home feature.
>
> Thank you for your assistance,
> Andrew

Hi.
In my Guix home configuration, I use the following service to start an
Emacs server:

--8<---------------cut here---------------start------------->8---
(define (emacs-server-shepherd-service config)
  (list (shepherd-service
         (documentation "Emacs server.")
         (provision '(emacs-server))
         (start #~(make-forkexec-constructor
                   (list #$(file-append emacs "/bin/emacs")
                         "--fg-daemon")))
         (stop #~(make-kill-destructor)))))

(define home-emacs-server-service-type
  (service-type
   (name 'home-emacs-server)
   (extensions (list (service-extension home-shepherd-service-type
                                        emacs-server-shepherd-service)))
   (default-value #f)
   (description "Run Emacs in server mode.")))

(home-environment
  ...
  (services
   (list ...
         (service home-emacs-server-service-type)
         ...)))
--8<---------------cut here---------------end--------------->8---

Then, using "emacsclient -n -c some-file" works.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 247 bytes --]

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

* Re: Emacs Daemon Service
  2024-05-15 12:45 ` Guillaume Le Vaillant
@ 2024-05-15 21:53   ` Andrew Wong
  0 siblings, 0 replies; 3+ messages in thread
From: Andrew Wong @ 2024-05-15 21:53 UTC (permalink / raw)
  To: Guillaume Le Vaillant; +Cc: help-guix

Thank you! That’s very useful.
As for the strange daemon issue, I found that it was an issue with my personal config. Remember to set package-user-dir in early-init.el, friends.

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

end of thread, other threads:[~2024-05-15 21:54 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-05-12 21:41 Emacs Daemon Service Andrew Wong
2024-05-15 12:45 ` Guillaume Le Vaillant
2024-05-15 21:53   ` Andrew Wong

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.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.