aboutsummaryrefslogtreecommitdiff
blob: 9300a69dd93c2b999d7ca4efe07a12341c4b6295 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
<?xml version="1.0" encoding="UTF-8"?>
<guide self="appendices/editor-configuration/emacs/">
<chapter>
<title>Configuring GNU Emacs</title>

<section>
<title>UTF-8 support</title>
<body>

<p>
GNU Emacs has built-in Unicode support, and since version 23 it uses
UTF-8 as its internal encoding. It is recommended to start Emacs from
within a UTF-8 locale which will control the default coding system.
</p>

<p>
Emacs will normally autodetect the coding system for given text.
In rare cases it may be necessary to tell Emacs that a UTF-8 file is
being opened by prefixing the <c>C-x C-f</c> or <c>C-x C-v</c> command
with <c>C-x C-m c utf-8 RET</c>. As a diagnostic measure, the coding
system currently in use can be determined with <c>C-h C RET</c>.
</p>

<p>
If it is desired to prefer UTF-8 to the regular character set in a
non-UTF-8 locale, the following can be used inside of the Emacs
startup file:
</p>

<pre>
    (prefer-coding-system 'utf-8)
</pre>

</body>
</section>

<section>
<title>Configuration tips and tricks</title>
<body>

<p>
Files must end with a newline, in order to let tools like <c>diff</c>
operate properly. To avoid accidental deletions, setting
<c>(setq require-final-newline 'ask)</c> in your startup file will
automatically check for the existence of it and ask you to add one.
Note that many modes for programming languages will add the newline
automatically before saving the file.
</p>

<p>
Other useful settings can be disabled backup files
(by <c>(setq make-backup-files nil)</c>), so you don't clutter the git
repository directories.  Emacs can even contact the outside world
by using the X servers clipboard abilities when yanking, which is
activated by <c>(setq x-select-enable-clipboard t)</c>.
</p>

</body>
</section>

<section>
<title>Gentoo specific additions</title>
<body>

<p>
For easy editing of ebuilds an Emacs mode has been created, which is
found in the package <c>app-emacs/ebuild-mode</c>.
It supports ebuilds and eclasses, highlights keywords and also
provides a hook for your own customisation.
</p>

<p>
Package <c>app-emacs/nxml-gentoo-schemas</c> improves editing of
Gentoo specific XML files (e.g., <c>metadata.xml</c>). It provides
auto-completion and on-the-fly validation, using a RELAX NG schema
for each document type.
</p>

</body>
</section>

<section>
<title>Further Reading</title>
<body>

<ul>
  <li>
    <uri link="https://www.gnu.org/software/emacs/manual/html_node/emacs/Recognize-Coding.html">
    https://www.gnu.org/software/emacs/manual/html_node/emacs/Recognize-Coding.html</uri>
  </li>
  <li>
    <uri link="https://www.gnu.org/software/emacs/manual/html_node/emacs/Specify-Coding.html">
    https://www.gnu.org/software/emacs/manual/html_node/emacs/Specify-Coding.html</uri>
  </li>
  <li>
    <uri link="https://www.emacswiki.org/emacs/UnicodeEncoding">
    https://www.emacswiki.org/emacs/UnicodeEncoding</uri>
  </li>
  <li>
    <uri link="https://www.emacswiki.org/emacs/ChangingEncodings">
    https://www.emacswiki.org/emacs/ChangingEncodings</uri>
  </li>
</ul>

</body>
</section>

</chapter>
</guide>