5 ms·
this has got to be trolling. right? right?! i'm so confused.
by jlhim 11y ago
this has got to be trolling. right? right?! i'm so confused.
- schwap 11y agoBack when I first started my CompSci degree, a friend of mine always "quit" emacs with ctrl-z. Or, at least he did until he managed to fill his entire home directory quota with emacs backup files that were never cleaned up...
- __david__ 11y agoHa, I still do that! $ jobs [4] Stopped emacsclient -a '' -nw [redacted] (wd: [redacted]) [5] Stopped emacsclient -a '' -nw [redacted] (wd: [redacted]) [6] Stopped emacsclient -a '' -nw [redacted] (wd: [redacted]) [7] Stopped emacsclient -a '' -nw [redacted] (wd: [redacted]) [8] Stopped emacsclient -a '' -nw [redacted] (wd: [redacted]) [9] Stopped emacsclient -a '' -nw [redacted] (wd: [redacted]) [10] Stopped emacsclient -a '' -nw [redacted] (wd: [redacted]) [11] Stopped emacsclient -a '' -nw [redacted] (wd: [redacted]) [12]- Stopped emacsclient -a '' -nw [redacted] (wd: [redacted]) [13]+ Stopped emacsclient -a '' -nw [redacted] But since they're all emacsclients it doesn't really matter.
- api_or_ipa 11y ago`fg` is your friend
- jnpatel 11y agoDon't you frequently deal with: /private/tmp/foo.txt locked by jnpatel@mac... (pid 14836): (s, q, p, ?)? because of the lock files?
- __david__ 11y agoNope, because emacsclient ends up opening them all in the same process (that's the beauty/entire point): Fork off an emacs in the background: emacs --daemon Then run emacsclient to connect to it (open a new buffer in the daemon and switch to it): emacsclient -nw some_file When you "quit" (with C-x C-c), it really just quits that client, but the main emacs is left running. This has a number of benefits: 1) no locks like you mention, 2) access to all open buffers (even unsaved) from every emacsclient that's currently running (since they're really all just opening buffers in a single instance), 3) blazing startup speed (emacs is already running, you're just connecting to it and splatting a new buffer to the terminal).
- krylon 11y agoI still remember how happy I was when I found out about that. On all servers I use (at home and at work), starting an emacs daemon is usually among the first things I do after rebooting.
- rcthompson 11y agoDo you know about the "--no-wait" option for emacsclient?
- __david__ 11y agoYes. But it doesn't play well with "-nw".
- rcthompson 11y agoAh yes, good point. In that case, the solution is `C-x #` to finish an emacsclient session without causing the server to quit.
- __david__ 11y agoLuckily C-x C-c also does that now.