1 |
Author: fauli |
2 |
Date: 2009-07-02 11:42:15 +0000 (Thu, 02 Jul 2009) |
3 |
New Revision: 1293 |
4 |
|
5 |
Modified: |
6 |
emacsguide/emacsguide.xml |
7 |
Log: |
8 |
Fix indentation |
9 |
|
10 |
|
11 |
Modified: emacsguide/emacsguide.xml |
12 |
=================================================================== |
13 |
--- emacsguide/emacsguide.xml 2009-07-02 09:32:05 UTC (rev 1292) |
14 |
+++ emacsguide/emacsguide.xml 2009-07-02 11:42:15 UTC (rev 1293) |
15 |
@@ -32,7 +32,7 @@ |
16 |
<p>First, you must install Emacs.</p> |
17 |
|
18 |
<pre caption="Code Sample"> |
19 |
- # emerge --pretend --verbose app-editors/emacs |
20 |
+# emerge --pretend --verbose app-editors/emacs |
21 |
</pre> |
22 |
<!-- find /usr/portage/profiles/use.local* -type f -print0 | xargs -0 -e grep -nH -e emacs --> |
23 |
<table> |
24 |
@@ -189,19 +189,19 @@ |
25 |
<title>Eselect</title> |
26 |
<body> |
27 |
<pre caption="Eselect"> |
28 |
- # emerge app-admin/eselect |
29 |
- # eselect emacs list |
30 |
- Available Emacs symlink targets: |
31 |
- [1] emacs-21 * |
32 |
- [2] emacs-22 |
33 |
- # eselect emacs set 2 |
34 |
- Switching emacs to emacs-22 ... |
35 |
- Switching ctags to exuberant-ctags ... |
36 |
- Switching etags to etags-emacs-22 ... |
37 |
- # eselect emacs list |
38 |
- Available Emacs symlink targets: |
39 |
- [1] emacs-21 |
40 |
- [2] emacs-22 * |
41 |
+# emerge app-admin/eselect |
42 |
+# eselect emacs list |
43 |
+Available Emacs symlink targets: |
44 |
+[1] emacs-21 * |
45 |
+[2] emacs-22 |
46 |
+# eselect emacs set 2 |
47 |
+Switching emacs to emacs-22 ... |
48 |
+Switching ctags to exuberant-ctags ... |
49 |
+Switching etags to etags-emacs-22 ... |
50 |
+# eselect emacs list |
51 |
+Available Emacs symlink targets: |
52 |
+[1] emacs-21 |
53 |
+[2] emacs-22 * |
54 |
</pre> |
55 |
</body> |
56 |
</section> |
57 |
@@ -226,12 +226,12 @@ |
58 |
root. Note the # prompt. |
59 |
</p> |
60 |
<pre caption="Code Sample"> |
61 |
- # emerge --pretend --verbose app-emacs/python-mode |
62 |
- # emerge --pretend --verbose app-emacs/php-mode |
63 |
- Cscope can work with Emacs very conveniently. |
64 |
- # echo "dev-util/cscope emacs" >> /etc/portage/package.use |
65 |
- That will append the quoted text to the file "/etc/portage/package.use". |
66 |
- # emerge dev-util/cscope |
67 |
+# emerge --pretend --verbose app-emacs/python-mode |
68 |
+# emerge --pretend --verbose app-emacs/php-mode |
69 |
+Cscope can work with Emacs very conveniently. |
70 |
+# echo "dev-util/cscope emacs" >> /etc/portage/package.use |
71 |
+That will append the quoted text to the file "/etc/portage/package.use". |
72 |
+# emerge dev-util/cscope |
73 |
</pre> |
74 |
</body> |
75 |
</section> |
76 |
@@ -240,7 +240,7 @@ |
77 |
<body> |
78 |
<p>There is a tutorial for Emacs available.</p> |
79 |
<pre caption="Code Sample"> |
80 |
- M-x help-with-tutorial |
81 |
+M-x help-with-tutorial |
82 |
</pre> |
83 |
<p> |
84 |
That is Meta then x. The Meta key is escape or possibly Alt. Next |
85 |
@@ -278,10 +278,10 @@ |
86 |
bottom of the screen. |
87 |
</p> |
88 |
<pre caption="Code Sample"> |
89 |
- (list 'a 'b 'c) |
90 |
- (+ 1 2 3) |
91 |
- (* (* 2 2) (/ 22 7)) |
92 |
- (message "%s" "This is an introduction to using Emacs in Gentoo.") |
93 |
+(list 'a 'b 'c) |
94 |
+(+ 1 2 3) |
95 |
+(* (* 2 2) (/ 22 7)) |
96 |
+(message "%s" "This is an introduction to using Emacs in Gentoo.") |
97 |
</pre> |
98 |
<p> |
99 |
Understanding how to navigate the cursor over lists is quite |
100 |
@@ -292,14 +292,14 @@ |
101 |
</p> |
102 |
<p>You could load your elisp.</p> |
103 |
<pre caption="Code Sample"> |
104 |
- M-x load-file |
105 |
+M-x load-file |
106 |
</pre> |
107 |
<p> |
108 |
Now, you may want to clean up your code or make replacements in a |
109 |
function. Click and drag or use control-space to set a mark. |
110 |
</p> |
111 |
<pre caption="Code Sample"> |
112 |
- M-x transient-mark-mode |
113 |
+M-x transient-mark-mode |
114 |
</pre> |
115 |
<p> |
116 |
That will toggle the highlighting of selected text. Now, M-% will |
117 |
@@ -315,9 +315,9 @@ |
118 |
<body> |
119 |
<p>Emacs can start subprocesses, like a shell or a debugger or even find and grep.</p> |
120 |
<pre caption="Code Sample"> |
121 |
- M-x shell |
122 |
- M-x gdb |
123 |
- M-x find-grep |
124 |
+M-x shell |
125 |
+M-x gdb |
126 |
+M-x find-grep |
127 |
</pre> |
128 |
<figure link="emacs.jpg" short="Find and Grep" caption="Search in Emacs"/> |
129 |
|
130 |
@@ -348,7 +348,7 @@ |
131 |
<body> |
132 |
<p>Now is where some completion becomes useful. There is M-/ to complete a string and also some elisp that does much more.</p> |
133 |
<pre caption="Code Sample"> |
134 |
- M-x hippie-expand |
135 |
+M-x hippie-expand |
136 |
</pre> |
137 |
|
138 |
<p> |
139 |
@@ -358,12 +358,12 @@ |
140 |
cursor. It is much nicer to bind this to a key. |
141 |
</p> |
142 |
<pre caption="Code Sample"> |
143 |
- M-x global-set-key |
144 |
+M-x global-set-key |
145 |
</pre> |
146 |
|
147 |
<p>This could be persistent in a .emacs file.</p> |
148 |
<pre caption="Code Sample"> |
149 |
- $ echo "(global-set-key [(f2)] 'hippie-expand)" >> ~/.emacs.d/init.el |
150 |
+$ echo "(global-set-key [(f2)] 'hippie-expand)" >> ~/.emacs.d/init.el |
151 |
</pre> |
152 |
|
153 |
<note><c>man man</c> has this tip: (global-set-key [(f1)] (lambda () (interactive) (manual-entry (current-word))))</note> |
154 |
@@ -377,9 +377,9 @@ |
155 |
configuration files. This is convenient in Emacs with flush-lines |
156 |
</p> |
157 |
<pre caption="Code Sample"> |
158 |
- M-x flush-lines |
159 |
- ^# |
160 |
- That will match lines beginning with a # which is a comment in most /etc configuration files. |
161 |
+M-x flush-lines |
162 |
+^# |
163 |
+That will match lines beginning with a # which is a comment in most /etc configuration files. |
164 |
</pre> |
165 |
</body> |
166 |
</section> |
167 |
@@ -392,7 +392,7 @@ |
168 |
<body> |
169 |
<p>Lets start by looking at some files.</p> |
170 |
<pre caption="Code Sample"> |
171 |
- Control-x, control-f, enter |
172 |
+Control-x, control-f, enter |
173 |
</pre> |
174 |
|
175 |
<p> |
176 |
@@ -402,28 +402,28 @@ |
177 |
you may open many files. |
178 |
</p> |
179 |
<pre caption="Code Sample"> |
180 |
- Control-x, control-b |
181 |
+Control-x, control-b |
182 |
</pre> |
183 |
|
184 |
<p>Now you may wish to do replacements in many files.</p> |
185 |
<pre caption="Code Sample"> |
186 |
- M-x dired<TAB><TAB> |
187 |
- M-x command-apropos <comment>This can show any dired command.</comment> |
188 |
+M-x dired<TAB><TAB> |
189 |
+M-x command-apropos <comment>This can show any dired command.</comment> |
190 |
</pre> |
191 |
|
192 |
<p>Now you see what is available. Here is one strategy.</p> |
193 |
<pre caption="Code Sample"> |
194 |
- M-x find-grep-dired |
195 |
- %-m c$ <comment>This will mark C sources or filenames ending in c.</comment> |
196 |
- M-x dired-do-query-replace-regexp |
197 |
+M-x find-grep-dired |
198 |
+%-m c$ <comment>This will mark C sources or filenames ending in c.</comment> |
199 |
+M-x dired-do-query-replace-regexp |
200 |
</pre> |
201 |
|
202 |
<p>That will split your screen and show the buffers that are open. When you want to split the screen, use control-x followed by a number.</p> |
203 |
<pre caption="Code Sample"> |
204 |
- C-x 0 <comment>This makes the current buffer go away.</comment> |
205 |
- C-x 1 <comment>This makes the current buffer take full screen.</comment> |
206 |
- C-x 2 <comment>This will initiate the split and you can browse two different parts of a file.</comment> |
207 |
- C-x 3 <comment>This is useful if you have a wide screen.</comment> |
208 |
+C-x 0 <comment>This makes the current buffer go away.</comment> |
209 |
+C-x 1 <comment>This makes the current buffer take full screen.</comment> |
210 |
+C-x 2 <comment>This will initiate the split and you can browse two different parts of a file.</comment> |
211 |
+C-x 3 <comment>This is useful if you have a wide screen.</comment> |
212 |
</pre> |
213 |
</body> |
214 |
</section> |
215 |
@@ -436,7 +436,7 @@ |
216 |
of source code. If you use Emacs with X try speedbar. |
217 |
</p> |
218 |
<pre caption="Code Sample"> |
219 |
- M-x speedbar |
220 |
+M-x speedbar |
221 |
</pre> |
222 |
|
223 |
<p> |
224 |
@@ -454,10 +454,9 @@ |
225 |
like <c>ediff</c> for file foo and ._cfg0000_foo. |
226 |
</p> |
227 |
<pre caption="Code Sample"> |
228 |
- You could run M-x find-dired with an argument like this: -name |
229 |
- \._cfg* |
230 |
- Control-x, control-f, control-a, control-k, /etc, enter. |
231 |
- M-x ediff |
232 |
+You could run M-x find-dired with an argument like this: -name \._cfg* |
233 |
+Control-x, control-f, control-a, control-k, /etc, enter. |
234 |
+M-x ediff |
235 |
</pre> |
236 |
</body> |
237 |
</section> |
238 |
@@ -468,19 +467,19 @@ |
239 |
<section> |
240 |
<body> |
241 |
<pre caption="Code Sample"> |
242 |
- $ cat ~/.emacs.d/init.el |
243 |
- (prefer-coding-system 'utf-8) |
244 |
- (setq transient-mark-mode t) |
245 |
- (show-paren-mode t) |
246 |
- (setq column-number-mode t) |
247 |
- (global-set-key [(f5)] (lambda() (interactive) (woman (current-word)))) |
248 |
- (global-set-key [(f6)] 'hippie-expand) |
249 |
- (global-set-key [(f7)] 'replace-regexp) |
250 |
- (global-set-key [(f8)] 'flush-lines) |
251 |
- (global-set-key [(f9)] 'dired-do-delete) |
252 |
- |
253 |
- # cat /root/.emacs.d/init.el |
254 |
- (load "/home/username/.emacs.d/init.el") |
255 |
+$ cat ~/.emacs.d/init.el |
256 |
+(prefer-coding-system 'utf-8) |
257 |
+(setq transient-mark-mode t) |
258 |
+(show-paren-mode t) |
259 |
+(setq column-number-mode t) |
260 |
+(global-set-key [(f5)] (lambda() (interactive) (woman (current-word)))) |
261 |
+(global-set-key [(f6)] 'hippie-expand) |
262 |
+(global-set-key [(f7)] 'replace-regexp) |
263 |
+(global-set-key [(f8)] 'flush-lines) |
264 |
+(global-set-key [(f9)] 'dired-do-delete) |
265 |
+ |
266 |
+# cat /root/.emacs.d/init.el |
267 |
+(load "/home/username/.emacs.d/init.el") |
268 |
</pre> |
269 |
</body> |
270 |
</section> |