1 |
Author: fauli |
2 |
Date: 2009-07-02 08:43:43 +0000 (Thu, 02 Jul 2009) |
3 |
New Revision: 1284 |
4 |
|
5 |
Modified: |
6 |
emacsguide/emacsguide.xml |
7 |
Log: |
8 |
Add another chapter with sections collected |
9 |
|
10 |
|
11 |
Modified: emacsguide/emacsguide.xml |
12 |
=================================================================== |
13 |
--- emacsguide/emacsguide.xml 2009-07-02 08:28:30 UTC (rev 1283) |
14 |
+++ emacsguide/emacsguide.xml 2009-07-02 08:43:43 UTC (rev 1284) |
15 |
@@ -251,6 +251,8 @@ |
16 |
</chapter> |
17 |
|
18 |
<chapter> |
19 |
+ <title>Useful functions in GNU Emacs</title> |
20 |
+ <section> |
21 |
<title>Dired</title> |
22 |
<body> |
23 |
<p>Lets start by looking at some files.</p> |
24 |
@@ -267,7 +269,20 @@ |
25 |
<pre caption="Code Sample"> |
26 |
Control-x, control-b |
27 |
</pre> |
28 |
+ |
29 |
+ <p>Now you may wish to do replacements in many files.</p> |
30 |
+ <pre caption="Code Sample"> |
31 |
+ <p>M-x dired<TAB><TAB></p> |
32 |
+ <p>M-x command-apropos <comment>This can show any dired command.</comment></p> |
33 |
+ </pre> |
34 |
|
35 |
+ <p>Now you see what is available. Here is one strategy.</p> |
36 |
+ <pre caption="Code Sample"> |
37 |
+ <p>M-x find-grep-dired</p> |
38 |
+ <p>%-m c$ <comment>This will mark C sources or filenames ending in c.</comment></p> |
39 |
+ <p>M-x dired-do-query-replace-regexp</p> |
40 |
+ </pre> |
41 |
+ |
42 |
<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> |
43 |
<pre caption="Code Sample"> |
44 |
C-x 0 <comment>This makes the current buffer go away.</comment> |
45 |
@@ -276,6 +291,43 @@ |
46 |
C-x 3 <comment>This is useful if you have a wide screen.</comment> |
47 |
</pre> |
48 |
</body> |
49 |
+ </section> |
50 |
+ <section> |
51 |
+ <title>Speedbar for Debugging and Navigation</title> |
52 |
+ <body> |
53 |
+ <p> |
54 |
+ If you're coding C, and you use <c>gcc -g</c> for debugging |
55 |
+ symbols, Emacs can split your screen and follow the current line |
56 |
+ of source code. If you use Emacs with X try speedbar. |
57 |
+ </p> |
58 |
+ <pre caption="Code Sample"> |
59 |
+ M-x speedbar |
60 |
+ </pre> |
61 |
+ |
62 |
+ <p> |
63 |
+ Now watch variables change just like any other development |
64 |
+ environment. You could also browse directories in speedbar or do |
65 |
+ other things by right-clicking. |
66 |
+ </p> |
67 |
+ </body> |
68 |
+ </section> |
69 |
+ <section> |
70 |
+ <title>Ediff</title> |
71 |
+ <body> |
72 |
+ <p> |
73 |
+ Since Gentoo respects your /etc/ configuration files, you may |
74 |
+ like <c>ediff</c> for file foo and ._cfg0000_foo. |
75 |
+ </p> |
76 |
+ <pre caption="Code Sample"> |
77 |
+ <p> |
78 |
+ You could run M-x find-dired with an argument like this: -name |
79 |
+ \._cfg* |
80 |
+ </p> |
81 |
+ <p>Control-x, control-f, control-a, control-k, /etc, enter.</p> |
82 |
+ <p>M-x ediff</p> |
83 |
+ </pre> |
84 |
+ </body> |
85 |
+ </section> |
86 |
</chapter> |
87 |
|
88 |
<chapter> |
89 |
@@ -309,26 +361,6 @@ |
90 |
</chapter> |
91 |
|
92 |
<chapter> |
93 |
- <title>Speedbar for Debugging and Navigation</title> |
94 |
- <body> |
95 |
- <p> |
96 |
- If you're coding C, and you use <c>gcc -g</c> for debugging |
97 |
- symbols, Emacs can split your screen and follow the current line |
98 |
- of source code. If you use Emacs with X try speedbar. |
99 |
- </p> |
100 |
- <pre caption="Code Sample"> |
101 |
- M-x speedbar |
102 |
- </pre> |
103 |
- |
104 |
- <p> |
105 |
- Now watch variables change just like any other development |
106 |
- environment. You could also browse directories in speedbar or do |
107 |
- other things by right-clicking. |
108 |
- </p> |
109 |
- </body> |
110 |
- </chapter> |
111 |
- |
112 |
- <chapter> |
113 |
<title>Complete Text</title> |
114 |
<body> |
115 |
<p>Now is where some completion becomes useful. There is M-/ to complete a string and also some elisp that does much more.</p> |
116 |
@@ -400,22 +432,6 @@ |
117 |
</chapter> |
118 |
|
119 |
<chapter> |
120 |
- <title>More Dired</title> |
121 |
- <p>Now you may wish to do replacements in many files.</p> |
122 |
- <pre caption="Code Sample"> |
123 |
- <p>M-x dired<TAB><TAB></p> |
124 |
- <p>M-x command-apropos <comment>This can show any dired command.</comment></p> |
125 |
- </pre> |
126 |
- |
127 |
- <p>Now you see what is available. Here is one strategy.</p> |
128 |
- <pre caption="Code Sample"> |
129 |
- <p>M-x find-grep-dired</p> |
130 |
- <p>%-m c$ <comment>This will mark C sources or filenames ending in c.</comment></p> |
131 |
- <p>M-x dired-do-query-replace-regexp</p> |
132 |
- </pre> |
133 |
- </chapter> |
134 |
- |
135 |
- <chapter> |
136 |
<title>Remove Comments</title> |
137 |
<p> |
138 |
One common thing for Gentoo users is to strip comments from |
139 |
@@ -429,22 +445,8 @@ |
140 |
</chapter> |
141 |
|
142 |
<chapter> |
143 |
- <title>Ediff</title> |
144 |
- <p> |
145 |
- Since Gentoo respects your /etc/ configuration files, you may |
146 |
- like <c>ediff</c> for file foo and ._cfg0000_foo. |
147 |
- </p> |
148 |
- <pre caption="Code Sample"> |
149 |
- <p> |
150 |
- You could run M-x find-dired with an argument like this: -name |
151 |
- \._cfg* |
152 |
- </p> |
153 |
- <p>Control-x, control-f, control-a, control-k, /etc, enter.</p> |
154 |
- <p>M-x ediff</p> |
155 |
- </pre> |
156 |
</chapter> |
157 |
|
158 |
- |
159 |
<chapter> |
160 |
<title>Macros</title> |
161 |
<p> |