Fork me on GitHub
#emacs
<
2016-06-15
>
escherize00:06:08

as customers users it's great to see this level of customer support

jan.zy08:06:57

Hi, what are the advantages of running emacs in daemon mode?

jan.zy08:06:09

I use it only on my laptop. I guess that it would make sense if I had a remote machine where I could run the daemon

jan.zy08:06:41

as usual, I forgot that emacs has great docs

m1dnight09:06:26

No problem. I quickly configured it on y machine as well.

m1dnight09:06:29

Bit annoying on OSX, though.

jan.zy09:06:02

do you run it as a system service?

jan.zy09:06:16

[or however it is called]

m1dnight09:06:06

But the problem is that now the Emacs thing in my dock is always on. Which I don’t really mind, but you can no longer start Emacs from that icon.

m1dnight09:06:13

You have to use emacsclient -c in the terminal

m1dnight09:06:23

But I open most files from there so no biggie really.

jan.zy10:06:03

i turned off my dock 🙂

jan.zy10:06:20

I hardly ever click any icons

jan.zy10:06:47

i prefer to click cmd+space or just cmd when I am on ubuntu and use keyboard to find what i need

jan.zy10:06:02

actually it works on windows as well

jan.zy10:06:12

in Start menu

m1dnight10:06:55

Hrm, just noticed. When I do emacsclient -c file.ext it opens an Emacs instance immediately but it blocks the terminal

m1dnight10:06:09

when I do emacsclient -c -nw file.ext it opens emacs in the terminal itself.

m1dnight10:06:15

Anyone experience with that?

hrathod14:06:58

emacsclient -n -c file.ext will not block the terminal.

-n, --no-wait		Don't wait for the server to return

plexus14:06:50

-nw will open a new emacs "frame" on the current terminal, in other words it connects to your running emacs

plexus14:06:13

it's like C-x 5 2 except now the other frame is in in a terminal instead of a GUI

hrathod14:06:16

-nw actually just means "no window", meaning use terminal

hrathod14:06:35

right, what you said

hrathod14:06:39

I can't read

plexus14:06:57

I've used this sometimes when doing remote pairing with tmux/tmate

plexus14:06:34

so we can share a (terminal) emacs, but I can still edit the same buffers with the GUI if some keybinding stuff isn't cooperating in the terminal

hrathod14:06:49

I have emacsclient aliased to emacsclient -nc

hrathod14:06:22

that's a neat idea for pair programming

plexus14:06:32

I have a shorthand nc for emacsclient -n. I rarely use more than one frame

plexus14:06:52

except when recording screencasts 🙂 then I have one frame with the episode script, and one frame that I record

hrathod14:06:24

I tend to use one frame per project (mostly small NodeJS projects)

hrathod14:06:49

usually helps me keep them separated in my head, as they tend to have many files with the same name

pastafari14:06:38

since we’re on the topic of frames, i have this in my initializer (set-frame-font "Monaco-16" nil t)

pastafari14:06:10

but it doesn’t set the font for frames launched with emacsclient -nc, until i eval it, and then it works fine for subsequent frames.

malabarba14:06:31

>(set-frame-font FONT &optional KEEP-SIZE FRAMES) > If FRAMES is non-nil, it should be a list of frames to act upon, > or t meaning all existing graphical frames.

malabarba14:06:43

It doesn't apply to future frames 🙂

malabarba15:06:21

There are ways to set default frame parameters, including font, that apply to all frames

malabarba15:06:37

But what I do is this: (set-face-attribute 'default nil :font "SourceCodePro Medium")

pastafari15:06:43

malabarba: Thanks. I did read that, but the behavior I see is that it DOES apply to future frames, once eval’ed explicitly.

pastafari15:06:52

which has me confused :S

pastafari15:06:05

im also using prelude

pastafari15:06:14

which might have something to do with it...

malabarba15:06:59

Well. Once you eval it, it reapplies to all existing frames again.

malabarba15:06:30

Or are you saying that after you eval it it also applies to future frames?

hrathod15:06:48

I use

(setq default-frame-alist '((font . "Source Code Pro-13"))
and it seems to work with emacsclient

pastafari15:06:43

malabarba: yes it applies to future frames.

pastafari15:06:53

which has me confused.

plexus15:06:01

I asked the exact same question here a few months back 🙂 https://clojurians-log.clojureverse.org/emacs/2016-04-29.html

plexus15:06:57

> zzamboni 18:13:31 > @plexus: I always use customize-face and choose default, from which most other faces inherit

pastafari16:06:56

plexus: thanks, trying that. It generated a giant incantation to custom-set-faces

pastafari16:06:10

I’m going to put that in init and see what happens!

plexus16:06:58

You can put something like this in your init

plexus16:06:01

;; Keep emacs customize settings in separate file
(setq custom-file (expand-file-name "emacs-custom.el" user-emacs-directory))
(load custom-file)

plexus16:06:53

that way emacs-custom.el contains everything that's configured through customized. otherwize it adds that to .emacs/init.el which I'm not a fan of

pastafari16:06:00

plexus: yes, thats what i do.

pastafari16:06:08

plexus: and it works!

plexus16:06:23

\o/ all hail to emacs emacs 🎉

pastafari16:06:54

plexus: i was in two minds about committing custom.el to source control. but i guess that makes sense.

plexus16:06:22

yeah that's a normal thing to do. I'm still never sure what to configure through customize and what through good old setq and friends