diff options
| author | Chong Yidong | 2011-12-06 16:12:18 +0800 |
|---|---|---|
| committer | Chong Yidong | 2011-12-06 16:12:18 +0800 |
| commit | 2a185919b41986949f592ea51e17a3ac6c9afa2b (patch) | |
| tree | 576e949e1670b32102dac64e699152158054ea3e | |
| parent | 28d3917c738c44e79ca36c79f7a6d22b9a4f6fd2 (diff) | |
| download | emacs-2a185919b41986949f592ea51e17a3ac6c9afa2b.tar.gz emacs-2a185919b41986949f592ea51e17a3ac6c9afa2b.zip | |
More updates to Programs chapter of Emacs manual.
* doc/emacs/programs.texi (Man Page): Clarify how to use Man-switches.
Don't bother documenting Man-fontify-manpage-flag.
(Lisp Doc): Add xref to Name Help node.
(Hideshow): Add cindex. Mention role of ellipses, and default
value of hs-isearch-open. Don't bother documenting
hs-special-modes-alist.
(Symbol Completion): Add kindex for C-M-i. Don't recommend
changing the window manager binding of M-TAB.
| -rw-r--r-- | doc/emacs/ChangeLog | 11 | ||||
| -rw-r--r-- | doc/emacs/programs.texi | 305 |
2 files changed, 142 insertions, 174 deletions
diff --git a/doc/emacs/ChangeLog b/doc/emacs/ChangeLog index 894a5901295..20a6e8e84d7 100644 --- a/doc/emacs/ChangeLog +++ b/doc/emacs/ChangeLog | |||
| @@ -1,3 +1,14 @@ | |||
| 1 | 2011-12-06 Chong Yidong <cyd@gnu.org> | ||
| 2 | |||
| 3 | * programs.texi (Man Page): Clarify how to use Man-switches. | ||
| 4 | Don't bother documenting Man-fontify-manpage-flag. | ||
| 5 | (Lisp Doc): Add xref to Name Help node. | ||
| 6 | (Hideshow): Add cindex. Mention role of ellipses, and default | ||
| 7 | value of hs-isearch-open. Don't bother documenting | ||
| 8 | hs-special-modes-alist. | ||
| 9 | (Symbol Completion): Add kindex for C-M-i. Don't recommend | ||
| 10 | changing the window manager binding of M-TAB. | ||
| 11 | |||
| 1 | 2011-12-05 Chong Yidong <cyd@gnu.org> | 12 | 2011-12-05 Chong Yidong <cyd@gnu.org> |
| 2 | 13 | ||
| 3 | * programs.texi (Comment Commands): Fix description of for M-; on | 14 | * programs.texi (Comment Commands): Fix description of for M-; on |
diff --git a/doc/emacs/programs.texi b/doc/emacs/programs.texi index c88535a076b..8d441f342f0 100644 --- a/doc/emacs/programs.texi +++ b/doc/emacs/programs.texi | |||
| @@ -1109,7 +1109,7 @@ mode which @kbd{C-h S} does support. | |||
| 1109 | @node Man Page | 1109 | @node Man Page |
| 1110 | @subsection Man Page Lookup | 1110 | @subsection Man Page Lookup |
| 1111 | 1111 | ||
| 1112 | @cindex manual page | 1112 | @cindex man page |
| 1113 | On Unix, the main form of on-line documentation was the @dfn{manual | 1113 | On Unix, the main form of on-line documentation was the @dfn{manual |
| 1114 | page} or @dfn{man page}. In the GNU operating system, we aim to | 1114 | page} or @dfn{man page}. In the GNU operating system, we aim to |
| 1115 | replace man pages with better-organized manuals that you can browse | 1115 | replace man pages with better-organized manuals that you can browse |
| @@ -1118,71 +1118,51 @@ still useful to read manual pages. | |||
| 1118 | 1118 | ||
| 1119 | @findex manual-entry | 1119 | @findex manual-entry |
| 1120 | You can read the man page for an operating system command, library | 1120 | You can read the man page for an operating system command, library |
| 1121 | function, or system call, with the @kbd{M-x man} command. It | 1121 | function, or system call, with the @kbd{M-x man} command. This |
| 1122 | runs the @code{man} program to format the man page; if the system | 1122 | prompts for a topic, with completion (@pxref{Completion}), and runs |
| 1123 | permits, it runs @code{man} asynchronously, so that you can keep on | 1123 | the @command{man} program to format the corresponding man page. If |
| 1124 | editing while the page is being formatted. (On MS-DOS and MS-Windows | 1124 | the system permits, it runs @command{man} asynchronously, so that you |
| 1125 | 3, you cannot edit while Emacs waits for @code{man} to finish.) The | 1125 | can keep on editing while the page is being formatted. The result |
| 1126 | result goes in a buffer named @samp{*Man @var{topic}*}. These buffers | 1126 | goes in a buffer named @samp{*Man @var{topic}*}. These buffers use a |
| 1127 | use a special major mode, Man mode, that facilitates scrolling and | 1127 | special major mode, Man mode, that facilitates scrolling and jumping |
| 1128 | jumping to other manual pages. For details, type @kbd{C-h m} while in | 1128 | to other manual pages. For details, type @kbd{C-h m} while in a Man |
| 1129 | a man page buffer. | 1129 | mode buffer. |
| 1130 | 1130 | ||
| 1131 | @cindex sections of manual pages | 1131 | @cindex sections of manual pages |
| 1132 | Each man page belongs to one of ten or more @dfn{sections}, each | 1132 | Each man page belongs to one of ten or more @dfn{sections}, each |
| 1133 | named by a digit or by a digit and a letter. Sometimes there are | 1133 | named by a digit or by a digit and a letter. Sometimes there are man |
| 1134 | multiple man pages with the same name in different sections. To read | 1134 | pages with the same name in different sections. To read a man page |
| 1135 | a man page from a specific section, type | 1135 | from a specific section, type @samp{@var{topic}(@var{section})} or |
| 1136 | @samp{@var{topic}(@var{section})} or @samp{@var{section} @var{topic}} | 1136 | @samp{@var{section} @var{topic}} when @kbd{M-x manual-entry} prompts |
| 1137 | when @kbd{M-x manual-entry} prompts for the topic. For example, to | 1137 | for the topic. For example, the man page for the C library function |
| 1138 | read the man page for the C library function @code{chmod} (as opposed | 1138 | @code{chmod} is in section 2, but there is a shell command of the same |
| 1139 | to a command of the same name), type @kbd{M-x manual-entry @key{RET} | 1139 | name, whose man page is in section 1; to view the former, type |
| 1140 | chmod(2) @key{RET}}. (@code{chmod} is a system call, so it is in | 1140 | @kbd{M-x manual-entry @key{RET} chmod(2) @key{RET}}. |
| 1141 | section @samp{2}.) | ||
| 1142 | 1141 | ||
| 1143 | @vindex Man-switches | 1142 | @vindex Man-switches |
| 1144 | If you do not specify a section, the results depend on how the | 1143 | @kindex M-n @r{(Man mode)} |
| 1145 | @code{man} program works on your system. Some of them display only | 1144 | @kindex M-p @r{(Man mode)} |
| 1146 | the first man page they find. Others display all man pages that have | 1145 | If you do not specify a section, @kbd{M-x man} normally displays |
| 1147 | the specified name, so you can move between them with the @kbd{M-n} | 1146 | only the first man page found. On some systems, the @code{man} |
| 1148 | and @kbd{M-p} keys@footnote{On some systems, the @code{man} program | 1147 | program accepts a @samp{-a} command-line option, which tells it to |
| 1149 | accepts a @samp{-a} command-line option which tells it to display all | 1148 | display all the man pages for the specified topic. To make use of |
| 1150 | the man pages for the specified topic. If you want this behavior, you | 1149 | this, change the value of the variable @code{Man-switches} to |
| 1151 | can add this option to the value of the variable @code{Man-switches}.}. | 1150 | @samp{"-a"}. Then, in the Man mode buffer, you can type @kbd{M-n} and |
| 1152 | The mode line shows how many manual pages are present in the Man buffer. | 1151 | @kbd{M-p} to switch between man pages in different sections. The mode |
| 1153 | 1152 | line shows how many manual pages are available. | |
| 1154 | @vindex Man-fontify-manpage-flag | ||
| 1155 | By default, Emacs highlights the text in man pages. For a long man | ||
| 1156 | page, highlighting can take substantial time. You can turn off | ||
| 1157 | highlighting of man pages by setting the variable | ||
| 1158 | @code{Man-fontify-manpage-flag} to @code{nil}. | ||
| 1159 | |||
| 1160 | @findex Man-fontify-manpage | ||
| 1161 | If you insert the text of a man page into an Emacs buffer in some | ||
| 1162 | other fashion, you can use the command @kbd{M-x Man-fontify-manpage} to | ||
| 1163 | perform the same conversions that @kbd{M-x manual-entry} does. | ||
| 1164 | 1153 | ||
| 1165 | @findex woman | 1154 | @findex woman |
| 1166 | @cindex manual pages, on MS-DOS/MS-Windows | 1155 | @cindex manual pages, on MS-DOS/MS-Windows |
| 1167 | An alternative way of reading manual pages is the @kbd{M-x woman} | 1156 | An alternative way of reading manual pages is the @kbd{M-x woman} |
| 1168 | command@footnote{The name of the command, @code{woman}, is an acronym | 1157 | command. Unlike @kbd{M-x man}, it does not run any external programs |
| 1169 | for ``w/o (without) man,'' since it doesn't use the @code{man} | 1158 | to format and display the man pages; the formatting is done by Emacs, |
| 1170 | program.}. Unlike @kbd{M-x man}, it does not run any external | 1159 | so it works on systems such as MS-Windows where the @command{man} |
| 1171 | programs to format and display the man pages; instead it does the job | 1160 | program may be unavailable. It prompts for a man page, and displays |
| 1172 | in Emacs Lisp, so it works on systems such as MS-Windows, where the | 1161 | it in a buffer named @samp{*WoMan @var{section} @var{topic}}. |
| 1173 | @code{man} program (and other programs it uses) are not generally | 1162 | |
| 1174 | available. | 1163 | @kbd{M-x woman} computes the completion list for manpages the first |
| 1175 | 1164 | time you invoke the command. With a numeric argument, it recomputes | |
| 1176 | @kbd{M-x woman} prompts for a name of a manual page, and provides | 1165 | this list; this is useful if you add or delete manual pages. |
| 1177 | completion based on the list of manual pages that are installed on | ||
| 1178 | your machine; the list of available manual pages is computed | ||
| 1179 | automatically the first time you invoke @code{woman}. The word at | ||
| 1180 | point in the current buffer is used to suggest the default for the | ||
| 1181 | name of the manual page. | ||
| 1182 | |||
| 1183 | With a numeric argument, @kbd{M-x woman} recomputes the list of the | ||
| 1184 | manual pages used for completion. This is useful if you add or delete | ||
| 1185 | manual pages. | ||
| 1186 | 1166 | ||
| 1187 | If you type a name of a manual page and @kbd{M-x woman} finds that | 1167 | If you type a name of a manual page and @kbd{M-x woman} finds that |
| 1188 | several manual pages by the same name exist in different sections, it | 1168 | several manual pages by the same name exist in different sections, it |
| @@ -1201,42 +1181,40 @@ the WoMan Info manual, which is distributed with Emacs. | |||
| 1201 | @node Lisp Doc | 1181 | @node Lisp Doc |
| 1202 | @subsection Emacs Lisp Documentation Lookup | 1182 | @subsection Emacs Lisp Documentation Lookup |
| 1203 | 1183 | ||
| 1204 | As you edit Lisp code to be run in Emacs, you can use the commands | 1184 | When editing Emacs Lisp code, you can use the commands @kbd{C-h f} |
| 1205 | @kbd{C-h f} (@code{describe-function}) and @kbd{C-h v} | 1185 | (@code{describe-function}) and @kbd{C-h v} (@code{describe-variable}) |
| 1206 | (@code{describe-variable}) to view documentation of functions and | 1186 | to view the built-in documentation for the Lisp functions and |
| 1207 | variables that you want to use. These commands use the minibuffer to | 1187 | variables that you want to use. @xref{Name Help}. |
| 1208 | read the name of a function or variable to document, and display the | ||
| 1209 | documentation in a window. Their default arguments are based on the | ||
| 1210 | code in the neighborhood of point. For @kbd{C-h f}, the default is | ||
| 1211 | the function called in the innermost list containing point. @kbd{C-h | ||
| 1212 | v} uses the symbol name around or adjacent to point as its default. | ||
| 1213 | 1188 | ||
| 1214 | @cindex Eldoc mode | 1189 | @cindex Eldoc mode |
| 1215 | @findex eldoc-mode | 1190 | @findex eldoc-mode |
| 1216 | A more automatic but less powerful method is Eldoc mode. This minor | 1191 | Eldoc is a buffer-local minor mode that helps with looking up Lisp |
| 1217 | mode constantly displays in the echo area the argument list for the | 1192 | documention. When it is enabled, the echo area displays some useful |
| 1218 | function being called at point. (In other words, it finds the | 1193 | information whenever there is a Lisp function or variable at point; |
| 1219 | function call that point is contained in, and displays the argument | 1194 | for a function, it shows the argument list, and for a variable it |
| 1220 | list of that function.) If point is over a documented variable, it | 1195 | shows the first line of the variable's documentation string. To |
| 1221 | shows the first line of the variable's docstring. Eldoc mode applies | 1196 | toggle Eldoc mode, type @kbd{M-x eldoc-mode}. Eldoc mode can be used |
| 1222 | in Emacs Lisp and Lisp Interaction modes, and perhaps a few others | 1197 | with the Emacs Lisp and Lisp Interaction major modes. |
| 1223 | that provide special support for looking up doc strings. Use the | ||
| 1224 | command @kbd{M-x eldoc-mode} to enable or disable this feature. | ||
| 1225 | 1198 | ||
| 1226 | @node Hideshow | 1199 | @node Hideshow |
| 1227 | @section Hideshow minor mode | 1200 | @section Hideshow minor mode |
| 1201 | @cindex Hideshow mode | ||
| 1202 | @cindex mode, Hideshow | ||
| 1228 | 1203 | ||
| 1229 | @findex hs-minor-mode | 1204 | @findex hs-minor-mode |
| 1230 | Hideshow minor mode provides selective display of portions of a | 1205 | Hideshow mode is a buffer-local minor mode that allows you to |
| 1231 | program, known as @dfn{blocks}. You can use @kbd{M-x hs-minor-mode} | 1206 | selectively display portions of a program, which are referred to as |
| 1232 | to enable or disable this mode, or add @code{hs-minor-mode} to the | 1207 | @dfn{blocks}. Type @kbd{M-x hs-minor-mode} to toggle this minor mode |
| 1233 | mode hook for certain major modes in order to enable it automatically | 1208 | (@pxref{Minor Modes}). |
| 1234 | for those modes. | 1209 | |
| 1210 | When you use Hideshow mode to hide a block, the block disappears | ||
| 1211 | from the screen, to be replaced by an ellipsis (three periods in a | ||
| 1212 | row). Just what constitutes a block depends on the major mode. In C | ||
| 1213 | mode and related modes, blocks are delimited by braces, while in Lisp | ||
| 1214 | mode they are delimited by parentheses. Multi-line comments also | ||
| 1215 | count as blocks. | ||
| 1235 | 1216 | ||
| 1236 | Just what constitutes a block depends on the major mode. In C mode | 1217 | Hideshow mode provides the following commands: |
| 1237 | or C++ mode, they are delimited by braces, while in Lisp mode and | ||
| 1238 | similar modes they are delimited by parentheses. Multi-line comments | ||
| 1239 | also count as blocks. | ||
| 1240 | 1218 | ||
| 1241 | @findex hs-hide-all | 1219 | @findex hs-hide-all |
| 1242 | @findex hs-hide-block | 1220 | @findex hs-hide-block |
| @@ -1260,11 +1238,11 @@ Show the current block (@code{hs-show-block}). | |||
| 1260 | @item C-c @@ C-c | 1238 | @item C-c @@ C-c |
| 1261 | Either hide or show the current block (@code{hs-toggle-hiding}). | 1239 | Either hide or show the current block (@code{hs-toggle-hiding}). |
| 1262 | @item S-Mouse-2 | 1240 | @item S-Mouse-2 |
| 1263 | Either hide or show the block you click on (@code{hs-mouse-toggle-hiding}). | 1241 | Toggle hiding for the block you click on (@code{hs-mouse-toggle-hiding}). |
| 1264 | @item C-c @@ C-M-h | 1242 | @item C-c @@ C-M-h |
| 1265 | Hide all top-level blocks (@code{hs-hide-all}). | 1243 | Hide all top-level blocks (@code{hs-hide-all}). |
| 1266 | @item C-c @@ C-M-s | 1244 | @item C-c @@ C-M-s |
| 1267 | Show everything in the buffer (@code{hs-show-all}). | 1245 | Show all blocks in the buffer (@code{hs-show-all}). |
| 1268 | @item C-c @@ C-l | 1246 | @item C-c @@ C-l |
| 1269 | Hide all blocks @var{n} levels below this block | 1247 | Hide all blocks @var{n} levels below this block |
| 1270 | (@code{hs-hide-level}). | 1248 | (@code{hs-hide-level}). |
| @@ -1273,80 +1251,61 @@ Hide all blocks @var{n} levels below this block | |||
| 1273 | @vindex hs-hide-comments-when-hiding-all | 1251 | @vindex hs-hide-comments-when-hiding-all |
| 1274 | @vindex hs-isearch-open | 1252 | @vindex hs-isearch-open |
| 1275 | @vindex hs-special-modes-alist | 1253 | @vindex hs-special-modes-alist |
| 1276 | These variables exist for customizing Hideshow mode. | 1254 | These variables can be used to customize Hideshow mode: |
| 1277 | 1255 | ||
| 1278 | @table @code | 1256 | @table @code |
| 1279 | @item hs-hide-comments-when-hiding-all | 1257 | @item hs-hide-comments-when-hiding-all |
| 1280 | Non-@code{nil} says that @kbd{hs-hide-all} should hide comments too. | 1258 | If non-@code{nil}, @kbd{C-c @@ C-M-h} (@code{hs-hide-all}) hides |
| 1259 | comments too. | ||
| 1281 | 1260 | ||
| 1282 | @item hs-isearch-open | 1261 | @item hs-isearch-open |
| 1283 | Specifies what kind of hidden blocks incremental search should make | 1262 | This variable specifies the conditions under which incremental search |
| 1284 | visible. The value should be one of these four symbols: | 1263 | should unhide a hidden block when matching text occurs within the |
| 1285 | 1264 | block. Its value should be either @code{code} (unhide only code | |
| 1286 | @table @code | 1265 | blocks), @code{comment} (unhide only comments), @code{t} (unhide both |
| 1287 | @item code | 1266 | code blocks and comments), or @code{nil} (unhide neither code blocks |
| 1288 | Open only code blocks. | 1267 | nor comments). The default value is @code{code}. |
| 1289 | @item comment | ||
| 1290 | Open only comments. | ||
| 1291 | @item t | ||
| 1292 | Open both code blocks and comments. | ||
| 1293 | @item nil | ||
| 1294 | Open neither code blocks nor comments. | ||
| 1295 | @end table | ||
| 1296 | |||
| 1297 | @item hs-special-modes-alist | ||
| 1298 | A list of elements, each specifying how to initialize Hideshow | ||
| 1299 | variables for one major mode. See the variable's documentation string | ||
| 1300 | for more information. | ||
| 1301 | @end table | 1268 | @end table |
| 1302 | 1269 | ||
| 1303 | @node Symbol Completion | 1270 | @node Symbol Completion |
| 1304 | @section Completion for Symbol Names | 1271 | @section Completion for Symbol Names |
| 1305 | @cindex completion (symbol names) | 1272 | @cindex completion (symbol names) |
| 1306 | 1273 | ||
| 1307 | In Emacs, completion is something you normally do in the minibuffer | 1274 | Completion is normally done in the minibuffer (@pxref{Completion}), |
| 1308 | (@pxref{Completion}). But one kind of completion is available in all | 1275 | but you can also complete symbol names in ordinary Emacs buffers. |
| 1309 | buffers: completion for symbol names. | ||
| 1310 | 1276 | ||
| 1311 | @kindex M-TAB | 1277 | @kindex M-TAB |
| 1312 | The character @kbd{M-@key{TAB}} runs a command to complete the | 1278 | @kindex C-M-i |
| 1313 | partial symbol before point against the set of meaningful symbol | 1279 | In programming language modes, type @kbd{C-M-i} or @kbd{M-@key{TAB}} |
| 1314 | names. This command inserts at point any additional characters that | 1280 | to complete the partial symbol before point. On graphical displays, |
| 1315 | it can determine from the partial name. | 1281 | the @kbd{M-@key{TAB}} key is usually reserved by the window manager |
| 1316 | 1282 | for switching graphical windows, so you should type @kbd{C-M-i} or | |
| 1317 | If your window manager defines @kbd{M-@key{TAB}} to switch windows, | 1283 | @kbd{@key{ESC} @key{TAB}} instead. |
| 1318 | you can type @kbd{@key{ESC} @key{TAB}} or @kbd{C-M-i} instead. | ||
| 1319 | However, most window managers let you customize these shortcuts, so | ||
| 1320 | you can change any that interfere with the way you use Emacs. | ||
| 1321 | |||
| 1322 | If the partial name in the buffer has multiple possible completions | ||
| 1323 | that differ in the very next character, so that it is impossible to | ||
| 1324 | complete even one more character, @kbd{M-@key{TAB}} displays a list of | ||
| 1325 | all possible completions in another window. | ||
| 1326 | 1284 | ||
| 1327 | @cindex tags-based completion | 1285 | @cindex tags-based completion |
| 1328 | @cindex Info index completion | 1286 | @cindex Info index completion |
| 1329 | @findex complete-symbol | 1287 | @findex complete-symbol |
| 1330 | In most programming language major modes, @kbd{M-@key{TAB}} runs the | 1288 | In-buffer symbol completion generates its completion list in a |
| 1331 | command @code{complete-symbol}, which provides two kinds of completion. | 1289 | number of different ways. In most programming language modes, |
| 1332 | Normally it does completion based on a tags table (@pxref{Tags}); with a | 1290 | completion is normally done using a tags table (@pxref{Tags}). |
| 1333 | numeric argument (regardless of the value), it does completion based on | 1291 | However, if you supply @kbd{C-M-i} or @kbd{M-@key{TAB}} with a numeric |
| 1334 | the names listed in the Info file indexes for your language. Thus, to | 1292 | argument, it completes using the Info file indexes for the current |
| 1335 | complete the name of a symbol defined in your own program, use | 1293 | language (e.g.@: the C Library Manual). Of course, Info-based |
| 1336 | @kbd{M-@key{TAB}} with no argument; to complete the name of a standard | 1294 | completion works only if there is an Info file for the standard |
| 1337 | library function, use @kbd{C-u M-@key{TAB}}. Of course, Info-based | 1295 | library functions of your language, and only if it is installed at |
| 1338 | completion works only if there is an Info file for the standard library | 1296 | your site. |
| 1339 | functions of your language, and only if it is installed at your site. | ||
| 1340 | 1297 | ||
| 1341 | @cindex Lisp symbol completion | 1298 | @cindex Lisp symbol completion |
| 1342 | @cindex completion (Lisp symbols) | 1299 | @cindex completion (Lisp symbols) |
| 1343 | @findex lisp-complete-symbol | 1300 | In Emacs Lisp mode, completion is performed using the function, |
| 1344 | In Emacs-Lisp mode, the name space for completion normally consists of | 1301 | variable, and property names defined in the current Emacs session. If |
| 1345 | nontrivial symbols present in Emacs---those that have function | 1302 | there is an open parenthesis immediately before the beginning of the |
| 1346 | definitions, values or properties. However, if there is an | 1303 | partial symbol, only symbols with function definitions are considered. |
| 1347 | open-parenthesis immediately before the beginning of the partial symbol, | 1304 | |
| 1348 | only symbols with function definitions are considered as completions. | 1305 | In all other respects, in-buffer symbol completion behaves like |
| 1349 | The command which implements this is @code{lisp-complete-symbol}. | 1306 | minibuffer completion. For instance, if Emacs cannot complete to a |
| 1307 | unique symbol, it displays a list of completion alternatives in | ||
| 1308 | another window. @xref{Completion}. | ||
| 1350 | 1309 | ||
| 1351 | In Text mode and related modes, @kbd{M-@key{TAB}} completes words | 1310 | In Text mode and related modes, @kbd{M-@key{TAB}} completes words |
| 1352 | based on the spell-checker's dictionary. @xref{Spelling}. | 1311 | based on the spell-checker's dictionary. @xref{Spelling}. |
| @@ -1354,20 +1313,20 @@ based on the spell-checker's dictionary. @xref{Spelling}. | |||
| 1354 | @node Glasses | 1313 | @node Glasses |
| 1355 | @section Glasses minor mode | 1314 | @section Glasses minor mode |
| 1356 | @cindex Glasses mode | 1315 | @cindex Glasses mode |
| 1357 | @cindex identifiers, making long ones readable | 1316 | @cindex camel case |
| 1358 | @cindex StudlyCaps, making them readable | 1317 | @findex mode, Glasses |
| 1359 | @findex glasses-mode | 1318 | |
| 1360 | 1319 | Glasses mode is a buffer-local minor mode that makes it easier to | |
| 1361 | Glasses minor mode makes @samp{unreadableIdentifiersLikeThis} | 1320 | read mixed-case (or ``CamelCase'') symbols like |
| 1362 | readable by altering the way they display. It knows two different | 1321 | @samp{unReadableSymbol}, by altering how they are displayed. By |
| 1363 | ways to do this: by displaying underscores between a lower-case letter | 1322 | default, it displays extra underscores between each lower-case letter |
| 1364 | and the following capital letter, and by emboldening the capital | 1323 | and the following capital letter. This does not alter the buffer |
| 1365 | letters. It does not alter the buffer text, only the way they | 1324 | text, only how it is displayed. |
| 1366 | display, so you can use it even on read-only buffers. You can use the | 1325 | |
| 1367 | command @kbd{M-x glasses-mode} to enable or disable the mode in the | 1326 | To toggle Glasses mode, type @kbd{M-x glasses-mode} (@pxref{Minor |
| 1368 | current buffer; you can also add @code{glasses-mode} to the mode hook | 1327 | Modes}). When Glasses mode is enabled, the minor mode indicator |
| 1369 | of the programming language major modes in which you normally want | 1328 | @samp{o^o} appears in the mode line. For more information about |
| 1370 | to use Glasses mode. | 1329 | Glasses mode, type @kbd{C-h P glasses @key{RET}}. |
| 1371 | 1330 | ||
| 1372 | @node Semantic | 1331 | @node Semantic |
| 1373 | @section Semantic | 1332 | @section Semantic |
| @@ -1383,8 +1342,8 @@ see @ref{Top, Semantic,, semantic, Semantic}. | |||
| 1383 | see the Semantic Info manual, which is distributed with Emacs. | 1342 | see the Semantic Info manual, which is distributed with Emacs. |
| 1384 | @end iftex | 1343 | @end iftex |
| 1385 | 1344 | ||
| 1386 | Most of the ``language aware'' features in Emacs, such as font lock | 1345 | Most of the ``language aware'' features in Emacs, such as Font Lock |
| 1387 | (@pxref{Font Lock}), rely on ``rules of thumb''@footnote{Regular | 1346 | mode (@pxref{Font Lock}), rely on ``rules of thumb''@footnote{Regular |
| 1388 | expressions and syntax tables.} that usually give good results but are | 1347 | expressions and syntax tables.} that usually give good results but are |
| 1389 | never completely exact. In contrast, the parsers used by Semantic | 1348 | never completely exact. In contrast, the parsers used by Semantic |
| 1390 | have an exact understanding of programming language syntax. This | 1349 | have an exact understanding of programming language syntax. This |
| @@ -1438,27 +1397,25 @@ is idle. | |||
| 1438 | @node Misc for Programs | 1397 | @node Misc for Programs |
| 1439 | @section Other Features Useful for Editing Programs | 1398 | @section Other Features Useful for Editing Programs |
| 1440 | 1399 | ||
| 1441 | A number of Emacs commands that aren't designed specifically for | 1400 | Some Emacs commands that aren't designed specifically for editing |
| 1442 | editing programs are useful for that nonetheless. | 1401 | programs are useful for that nonetheless. |
| 1443 | 1402 | ||
| 1444 | The Emacs commands that operate on words, sentences and paragraphs | 1403 | The Emacs commands that operate on words, sentences and paragraphs |
| 1445 | are useful for editing code. Most symbols names contain words | 1404 | are useful for editing code. Most symbols names contain words |
| 1446 | (@pxref{Words}); sentences can be found in strings and comments | 1405 | (@pxref{Words}), while sentences can be found in strings and comments |
| 1447 | (@pxref{Sentences}). Paragraphs in the strict sense can be found in | 1406 | (@pxref{Sentences}). As for paragraphs, they are defined in most |
| 1448 | program code (in long comments), but the paragraph commands are useful | 1407 | programming language modes to begin and end at blank lines |
| 1449 | in other places too, because programming language major modes define | 1408 | (@pxref{Paragraphs}). Therefore, judicious use of blank lines to make |
| 1450 | paragraphs to begin and end at blank lines (@pxref{Paragraphs}). | 1409 | the program clearer will also provide useful chunks of text for the |
| 1451 | Judicious use of blank lines to make the program clearer will also | 1410 | paragraph commands to work on. Auto Fill mode, if enabled in a |
| 1452 | provide useful chunks of text for the paragraph commands to work on. | 1411 | programming language major mode, indents the new lines which it |
| 1453 | Auto Fill mode, if enabled in a programming language major mode, | 1412 | creates. |
| 1454 | indents the new lines which it creates. | 1413 | |
| 1455 | 1414 | Apart from Hideshow mode (@pxref{Hideshow}), another way to | |
| 1456 | The selective display feature is useful for looking at the overall | 1415 | selectively display parts of a program is to use the selective display |
| 1457 | structure of a function (@pxref{Selective Display}). This feature | 1416 | feature (@pxref{Selective Display}). Programming modes often also |
| 1458 | hides the lines that are indented more than a specified amount. | 1417 | support Outline minor mode (@pxref{Outline Mode}), which can be used |
| 1459 | Programming modes often support Outline minor mode (@pxref{Outline | 1418 | with the Foldout package (@pxref{Foldout}). |
| 1460 | Mode}). The Foldout package provides folding-editor features | ||
| 1461 | (@pxref{Foldout}). | ||
| 1462 | 1419 | ||
| 1463 | @ifinfo | 1420 | @ifinfo |
| 1464 | The ``automatic typing'' features may be useful for writing programs. | 1421 | The ``automatic typing'' features may be useful for writing programs. |