summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Tom Willemse2014-04-21 11:22:41 +0200
committerGravatar Tom Willemse2014-04-21 11:22:41 +0200
commite071edabe36e0a11fd6ef243624060e52a51400f (patch)
tree3cf8c6be577604a775330d9561fad43158a11e0c
parent329b8457113ad3ff90b5ba944465275aec5f06f2 (diff)
downloademacs-e071edabe36e0a11fd6ef243624060e52a51400f.tar.gz
emacs-e071edabe36e0a11fd6ef243624060e52a51400f.zip
Fix some settings for Emacs Daemon
-rw-r--r--.emacs.d/init.org102
1 files changed, 70 insertions, 32 deletions
diff --git a/.emacs.d/init.org b/.emacs.d/init.org
index 6c6e35e..8421150 100644
--- a/.emacs.d/init.org
+++ b/.emacs.d/init.org
@@ -100,19 +100,6 @@
(tool-bar-mode -1)
#+END_SRC
-** Scroll bar
-
- The scroll-bar is almost just as informative as the current line
- number and buffer position information shown in the (my) mode line.
- As I don't usually need to know where I am, other than the current
- line number occasionally, and I don't use the mouse, the scroll bar
- doesn't add anything and only takes up space. Once more: It has got
- to go.
-
- #+BEGIN_SRC emacs-lisp
- (scroll-bar-mode -1)
- #+END_SRC
-
** Blinking cursor
I suppose a blinking cursor doesn't get lost very easily. But on
@@ -181,35 +168,86 @@
** The default frame
+ Usually, most of these settings would be done with functions like
+ =set-frame-font= or =scroll-bar-mode=, but working with the Emacs
+ Daemon sometimes creates extra complications, because you might
+ start a graphical environment at some point (I usually do
+ immediately), but the startup process isn't.
+
+*** Internal border
+
Set the internal border width to 0. This makes a small difference,
with my current setup it causes my window's width to increase from
120 to 121. Small, I know, but I'm very greedy when it comes to
screen space.
- #+BEGIN_SRC emacs-lisp
- (setq default-frame-alist
- `((internal-border-width . 0)))
+ #+NAME: default-frame-internal-border
+ #+BEGIN_SRC emacs-lisp :tangle no
+ (internal-border-width . 0)
#+END_SRC
-** A fantastic font
+*** A fantastic font
- I've tried several fonts, and all of them were nice, but came up
- short on some way. Some didn't have italic variants, some had
- dotted zeroes instead of dashed zeroes, some even had entirely
- clear zeroes which make them look like ~O~'s, others had
- boring-looking parentheses[fn:4]. Not Fantasque Sans Mono[fn:5][fn:6], it
- is awesome. If your web browser supports web fonts you should also
- see it used in the code blocks here.
+ I've tried several fonts, and all of them were nice, but came up
+ short on some way. Some didn't have italic variants, some had
+ dotted zeroes instead of dashed zeroes, some even had entirely
+ clear zeroes which make them look like ~O~'s, others had
+ boring-looking parentheses[fn:4]. Not Fantasque Sans
+ Mono[fn:5][fn:6], it is awesome. If your web browser supports web
+ fonts you should also see it used in the code blocks here.
- Normally the =set-frame-font= sets the font only for the current
- frame. However, passing =t= as the 3rd argument it makes it apply the
- font to all frames, and makes Emacs think it was set for the
- current session in customize so that future frames will also use
- this font.
+ For normal Emacs setups you might use the =set-frame-font= function
+ like so:
- #+BEGIN_SRC emacs-lisp
- (set-frame-font "Fantasque Sans Mono:pixelsize=17" nil t)
- #+END_SRC
+ #+BEGIN_SRC emacs-lisp :tangle no
+ (set-frame-font "Fantasque Sans Mono:pixelsize=17" nil t)
+ #+END_SRC
+
+ However, this doesn't work when running Emacs as a Daemon. You
+ could (especially with lexical binding) add an
+ =after-make-frame-functions= hook or something similar, but I find
+ it easier to just specify the font in the =default-frame-alist=.
+
+ #+NAME: default-frame-font
+ #+BEGIN_SRC emacs-lisp :tangle no
+ (font . "Fantasque Sans Mono:pixelsize=17")
+ #+END_SRC
+
+*** Scroll bar
+
+ The scroll-bar is almost just as informative as the current line
+ number and buffer position information shown in the (my) mode
+ line. As I don't usually need to know where I am, other than the
+ current line number occasionally, and I don't use the mouse, the
+ scroll bar doesn't add anything and only takes up space. Once
+ more: It has got to go.
+
+ Normally you would use something along the lines of:
+
+ #+BEGIN_SRC emacs-lisp :tangle no
+ (scroll-bar-mode -1)
+ #+END_SRC
+
+ However, this doesn't work when running Emacs as a Daemon. So
+ instead I specify it in the =default-frame-alist=.
+
+ #+NAME: default-frame-scroll-bar
+ #+BEGIN_SRC emacs-lisp :tangle no
+ (vertical-scroll-bars . nil)
+ #+END_SRC
+
+*** Setting the option
+
+ So I've explained the reasons for each individual setting, but to
+ get them to work they have to be put in the =default-frame-alist=.
+ Here is the final setting:
+
+ #+BEGIN_SRC emacs-lisp :noweb yes
+ (setq default-frame-alist
+ `(<<default-frame-internal-border>>
+ <<default-frame-font>>
+ <<default-frame-scroll-bar>>))
+ #+END_SRC
** Frame title