Fork me on GitHub
#emacs
<
2022-08-27
>
Drew Verlee05:08:46

Today i learned that i should be running an Emacs server and just launching a client to connect to it. Via this video: https://youtu.be/s0ed8Da3mjE

👍 7
❤️ 1
vemv05:08:10

Not sure if 'should', but I do use it. A fast-starting .emacs.d allows being liberal with how often you quit / restart it. I have the habit of doing a few restarts a day for avoiding accumulating useless (potentially problematic) state. I use the server as launched from a GUI app, mainly for scripting the GUI app. Also, occasionally, for editing files from iTerm.

👀 1
norman18:08:22

I've been an emacs user for 30+ years. I don't do this. I can see how under certain usage patterns it might make sense, but it definitely doesn't work for the way I use it. I tend to work on different tasks on different desktops. I keep the emacs for that task open for the life of the task, perhaps restarting every now and then if I feel I'm accumulating too much cruft or want to pick up updates.

👀 1
👍 1
nivekuil18:08:00

aside from fast startup, also try emacsclient -nw over ssh on your phone

Drew Verlee20:08:45

> I use the server as launched from a GUI app, mainly for scripting the GUI app. which GUI app? Is it a linux package?

Drew Verlee20:08:49

> perhaps restarting every now and then if I feel I'm accumulating too much cruft or want to pick up updates. Yea, if it's leads to more oddity orthogonal to the task at hand, then it's not worth the 4 seconds it takes emacs to power up and get me back to where i was.

vemv07:08:27

> which GUI app? Is it a linux package? it's simply emacs packaged as a macos .app which has a native os integration, etc. Contrariwise, a pure binary can only run in the terminal, so it's a less rich experience

Ed11:08:22

I run the server by starting emacs with emacs --daemon and have a few keybindings in my .zshrc like

bindkey -s "^x^f" $'^aemacsclient -c -nw '
because I kept trying to find a file in emacs from the shell prompt accidentally by hitting the keyboard shortcut. I use dabbrev-expand a lot (out of a long ingrained habbit) which works better if you don't close the buffers in your project so dabbrev can complete existing function names, etc ... I like the workflow of opening files in the terminal for quickly editing things or using magit with things like this:
alias magit="emacsclient -nw -c -e '(magit-status)'"
but I also like having a gui emacs with all the same buffers and repl connections open in the same process. I tend to only restart emacs when I reboot the machine.

Ed11:08:23

also ... I set export EDITOR='emacsclient -nw -c' which makes life better when using terminal programs like git or mutt 😉

Jeongsoo Lee22:08:27

I also used to float around emacs daemon and connect to it on-demand, but from some moment on I just close the laptop lid and go 😂

👀 1