diff options
| author | Chong Yidong | 2006-03-16 03:19:56 +0000 |
|---|---|---|
| committer | Chong Yidong | 2006-03-16 03:19:56 +0000 |
| commit | e0fc8fa2dd2e0a42c55027addc5c78090b5deac7 (patch) | |
| tree | 788c12dd7408e6c94354959932fc147ae43d7b42 | |
| parent | dc5c3489f44f5bd0a17ee3deef9363387f5b4de5 (diff) | |
| download | emacs-e0fc8fa2dd2e0a42c55027addc5c78090b5deac7.tar.gz emacs-e0fc8fa2dd2e0a42c55027addc5c78090b5deac7.zip | |
* emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
moved here from Emacs manual.
* programs.texi (Fortran): Section moved to emacs-xtra.
(Program Modes): Xref to Fortran in emacs-xtra.
* maintaining.texi (Emerge): Moved to emacs-xtra.
* files.texi (Comparing Files): Xref to Emerge in emacs-xtra.
* picture.texi: File deleted.
* text.texi (Text): Xref to Picture Mode in emacs-xtra.
* abbrevs.texi (Abbrevs):
* sending.texi (Sending Mail): Picture node removed.
* emacs.texi (Top): Update node listings.
| -rw-r--r-- | man/ChangeLog | 18 | ||||
| -rw-r--r-- | man/abbrevs.texi | 2 | ||||
| -rw-r--r-- | man/emacs-xtra.texi | 1182 | ||||
| -rw-r--r-- | man/emacs.texi | 37 | ||||
| -rw-r--r-- | man/files.texi | 4 | ||||
| -rw-r--r-- | man/maintaining.texi | 388 | ||||
| -rw-r--r-- | man/programs.texi | 519 | ||||
| -rw-r--r-- | man/sending.texi | 2 | ||||
| -rw-r--r-- | man/text.texi | 6 |
9 files changed, 1212 insertions, 946 deletions
diff --git a/man/ChangeLog b/man/ChangeLog index 99c84283f8e..7301e501d30 100644 --- a/man/ChangeLog +++ b/man/ChangeLog | |||
| @@ -1,3 +1,21 @@ | |||
| 1 | 2006-03-15 Chong Yidong <cyd@stupidchicken.com> | ||
| 2 | |||
| 3 | * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters, | ||
| 4 | moved here from Emacs manual. | ||
| 5 | |||
| 6 | * programs.texi (Fortran): Section moved to emacs-xtra. | ||
| 7 | (Program Modes): Xref to Fortran in emacs-xtra. | ||
| 8 | |||
| 9 | * maintaining.texi (Emerge): Moved to emacs-xtra. | ||
| 10 | * files.texi (Comparing Files): Xref to Emerge in emacs-xtra. | ||
| 11 | |||
| 12 | * picture.texi: File deleted. | ||
| 13 | * text.texi (Text): Xref to Picture Mode in emacs-xtra. | ||
| 14 | * abbrevs.texi (Abbrevs): | ||
| 15 | * sending.texi (Sending Mail): Picture node removed. | ||
| 16 | |||
| 17 | * emacs.texi (Top): Update node listings. | ||
| 18 | |||
| 1 | 2006-03-15 Carsten Dominik <dominik@science.uva.nl> | 19 | 2006-03-15 Carsten Dominik <dominik@science.uva.nl> |
| 2 | 20 | ||
| 3 | * org.texi: Version number change only. | 21 | * org.texi: Version number change only. |
diff --git a/man/abbrevs.texi b/man/abbrevs.texi index 683da2204c1..14b6bdbb9f2 100644 --- a/man/abbrevs.texi +++ b/man/abbrevs.texi | |||
| @@ -2,7 +2,7 @@ | |||
| 2 | @c Copyright (C) 1985, 1986, 1987, 1993, 1994, 1995, 1997, 2002, 2003, | 2 | @c Copyright (C) 1985, 1986, 1987, 1993, 1994, 1995, 1997, 2002, 2003, |
| 3 | @c 2004, 2005, 2006 Free Software Foundation, Inc. | 3 | @c 2004, 2005, 2006 Free Software Foundation, Inc. |
| 4 | @c See file emacs.texi for copying conditions. | 4 | @c See file emacs.texi for copying conditions. |
| 5 | @node Abbrevs, Picture, Maintaining, Top | 5 | @node Abbrevs, Sending Mail, Maintaining, Top |
| 6 | @chapter Abbrevs | 6 | @chapter Abbrevs |
| 7 | @cindex abbrevs | 7 | @cindex abbrevs |
| 8 | @cindex expansion (of abbrevs) | 8 | @cindex expansion (of abbrevs) |
diff --git a/man/emacs-xtra.texi b/man/emacs-xtra.texi index a352bc913c2..9b3a76f5430 100644 --- a/man/emacs-xtra.texi +++ b/man/emacs-xtra.texi | |||
| @@ -59,6 +59,10 @@ license to the document, as described in section 6 of the license. | |||
| 59 | * Autorevert:: Auto Reverting non-file buffers. | 59 | * Autorevert:: Auto Reverting non-file buffers. |
| 60 | * Subdir switches:: Subdirectory switches in Dired. | 60 | * Subdir switches:: Subdirectory switches in Dired. |
| 61 | * Advanced Calendar/Diary Usage:: Advanced Calendar/Diary customization. | 61 | * Advanced Calendar/Diary Usage:: Advanced Calendar/Diary customization. |
| 62 | * Emerge:: A convenient way of merging two versions of a program. | ||
| 63 | * Picture Mode:: Editing pictures made up of characters | ||
| 64 | using the quarter-plane screen model. | ||
| 65 | * Fortran:: Fortran mode and its special features. | ||
| 62 | * Index:: | 66 | * Index:: |
| 63 | @end menu | 67 | @end menu |
| 64 | 68 | ||
| @@ -1222,6 +1226,1184 @@ the European style, the order of the parameters is changed to @var{day}, | |||
| 1222 | If one of these functions decides that it applies to a certain date, | 1226 | If one of these functions decides that it applies to a certain date, |
| 1223 | it returns a value that contains @var{mark}. | 1227 | it returns a value that contains @var{mark}. |
| 1224 | 1228 | ||
| 1229 | @node Emerge | ||
| 1230 | @chapter Merging Files with Emerge | ||
| 1231 | @cindex Emerge | ||
| 1232 | @cindex merging files | ||
| 1233 | |||
| 1234 | It's not unusual for programmers to get their signals crossed and | ||
| 1235 | modify the same program in two different directions. To recover from | ||
| 1236 | this confusion, you need to merge the two versions. Emerge makes this | ||
| 1237 | easier. For other ways to compare files, see @ref{Comparing Files,,, | ||
| 1238 | emacs, the Emacs Manual} and @ref{Top, Ediff,, ediff, The Ediff | ||
| 1239 | Manual}. | ||
| 1240 | |||
| 1241 | @menu | ||
| 1242 | * Overview of Emerge:: How to start Emerge. Basic concepts. | ||
| 1243 | * Submodes of Emerge:: Fast mode vs. Edit mode. | ||
| 1244 | Skip Prefers mode and Auto Advance mode. | ||
| 1245 | * State of Difference:: You do the merge by specifying state A or B | ||
| 1246 | for each difference. | ||
| 1247 | * Merge Commands:: Commands for selecting a difference, | ||
| 1248 | changing states of differences, etc. | ||
| 1249 | * Exiting Emerge:: What to do when you've finished the merge. | ||
| 1250 | * Combining in Emerge:: How to keep both alternatives for a difference. | ||
| 1251 | * Fine Points of Emerge:: Misc. | ||
| 1252 | @end menu | ||
| 1253 | |||
| 1254 | @node Overview of Emerge | ||
| 1255 | @section Overview of Emerge | ||
| 1256 | |||
| 1257 | To start Emerge, run one of these four commands: | ||
| 1258 | |||
| 1259 | @table @kbd | ||
| 1260 | @item M-x emerge-files | ||
| 1261 | @findex emerge-files | ||
| 1262 | Merge two specified files. | ||
| 1263 | |||
| 1264 | @item M-x emerge-files-with-ancestor | ||
| 1265 | @findex emerge-files-with-ancestor | ||
| 1266 | Merge two specified files, with reference to a common ancestor. | ||
| 1267 | |||
| 1268 | @item M-x emerge-buffers | ||
| 1269 | @findex emerge-buffers | ||
| 1270 | Merge two buffers. | ||
| 1271 | |||
| 1272 | @item M-x emerge-buffers-with-ancestor | ||
| 1273 | @findex emerge-buffers-with-ancestor | ||
| 1274 | Merge two buffers with reference to a common ancestor in a third | ||
| 1275 | buffer. | ||
| 1276 | @end table | ||
| 1277 | |||
| 1278 | @cindex merge buffer (Emerge) | ||
| 1279 | @cindex A and B buffers (Emerge) | ||
| 1280 | The Emerge commands compare two files or buffers, and display the | ||
| 1281 | comparison in three buffers: one for each input text (the @dfn{A buffer} | ||
| 1282 | and the @dfn{B buffer}), and one (the @dfn{merge buffer}) where merging | ||
| 1283 | takes place. The merge buffer shows the full merged text, not just the | ||
| 1284 | differences. Wherever the two input texts differ, you can choose which | ||
| 1285 | one of them to include in the merge buffer. | ||
| 1286 | |||
| 1287 | The Emerge commands that take input from existing buffers use only | ||
| 1288 | the accessible portions of those buffers, if they are narrowed. | ||
| 1289 | @xref{Narrowing,,, emacs, the Emacs Manual}. | ||
| 1290 | |||
| 1291 | |||
| 1292 | If a common ancestor version is available, from which the two texts to | ||
| 1293 | be merged were both derived, Emerge can use it to guess which | ||
| 1294 | alternative is right. Wherever one current version agrees with the | ||
| 1295 | ancestor, Emerge presumes that the other current version is a deliberate | ||
| 1296 | change which should be kept in the merged version. Use the | ||
| 1297 | @samp{with-ancestor} commands if you want to specify a common ancestor | ||
| 1298 | text. These commands read three file or buffer names---variant A, | ||
| 1299 | variant B, and the common ancestor. | ||
| 1300 | |||
| 1301 | After the comparison is done and the buffers are prepared, the | ||
| 1302 | interactive merging starts. You control the merging by typing special | ||
| 1303 | @dfn{merge commands} in the merge buffer (@pxref{Merge Commands}). | ||
| 1304 | For each run of differences between the input texts, you can choose | ||
| 1305 | which one of them to keep, or edit them both together. | ||
| 1306 | |||
| 1307 | The merge buffer uses a special major mode, Emerge mode, with commands | ||
| 1308 | for making these choices. But you can also edit the buffer with | ||
| 1309 | ordinary Emacs commands. | ||
| 1310 | |||
| 1311 | At any given time, the attention of Emerge is focused on one | ||
| 1312 | particular difference, called the @dfn{selected} difference. This | ||
| 1313 | difference is marked off in the three buffers like this: | ||
| 1314 | |||
| 1315 | @example | ||
| 1316 | vvvvvvvvvvvvvvvvvvvv | ||
| 1317 | @var{text that differs} | ||
| 1318 | ^^^^^^^^^^^^^^^^^^^^ | ||
| 1319 | @end example | ||
| 1320 | |||
| 1321 | @noindent | ||
| 1322 | Emerge numbers all the differences sequentially and the mode | ||
| 1323 | line always shows the number of the selected difference. | ||
| 1324 | |||
| 1325 | Normally, the merge buffer starts out with the A version of the text. | ||
| 1326 | But when the A version of a difference agrees with the common ancestor, | ||
| 1327 | then the B version is initially preferred for that difference. | ||
| 1328 | |||
| 1329 | Emerge leaves the merged text in the merge buffer when you exit. At | ||
| 1330 | that point, you can save it in a file with @kbd{C-x C-w}. If you give a | ||
| 1331 | numeric argument to @code{emerge-files} or | ||
| 1332 | @code{emerge-files-with-ancestor}, it reads the name of the output file | ||
| 1333 | using the minibuffer. (This is the last file name those commands read.) | ||
| 1334 | Then exiting from Emerge saves the merged text in the output file. | ||
| 1335 | |||
| 1336 | Normally, Emerge commands save the output buffer in its file when you | ||
| 1337 | exit. If you abort Emerge with @kbd{C-]}, the Emerge command does not | ||
| 1338 | save the output buffer, but you can save it yourself if you wish. | ||
| 1339 | |||
| 1340 | @node Submodes of Emerge | ||
| 1341 | @section Submodes of Emerge | ||
| 1342 | |||
| 1343 | You can choose between two modes for giving merge commands: Fast mode | ||
| 1344 | and Edit mode. In Fast mode, basic merge commands are single | ||
| 1345 | characters, but ordinary Emacs commands are disabled. This is | ||
| 1346 | convenient if you use only merge commands. In Edit mode, all merge | ||
| 1347 | commands start with the prefix key @kbd{C-c C-c}, and the normal Emacs | ||
| 1348 | commands are also available. This allows editing the merge buffer, but | ||
| 1349 | slows down Emerge operations. | ||
| 1350 | |||
| 1351 | Use @kbd{e} to switch to Edit mode, and @kbd{C-c C-c f} to switch to | ||
| 1352 | Fast mode. The mode line indicates Edit and Fast modes with @samp{E} | ||
| 1353 | and @samp{F}. | ||
| 1354 | |||
| 1355 | Emerge has two additional submodes that affect how particular merge | ||
| 1356 | commands work: Auto Advance mode and Skip Prefers mode. | ||
| 1357 | |||
| 1358 | If Auto Advance mode is in effect, the @kbd{a} and @kbd{b} commands | ||
| 1359 | advance to the next difference. This lets you go through the merge | ||
| 1360 | faster as long as you simply choose one of the alternatives from the | ||
| 1361 | input. The mode line indicates Auto Advance mode with @samp{A}. | ||
| 1362 | |||
| 1363 | If Skip Prefers mode is in effect, the @kbd{n} and @kbd{p} commands | ||
| 1364 | skip over differences in states prefer-A and prefer-B (@pxref{State of | ||
| 1365 | Difference}). Thus you see only differences for which neither version | ||
| 1366 | is presumed ``correct.'' The mode line indicates Skip Prefers mode with | ||
| 1367 | @samp{S}. | ||
| 1368 | |||
| 1369 | @findex emerge-auto-advance-mode | ||
| 1370 | @findex emerge-skip-prefers-mode | ||
| 1371 | Use the command @kbd{s a} (@code{emerge-auto-advance-mode}) to set or | ||
| 1372 | clear Auto Advance mode. Use @kbd{s s} | ||
| 1373 | (@code{emerge-skip-prefers-mode}) to set or clear Skip Prefers mode. | ||
| 1374 | These commands turn on the mode with a positive argument, turns it off | ||
| 1375 | with a negative or zero argument, and toggle the mode with no argument. | ||
| 1376 | |||
| 1377 | @node State of Difference | ||
| 1378 | @section State of a Difference | ||
| 1379 | |||
| 1380 | In the merge buffer, a difference is marked with lines of @samp{v} and | ||
| 1381 | @samp{^} characters. Each difference has one of these seven states: | ||
| 1382 | |||
| 1383 | @table @asis | ||
| 1384 | @item A | ||
| 1385 | The difference is showing the A version. The @kbd{a} command always | ||
| 1386 | produces this state; the mode line indicates it with @samp{A}. | ||
| 1387 | |||
| 1388 | @item B | ||
| 1389 | The difference is showing the B version. The @kbd{b} command always | ||
| 1390 | produces this state; the mode line indicates it with @samp{B}. | ||
| 1391 | |||
| 1392 | @item default-A | ||
| 1393 | @itemx default-B | ||
| 1394 | The difference is showing the A or the B state by default, because you | ||
| 1395 | haven't made a choice. All differences start in the default-A state | ||
| 1396 | (and thus the merge buffer is a copy of the A buffer), except those for | ||
| 1397 | which one alternative is ``preferred'' (see below). | ||
| 1398 | |||
| 1399 | When you select a difference, its state changes from default-A or | ||
| 1400 | default-B to plain A or B. Thus, the selected difference never has | ||
| 1401 | state default-A or default-B, and these states are never displayed in | ||
| 1402 | the mode line. | ||
| 1403 | |||
| 1404 | The command @kbd{d a} chooses default-A as the default state, and @kbd{d | ||
| 1405 | b} chooses default-B. This chosen default applies to all differences | ||
| 1406 | which you haven't ever selected and for which no alternative is preferred. | ||
| 1407 | If you are moving through the merge sequentially, the differences you | ||
| 1408 | haven't selected are those following the selected one. Thus, while | ||
| 1409 | moving sequentially, you can effectively make the A version the default | ||
| 1410 | for some sections of the merge buffer and the B version the default for | ||
| 1411 | others by using @kbd{d a} and @kbd{d b} between sections. | ||
| 1412 | |||
| 1413 | @item prefer-A | ||
| 1414 | @itemx prefer-B | ||
| 1415 | The difference is showing the A or B state because it is | ||
| 1416 | @dfn{preferred}. This means that you haven't made an explicit choice, | ||
| 1417 | but one alternative seems likely to be right because the other | ||
| 1418 | alternative agrees with the common ancestor. Thus, where the A buffer | ||
| 1419 | agrees with the common ancestor, the B version is preferred, because | ||
| 1420 | chances are it is the one that was actually changed. | ||
| 1421 | |||
| 1422 | These two states are displayed in the mode line as @samp{A*} and @samp{B*}. | ||
| 1423 | |||
| 1424 | @item combined | ||
| 1425 | The difference is showing a combination of the A and B states, as a | ||
| 1426 | result of the @kbd{x c} or @kbd{x C} commands. | ||
| 1427 | |||
| 1428 | Once a difference is in this state, the @kbd{a} and @kbd{b} commands | ||
| 1429 | don't do anything to it unless you give them a numeric argument. | ||
| 1430 | |||
| 1431 | The mode line displays this state as @samp{comb}. | ||
| 1432 | @end table | ||
| 1433 | |||
| 1434 | @node Merge Commands | ||
| 1435 | @section Merge Commands | ||
| 1436 | |||
| 1437 | Here are the Merge commands for Fast mode; in Edit mode, precede them | ||
| 1438 | with @kbd{C-c C-c}: | ||
| 1439 | |||
| 1440 | @table @kbd | ||
| 1441 | @item p | ||
| 1442 | Select the previous difference. | ||
| 1443 | |||
| 1444 | @item n | ||
| 1445 | Select the next difference. | ||
| 1446 | |||
| 1447 | @item a | ||
| 1448 | Choose the A version of this difference. | ||
| 1449 | |||
| 1450 | @item b | ||
| 1451 | Choose the B version of this difference. | ||
| 1452 | |||
| 1453 | @item C-u @var{n} j | ||
| 1454 | Select difference number @var{n}. | ||
| 1455 | |||
| 1456 | @item . | ||
| 1457 | Select the difference containing point. You can use this command in the | ||
| 1458 | merge buffer or in the A or B buffer. | ||
| 1459 | |||
| 1460 | @item q | ||
| 1461 | Quit---finish the merge. | ||
| 1462 | |||
| 1463 | @item C-] | ||
| 1464 | Abort---exit merging and do not save the output. | ||
| 1465 | |||
| 1466 | @item f | ||
| 1467 | Go into Fast mode. (In Edit mode, this is actually @kbd{C-c C-c f}.) | ||
| 1468 | |||
| 1469 | @item e | ||
| 1470 | Go into Edit mode. | ||
| 1471 | |||
| 1472 | @item l | ||
| 1473 | Recenter (like @kbd{C-l}) all three windows. | ||
| 1474 | |||
| 1475 | @item - | ||
| 1476 | Specify part of a prefix numeric argument. | ||
| 1477 | |||
| 1478 | @item @var{digit} | ||
| 1479 | Also specify part of a prefix numeric argument. | ||
| 1480 | |||
| 1481 | @item d a | ||
| 1482 | Choose the A version as the default from here down in | ||
| 1483 | the merge buffer. | ||
| 1484 | |||
| 1485 | @item d b | ||
| 1486 | Choose the B version as the default from here down in | ||
| 1487 | the merge buffer. | ||
| 1488 | |||
| 1489 | @item c a | ||
| 1490 | Copy the A version of this difference into the kill ring. | ||
| 1491 | |||
| 1492 | @item c b | ||
| 1493 | Copy the B version of this difference into the kill ring. | ||
| 1494 | |||
| 1495 | @item i a | ||
| 1496 | Insert the A version of this difference at point. | ||
| 1497 | |||
| 1498 | @item i b | ||
| 1499 | Insert the B version of this difference at point. | ||
| 1500 | |||
| 1501 | @item m | ||
| 1502 | Put point and mark around the difference. | ||
| 1503 | |||
| 1504 | @item ^ | ||
| 1505 | Scroll all three windows down (like @kbd{M-v}). | ||
| 1506 | |||
| 1507 | @item v | ||
| 1508 | Scroll all three windows up (like @kbd{C-v}). | ||
| 1509 | |||
| 1510 | @item < | ||
| 1511 | Scroll all three windows left (like @kbd{C-x <}). | ||
| 1512 | |||
| 1513 | @item > | ||
| 1514 | Scroll all three windows right (like @kbd{C-x >}). | ||
| 1515 | |||
| 1516 | @item | | ||
| 1517 | Reset horizontal scroll on all three windows. | ||
| 1518 | |||
| 1519 | @item x 1 | ||
| 1520 | Shrink the merge window to one line. (Use @kbd{C-u l} to restore it | ||
| 1521 | to full size.) | ||
| 1522 | |||
| 1523 | @item x c | ||
| 1524 | Combine the two versions of this difference (@pxref{Combining in | ||
| 1525 | Emerge}). | ||
| 1526 | |||
| 1527 | @item x f | ||
| 1528 | Show the names of the files/buffers Emerge is operating on, in a Help | ||
| 1529 | window. (Use @kbd{C-u l} to restore windows.) | ||
| 1530 | |||
| 1531 | @item x j | ||
| 1532 | Join this difference with the following one. | ||
| 1533 | (@kbd{C-u x j} joins this difference with the previous one.) | ||
| 1534 | |||
| 1535 | @item x s | ||
| 1536 | Split this difference into two differences. Before you use this | ||
| 1537 | command, position point in each of the three buffers at the place where | ||
| 1538 | you want to split the difference. | ||
| 1539 | |||
| 1540 | @item x t | ||
| 1541 | Trim identical lines off the top and bottom of the difference. | ||
| 1542 | Such lines occur when the A and B versions are | ||
| 1543 | identical but differ from the ancestor version. | ||
| 1544 | @end table | ||
| 1545 | |||
| 1546 | @node Exiting Emerge | ||
| 1547 | @section Exiting Emerge | ||
| 1548 | |||
| 1549 | The @kbd{q} command (@code{emerge-quit}) finishes the merge, storing | ||
| 1550 | the results into the output file if you specified one. It restores the | ||
| 1551 | A and B buffers to their proper contents, or kills them if they were | ||
| 1552 | created by Emerge and you haven't changed them. It also disables the | ||
| 1553 | Emerge commands in the merge buffer, since executing them later could | ||
| 1554 | damage the contents of the various buffers. | ||
| 1555 | |||
| 1556 | @kbd{C-]} aborts the merge. This means exiting without writing the | ||
| 1557 | output file. If you didn't specify an output file, then there is no | ||
| 1558 | real difference between aborting and finishing the merge. | ||
| 1559 | |||
| 1560 | If the Emerge command was called from another Lisp program, then its | ||
| 1561 | return value is @code{t} for successful completion, or @code{nil} if you | ||
| 1562 | abort. | ||
| 1563 | |||
| 1564 | @node Combining in Emerge | ||
| 1565 | @section Combining the Two Versions | ||
| 1566 | |||
| 1567 | Sometimes you want to keep @emph{both} alternatives for a particular | ||
| 1568 | difference. To do this, use @kbd{x c}, which edits the merge buffer | ||
| 1569 | like this: | ||
| 1570 | |||
| 1571 | @example | ||
| 1572 | @group | ||
| 1573 | #ifdef NEW | ||
| 1574 | @var{version from A buffer} | ||
| 1575 | #else /* not NEW */ | ||
| 1576 | @var{version from B buffer} | ||
| 1577 | #endif /* not NEW */ | ||
| 1578 | @end group | ||
| 1579 | @end example | ||
| 1580 | |||
| 1581 | @noindent | ||
| 1582 | @vindex emerge-combine-versions-template | ||
| 1583 | While this example shows C preprocessor conditionals delimiting the two | ||
| 1584 | alternative versions, you can specify the strings to use by setting | ||
| 1585 | the variable @code{emerge-combine-versions-template} to a string of your | ||
| 1586 | choice. In the string, @samp{%a} says where to put version A, and | ||
| 1587 | @samp{%b} says where to put version B. The default setting, which | ||
| 1588 | produces the results shown above, looks like this: | ||
| 1589 | |||
| 1590 | @example | ||
| 1591 | @group | ||
| 1592 | "#ifdef NEW\n%a#else /* not NEW */\n%b#endif /* not NEW */\n" | ||
| 1593 | @end group | ||
| 1594 | @end example | ||
| 1595 | |||
| 1596 | @node Fine Points of Emerge | ||
| 1597 | @section Fine Points of Emerge | ||
| 1598 | |||
| 1599 | During the merge, you mustn't try to edit the A and B buffers yourself. | ||
| 1600 | Emerge modifies them temporarily, but ultimately puts them back the way | ||
| 1601 | they were. | ||
| 1602 | |||
| 1603 | You can have any number of merges going at once---just don't use any one | ||
| 1604 | buffer as input to more than one merge at once, since the temporary | ||
| 1605 | changes made in these buffers would get in each other's way. | ||
| 1606 | |||
| 1607 | Starting Emerge can take a long time because it needs to compare the | ||
| 1608 | files fully. Emacs can't do anything else until @code{diff} finishes. | ||
| 1609 | Perhaps in the future someone will change Emerge to do the comparison in | ||
| 1610 | the background when the input files are large---then you could keep on | ||
| 1611 | doing other things with Emacs until Emerge is ready to accept | ||
| 1612 | commands. | ||
| 1613 | |||
| 1614 | @vindex emerge-startup-hook | ||
| 1615 | After setting up the merge, Emerge runs the hook | ||
| 1616 | @code{emerge-startup-hook}. @xref{Hooks,,, emacs, the Emacs Manual}. | ||
| 1617 | |||
| 1618 | @node Picture Mode | ||
| 1619 | @chapter Editing Pictures | ||
| 1620 | @cindex pictures | ||
| 1621 | @cindex making pictures out of text characters | ||
| 1622 | @findex edit-picture | ||
| 1623 | |||
| 1624 | To edit a picture made out of text characters (for example, a picture | ||
| 1625 | of the division of a register into fields, as a comment in a program), | ||
| 1626 | use the command @kbd{M-x edit-picture} to enter Picture mode. | ||
| 1627 | |||
| 1628 | In Picture mode, editing is based on the @dfn{quarter-plane} model of | ||
| 1629 | text, according to which the text characters lie studded on an area that | ||
| 1630 | stretches infinitely far to the right and downward. The concept of the end | ||
| 1631 | of a line does not exist in this model; the most you can say is where the | ||
| 1632 | last nonblank character on the line is found. | ||
| 1633 | |||
| 1634 | Of course, Emacs really always considers text as a sequence of | ||
| 1635 | characters, and lines really do have ends. But Picture mode replaces | ||
| 1636 | the most frequently-used commands with variants that simulate the | ||
| 1637 | quarter-plane model of text. They do this by inserting spaces or by | ||
| 1638 | converting tabs to spaces. | ||
| 1639 | |||
| 1640 | Most of the basic editing commands of Emacs are redefined by Picture mode | ||
| 1641 | to do essentially the same thing but in a quarter-plane way. In addition, | ||
| 1642 | Picture mode defines various keys starting with the @kbd{C-c} prefix to | ||
| 1643 | run special picture editing commands. | ||
| 1644 | |||
| 1645 | One of these keys, @kbd{C-c C-c}, is particularly important. Often a | ||
| 1646 | picture is part of a larger file that is usually edited in some other | ||
| 1647 | major mode. @kbd{M-x edit-picture} records the name of the previous | ||
| 1648 | major mode so you can use the @kbd{C-c C-c} command | ||
| 1649 | (@code{picture-mode-exit}) later to go back to that mode. @kbd{C-c C-c} | ||
| 1650 | also deletes spaces from the ends of lines, unless given a numeric | ||
| 1651 | argument. | ||
| 1652 | |||
| 1653 | The special commands of Picture mode all work in other modes (provided | ||
| 1654 | the @file{picture} library is loaded), but are not bound to keys except | ||
| 1655 | in Picture mode. The descriptions below talk of moving ``one column'' | ||
| 1656 | and so on, but all the picture mode commands handle numeric arguments as | ||
| 1657 | their normal equivalents do. | ||
| 1658 | |||
| 1659 | @vindex picture-mode-hook | ||
| 1660 | Turning on Picture mode runs the hook @code{picture-mode-hook}. | ||
| 1661 | Additional extensions to Picture mode can be found in | ||
| 1662 | @file{artist.el}. | ||
| 1663 | |||
| 1664 | @menu | ||
| 1665 | * Basic Picture:: Basic concepts and simple commands of Picture Mode. | ||
| 1666 | * Insert in Picture:: Controlling direction of cursor motion | ||
| 1667 | after "self-inserting" characters. | ||
| 1668 | * Tabs in Picture:: Various features for tab stops and indentation. | ||
| 1669 | * Rectangles in Picture:: Clearing and superimposing rectangles. | ||
| 1670 | @end menu | ||
| 1671 | |||
| 1672 | @node Basic Picture | ||
| 1673 | @section Basic Editing in Picture Mode | ||
| 1674 | |||
| 1675 | @findex picture-forward-column | ||
| 1676 | @findex picture-backward-column | ||
| 1677 | @findex picture-move-down | ||
| 1678 | @findex picture-move-up | ||
| 1679 | @cindex editing in Picture mode | ||
| 1680 | |||
| 1681 | Most keys do the same thing in Picture mode that they usually do, but | ||
| 1682 | do it in a quarter-plane style. For example, @kbd{C-f} is rebound to | ||
| 1683 | run @code{picture-forward-column}, a command which moves point one | ||
| 1684 | column to the right, inserting a space if necessary so that the actual | ||
| 1685 | end of the line makes no difference. @kbd{C-b} is rebound to run | ||
| 1686 | @code{picture-backward-column}, which always moves point left one | ||
| 1687 | column, converting a tab to multiple spaces if necessary. @kbd{C-n} and | ||
| 1688 | @kbd{C-p} are rebound to run @code{picture-move-down} and | ||
| 1689 | @code{picture-move-up}, which can either insert spaces or convert tabs | ||
| 1690 | as necessary to make sure that point stays in exactly the same column. | ||
| 1691 | @kbd{C-e} runs @code{picture-end-of-line}, which moves to after the last | ||
| 1692 | nonblank character on the line. There is no need to change @kbd{C-a}, | ||
| 1693 | as the choice of screen model does not affect beginnings of | ||
| 1694 | lines. | ||
| 1695 | |||
| 1696 | @findex picture-newline | ||
| 1697 | Insertion of text is adapted to the quarter-plane screen model | ||
| 1698 | through the use of Overwrite mode (@pxref{Minor Modes,,, emacs, the | ||
| 1699 | Emacs Manual}.) Self-inserting characters replace existing text, | ||
| 1700 | column by column, rather than pushing existing text to the right. | ||
| 1701 | @key{RET} runs @code{picture-newline}, which just moves to the | ||
| 1702 | beginning of the following line so that new text will replace that | ||
| 1703 | line. | ||
| 1704 | |||
| 1705 | @findex picture-backward-clear-column | ||
| 1706 | @findex picture-clear-column | ||
| 1707 | @findex picture-clear-line | ||
| 1708 | In Picture mode, the commands that normally delete or kill text, | ||
| 1709 | instead erase text (replacing it with spaces). @key{DEL} | ||
| 1710 | (@code{picture-backward-clear-column}) replaces the preceding | ||
| 1711 | character with a space rather than removing it; this moves point | ||
| 1712 | backwards. @kbd{C-d} (@code{picture-clear-column}) replaces the next | ||
| 1713 | character or characters with spaces, but does not move point. (If you | ||
| 1714 | want to clear characters to spaces and move forward over them, use | ||
| 1715 | @key{SPC}.) @kbd{C-k} (@code{picture-clear-line}) really kills the | ||
| 1716 | contents of lines, but does not delete the newlines from the buffer. | ||
| 1717 | |||
| 1718 | @findex picture-open-line | ||
| 1719 | To do actual insertion, you must use special commands. @kbd{C-o} | ||
| 1720 | (@code{picture-open-line}) creates a blank line after the current | ||
| 1721 | line; it never splits a line. @kbd{C-M-o} (@code{split-line}) makes | ||
| 1722 | sense in Picture mode, so it is not changed. @kbd{C-j} | ||
| 1723 | (@code{picture-duplicate-line}) inserts another line with the same | ||
| 1724 | contents below the current line. | ||
| 1725 | |||
| 1726 | @kindex C-c C-d @r{(Picture mode)} | ||
| 1727 | To do actual deletion in Picture mode, use @kbd{C-w}, @kbd{C-c C-d} | ||
| 1728 | (which is defined as @code{delete-char}, as @kbd{C-d} is in other | ||
| 1729 | modes), or one of the picture rectangle commands (@pxref{Rectangles in | ||
| 1730 | Picture}). | ||
| 1731 | |||
| 1732 | @node Insert in Picture | ||
| 1733 | @section Controlling Motion after Insert | ||
| 1734 | |||
| 1735 | @findex picture-movement-up | ||
| 1736 | @findex picture-movement-down | ||
| 1737 | @findex picture-movement-left | ||
| 1738 | @findex picture-movement-right | ||
| 1739 | @findex picture-movement-nw | ||
| 1740 | @findex picture-movement-ne | ||
| 1741 | @findex picture-movement-sw | ||
| 1742 | @findex picture-movement-se | ||
| 1743 | @kindex C-c < @r{(Picture mode)} | ||
| 1744 | @kindex C-c > @r{(Picture mode)} | ||
| 1745 | @kindex C-c ^ @r{(Picture mode)} | ||
| 1746 | @kindex C-c . @r{(Picture mode)} | ||
| 1747 | @kindex C-c ` @r{(Picture mode)} | ||
| 1748 | @kindex C-c ' @r{(Picture mode)} | ||
| 1749 | @kindex C-c / @r{(Picture mode)} | ||
| 1750 | @kindex C-c \ @r{(Picture mode)} | ||
| 1751 | Since ``self-inserting'' characters in Picture mode overwrite and move | ||
| 1752 | point, there is no essential restriction on how point should be moved. | ||
| 1753 | Normally point moves right, but you can specify any of the eight | ||
| 1754 | orthogonal or diagonal directions for motion after a ``self-inserting'' | ||
| 1755 | character. This is useful for drawing lines in the buffer. | ||
| 1756 | |||
| 1757 | @table @kbd | ||
| 1758 | @item C-c < | ||
| 1759 | @itemx C-c @key{LEFT} | ||
| 1760 | Move left after insertion (@code{picture-movement-left}). | ||
| 1761 | @item C-c > | ||
| 1762 | @itemx C-c @key{RIGHT} | ||
| 1763 | Move right after insertion (@code{picture-movement-right}). | ||
| 1764 | @item C-c ^ | ||
| 1765 | @itemx C-c @key{UP} | ||
| 1766 | Move up after insertion (@code{picture-movement-up}). | ||
| 1767 | @item C-c . | ||
| 1768 | @itemx C-c @key{DOWN} | ||
| 1769 | Move down after insertion (@code{picture-movement-down}). | ||
| 1770 | @item C-c ` | ||
| 1771 | @itemx C-c @key{HOME} | ||
| 1772 | Move up and left (``northwest'') after insertion (@code{picture-movement-nw}). | ||
| 1773 | @item C-c ' | ||
| 1774 | @itemx C-c @key{PAGEUP} | ||
| 1775 | Move up and right (``northeast'') after insertion | ||
| 1776 | (@code{picture-movement-ne}). | ||
| 1777 | @item C-c / | ||
| 1778 | @itemx C-c @key{END} | ||
| 1779 | Move down and left (``southwest'') after insertion | ||
| 1780 | @*(@code{picture-movement-sw}). | ||
| 1781 | @item C-c \ | ||
| 1782 | @itemx C-c @key{PAGEDOWN} | ||
| 1783 | Move down and right (``southeast'') after insertion | ||
| 1784 | @*(@code{picture-movement-se}). | ||
| 1785 | @end table | ||
| 1786 | |||
| 1787 | @kindex C-c C-f @r{(Picture mode)} | ||
| 1788 | @kindex C-c C-b @r{(Picture mode)} | ||
| 1789 | @findex picture-motion | ||
| 1790 | @findex picture-motion-reverse | ||
| 1791 | Two motion commands move based on the current Picture insertion | ||
| 1792 | direction. The command @kbd{C-c C-f} (@code{picture-motion}) moves in the | ||
| 1793 | same direction as motion after ``insertion'' currently does, while @kbd{C-c | ||
| 1794 | C-b} (@code{picture-motion-reverse}) moves in the opposite direction. | ||
| 1795 | |||
| 1796 | @node Tabs in Picture | ||
| 1797 | @section Picture Mode Tabs | ||
| 1798 | |||
| 1799 | @kindex M-TAB @r{(Picture mode)} | ||
| 1800 | @findex picture-tab-search | ||
| 1801 | @vindex picture-tab-chars | ||
| 1802 | Two kinds of tab-like action are provided in Picture mode. Use | ||
| 1803 | @kbd{M-@key{TAB}} (@code{picture-tab-search}) for context-based tabbing. | ||
| 1804 | With no argument, it moves to a point underneath the next | ||
| 1805 | ``interesting'' character that follows whitespace in the previous | ||
| 1806 | nonblank line. ``Next'' here means ``appearing at a horizontal position | ||
| 1807 | greater than the one point starts out at.'' With an argument, as in | ||
| 1808 | @kbd{C-u M-@key{TAB}}, this command moves to the next such interesting | ||
| 1809 | character in the current line. @kbd{M-@key{TAB}} does not change the | ||
| 1810 | text; it only moves point. ``Interesting'' characters are defined by | ||
| 1811 | the variable @code{picture-tab-chars}, which should define a set of | ||
| 1812 | characters. The syntax for this variable is like the syntax used inside | ||
| 1813 | of @samp{[@dots{}]} in a regular expression---but without the @samp{[} | ||
| 1814 | and the @samp{]}. Its default value is @code{"!-~"}. | ||
| 1815 | |||
| 1816 | @findex picture-tab | ||
| 1817 | @key{TAB} itself runs @code{picture-tab}, which operates based on the | ||
| 1818 | current tab stop settings; it is the Picture mode equivalent of | ||
| 1819 | @code{tab-to-tab-stop}. Normally it just moves point, but with a numeric | ||
| 1820 | argument it clears the text that it moves over. | ||
| 1821 | |||
| 1822 | @kindex C-c TAB @r{(Picture mode)} | ||
| 1823 | @findex picture-set-tab-stops | ||
| 1824 | The context-based and tab-stop-based forms of tabbing are brought | ||
| 1825 | together by the command @kbd{C-c @key{TAB}} (@code{picture-set-tab-stops}). | ||
| 1826 | This command sets the tab stops to the positions which @kbd{M-@key{TAB}} | ||
| 1827 | would consider significant in the current line. The use of this command, | ||
| 1828 | together with @key{TAB}, can get the effect of context-based tabbing. But | ||
| 1829 | @kbd{M-@key{TAB}} is more convenient in the cases where it is sufficient. | ||
| 1830 | |||
| 1831 | It may be convenient to prevent use of actual tab characters in | ||
| 1832 | pictures. For example, this prevents @kbd{C-x @key{TAB}} from messing | ||
| 1833 | up the picture. You can do this by setting the variable | ||
| 1834 | @code{indent-tabs-mode} to @code{nil}. | ||
| 1835 | |||
| 1836 | @node Rectangles in Picture | ||
| 1837 | @section Picture Mode Rectangle Commands | ||
| 1838 | @cindex rectangles and Picture mode | ||
| 1839 | @cindex Picture mode and rectangles | ||
| 1840 | |||
| 1841 | Picture mode defines commands for working on rectangular pieces of | ||
| 1842 | the text in ways that fit with the quarter-plane model. The standard | ||
| 1843 | rectangle commands may also be useful. @xref{Rectangles,,, emacs, the | ||
| 1844 | Emacs Manual}. | ||
| 1845 | |||
| 1846 | @table @kbd | ||
| 1847 | @item C-c C-k | ||
| 1848 | Clear out the region-rectangle with spaces | ||
| 1849 | (@code{picture-clear-rectangle}). With argument, delete the text. | ||
| 1850 | @item C-c C-w @var{r} | ||
| 1851 | Similar, but save rectangle contents in register @var{r} first | ||
| 1852 | (@code{picture-clear-rectangle-to-register}). | ||
| 1853 | @item C-c C-y | ||
| 1854 | Copy last killed rectangle into the buffer by overwriting, with upper | ||
| 1855 | left corner at point (@code{picture-yank-rectangle}). With argument, | ||
| 1856 | insert instead. | ||
| 1857 | @item C-c C-x @var{r} | ||
| 1858 | Similar, but use the rectangle in register @var{r} | ||
| 1859 | (@code{picture-yank-rectangle-from-register}). | ||
| 1860 | @end table | ||
| 1861 | |||
| 1862 | @kindex C-c C-k @r{(Picture mode)} | ||
| 1863 | @kindex C-c C-w @r{(Picture mode)} | ||
| 1864 | @findex picture-clear-rectangle | ||
| 1865 | @findex picture-clear-rectangle-to-register | ||
| 1866 | The picture rectangle commands @kbd{C-c C-k} | ||
| 1867 | (@code{picture-clear-rectangle}) and @kbd{C-c C-w} | ||
| 1868 | (@code{picture-clear-rectangle-to-register}) differ from the standard | ||
| 1869 | rectangle commands in that they normally clear the rectangle instead of | ||
| 1870 | deleting it; this is analogous with the way @kbd{C-d} is changed in Picture | ||
| 1871 | mode. | ||
| 1872 | |||
| 1873 | However, deletion of rectangles can be useful in Picture mode, so | ||
| 1874 | these commands delete the rectangle if given a numeric argument. | ||
| 1875 | @kbd{C-c C-k} either with or without a numeric argument saves the | ||
| 1876 | rectangle for @kbd{C-c C-y}. | ||
| 1877 | |||
| 1878 | @kindex C-c C-y @r{(Picture mode)} | ||
| 1879 | @kindex C-c C-x @r{(Picture mode)} | ||
| 1880 | @findex picture-yank-rectangle | ||
| 1881 | @findex picture-yank-rectangle-from-register | ||
| 1882 | The Picture mode commands for yanking rectangles differ from the | ||
| 1883 | standard ones in that they overwrite instead of inserting. This is | ||
| 1884 | the same way that Picture mode insertion of other text differs from | ||
| 1885 | other modes. @kbd{C-c C-y} (@code{picture-yank-rectangle}) inserts | ||
| 1886 | (by overwriting) the rectangle that was most recently killed, while | ||
| 1887 | @kbd{C-c C-x} (@code{picture-yank-rectangle-from-register}) does | ||
| 1888 | likewise for the rectangle found in a specified register. | ||
| 1889 | |||
| 1890 | @node Fortran | ||
| 1891 | @chapter Fortran Mode | ||
| 1892 | @cindex Fortran mode | ||
| 1893 | @cindex mode, Fortran | ||
| 1894 | |||
| 1895 | Fortran mode provides special motion commands for Fortran statements | ||
| 1896 | and subprograms, and indentation commands that understand Fortran | ||
| 1897 | conventions of nesting, line numbers and continuation statements. | ||
| 1898 | Fortran mode has support for Auto Fill mode that breaks long lines into | ||
| 1899 | proper Fortran continuation lines. | ||
| 1900 | |||
| 1901 | Special commands for comments are provided because Fortran comments | ||
| 1902 | are unlike those of other languages. Built-in abbrevs optionally save | ||
| 1903 | typing when you insert Fortran keywords. | ||
| 1904 | |||
| 1905 | Use @kbd{M-x fortran-mode} to switch to this major mode. This | ||
| 1906 | command runs the hook @code{fortran-mode-hook}. @xref{Hooks,,, emacs, | ||
| 1907 | the Emacs Manual}. | ||
| 1908 | |||
| 1909 | @cindex Fortran77 and Fortran90 | ||
| 1910 | @findex f90-mode | ||
| 1911 | @findex fortran-mode | ||
| 1912 | Fortran mode is meant for editing Fortran77 ``fixed format'' (and also | ||
| 1913 | ``tab format'') source code. For editing the modern Fortran90 or | ||
| 1914 | Fortran95 ``free format'' source code, use F90 mode (@code{f90-mode}). | ||
| 1915 | Emacs normally uses Fortran mode for files with extension @samp{.f}, | ||
| 1916 | @samp{.F} or @samp{.for}, and F90 mode for the extension @samp{.f90} and | ||
| 1917 | @samp{.f95}. GNU Fortran supports both kinds of format. | ||
| 1918 | |||
| 1919 | @menu | ||
| 1920 | * Motion: Fortran Motion. Moving point by statements or subprograms. | ||
| 1921 | * Indent: Fortran Indent. Indentation commands for Fortran. | ||
| 1922 | * Comments: Fortran Comments. Inserting and aligning comments. | ||
| 1923 | * Autofill: Fortran Autofill. Auto fill support for Fortran. | ||
| 1924 | * Columns: Fortran Columns. Measuring columns for valid Fortran. | ||
| 1925 | * Abbrev: Fortran Abbrev. Built-in abbrevs for Fortran keywords. | ||
| 1926 | @end menu | ||
| 1927 | |||
| 1928 | @node Fortran Motion | ||
| 1929 | @section Motion Commands | ||
| 1930 | |||
| 1931 | In addition to the normal commands for moving by and operating on | ||
| 1932 | ``defuns'' (Fortran subprograms---functions and subroutines, as well as | ||
| 1933 | modules for F90 mode), Fortran mode provides special commands to move by | ||
| 1934 | statements and other program units. | ||
| 1935 | |||
| 1936 | @table @kbd | ||
| 1937 | @kindex C-c C-n @r{(Fortran mode)} | ||
| 1938 | @findex fortran-next-statement | ||
| 1939 | @findex f90-next-statement | ||
| 1940 | @item C-c C-n | ||
| 1941 | Move to the beginning of the next statement | ||
| 1942 | (@code{fortran-next-statement}/@code{f90-next-statement}). | ||
| 1943 | |||
| 1944 | @kindex C-c C-p @r{(Fortran mode)} | ||
| 1945 | @findex fortran-previous-statement | ||
| 1946 | @findex f90-previous-statement | ||
| 1947 | @item C-c C-p | ||
| 1948 | Move to the beginning of the previous statement | ||
| 1949 | (@code{fortran-previous-statement}/@code{f90-previous-statement}). | ||
| 1950 | If there is no previous statement (i.e. if called from the first | ||
| 1951 | statement in the buffer), move to the start of the buffer. | ||
| 1952 | |||
| 1953 | @kindex C-c C-e @r{(F90 mode)} | ||
| 1954 | @findex f90-next-block | ||
| 1955 | @item C-c C-e | ||
| 1956 | Move point forward to the start of the next code block | ||
| 1957 | (@code{f90-next-block}). A code block is a subroutine, | ||
| 1958 | @code{if}--@code{endif} statement, and so forth. This command exists | ||
| 1959 | for F90 mode only, not Fortran mode. With a numeric argument, this | ||
| 1960 | moves forward that many blocks. | ||
| 1961 | |||
| 1962 | @kindex C-c C-a @r{(F90 mode)} | ||
| 1963 | @findex f90-previous-block | ||
| 1964 | @item C-c C-a | ||
| 1965 | Move point backward to the previous code block | ||
| 1966 | (@code{f90-previous-block}). This is like @code{f90-next-block}, but | ||
| 1967 | moves backwards. | ||
| 1968 | |||
| 1969 | @kindex C-M-n @r{(Fortran mode)} | ||
| 1970 | @findex fortran-end-of-block | ||
| 1971 | @findex f90-end-of-block | ||
| 1972 | @item C-M-n | ||
| 1973 | Move to the end of the current code block | ||
| 1974 | (@code{fortran-end-of-block}/@code{f90-end-of-block}). With a numeric | ||
| 1975 | agument, move forward that number of blocks. The mark is set before | ||
| 1976 | moving point. The F90 mode version of this command checks for | ||
| 1977 | consistency of block types and labels (if present), but it does not | ||
| 1978 | check the outermost block since that may be incomplete. | ||
| 1979 | |||
| 1980 | @kindex C-M-p @r{(Fortran mode)} | ||
| 1981 | @findex fortran-beginning-of-block | ||
| 1982 | @findex f90-beginning-of-block | ||
| 1983 | @item C-M-p | ||
| 1984 | Move to the start of the current code block | ||
| 1985 | (@code{fortran-beginning-of-block}/@code{f90-beginning-of-block}). This | ||
| 1986 | is like @code{fortran-end-of-block}, but moves backwards. | ||
| 1987 | @end table | ||
| 1988 | |||
| 1989 | @node Fortran Indent | ||
| 1990 | @section Fortran Indentation | ||
| 1991 | |||
| 1992 | Special commands and features are needed for indenting Fortran code in | ||
| 1993 | order to make sure various syntactic entities (line numbers, comment line | ||
| 1994 | indicators and continuation line flags) appear in the columns that are | ||
| 1995 | required for standard, fixed (or tab) format Fortran. | ||
| 1996 | |||
| 1997 | @menu | ||
| 1998 | * Commands: ForIndent Commands. Commands for indenting and filling Fortran. | ||
| 1999 | * Contline: ForIndent Cont. How continuation lines indent. | ||
| 2000 | * Numbers: ForIndent Num. How line numbers auto-indent. | ||
| 2001 | * Conv: ForIndent Conv. Conventions you must obey to avoid trouble. | ||
| 2002 | * Vars: ForIndent Vars. Variables controlling Fortran indent style. | ||
| 2003 | @end menu | ||
| 2004 | |||
| 2005 | @node ForIndent Commands | ||
| 2006 | @subsection Fortran Indentation and Filling Commands | ||
| 2007 | |||
| 2008 | @table @kbd | ||
| 2009 | @item C-M-j | ||
| 2010 | Break the current line at point and set up a continuation line | ||
| 2011 | (@code{fortran-split-line}). | ||
| 2012 | @item M-^ | ||
| 2013 | Join this line to the previous line (@code{fortran-join-line}). | ||
| 2014 | @item C-M-q | ||
| 2015 | Indent all the lines of the subprogram point is in | ||
| 2016 | (@code{fortran-indent-subprogram}). | ||
| 2017 | @item M-q | ||
| 2018 | Fill a comment block or statement. | ||
| 2019 | @end table | ||
| 2020 | |||
| 2021 | @kindex C-M-q @r{(Fortran mode)} | ||
| 2022 | @findex fortran-indent-subprogram | ||
| 2023 | The key @kbd{C-M-q} runs @code{fortran-indent-subprogram}, a command | ||
| 2024 | to reindent all the lines of the Fortran subprogram (function or | ||
| 2025 | subroutine) containing point. | ||
| 2026 | |||
| 2027 | @kindex C-M-j @r{(Fortran mode)} | ||
| 2028 | @findex fortran-split-line | ||
| 2029 | The key @kbd{C-M-j} runs @code{fortran-split-line}, which splits | ||
| 2030 | a line in the appropriate fashion for Fortran. In a non-comment line, | ||
| 2031 | the second half becomes a continuation line and is indented | ||
| 2032 | accordingly. In a comment line, both halves become separate comment | ||
| 2033 | lines. | ||
| 2034 | |||
| 2035 | @kindex M-^ @r{(Fortran mode)} | ||
| 2036 | @kindex C-c C-d @r{(Fortran mode)} | ||
| 2037 | @findex fortran-join-line | ||
| 2038 | @kbd{M-^} or @kbd{C-c C-d} runs the command @code{fortran-join-line}, | ||
| 2039 | which joins a continuation line back to the previous line, roughly as | ||
| 2040 | the inverse of @code{fortran-split-line}. The point must be on a | ||
| 2041 | continuation line when this command is invoked. | ||
| 2042 | |||
| 2043 | @kindex M-q @r{(Fortran mode)} | ||
| 2044 | @kbd{M-q} in Fortran mode fills the comment block or statement that | ||
| 2045 | point is in. This removes any excess statement continuations. | ||
| 2046 | |||
| 2047 | @node ForIndent Cont | ||
| 2048 | @subsection Continuation Lines | ||
| 2049 | @cindex Fortran continuation lines | ||
| 2050 | |||
| 2051 | @vindex fortran-continuation-string | ||
| 2052 | Most Fortran77 compilers allow two ways of writing continuation lines. | ||
| 2053 | If the first non-space character on a line is in column 5, then that | ||
| 2054 | line is a continuation of the previous line. We call this @dfn{fixed | ||
| 2055 | format}. (In GNU Emacs we always count columns from 0; but note that | ||
| 2056 | the Fortran standard counts from 1.) The variable | ||
| 2057 | @code{fortran-continuation-string} specifies what character to put in | ||
| 2058 | column 5. A line that starts with a tab character followed by any digit | ||
| 2059 | except @samp{0} is also a continuation line. We call this style of | ||
| 2060 | continuation @dfn{tab format}. (Fortran90 introduced ``free format'', | ||
| 2061 | with another style of continuation lines). | ||
| 2062 | |||
| 2063 | @vindex indent-tabs-mode @r{(Fortran mode)} | ||
| 2064 | @vindex fortran-analyze-depth | ||
| 2065 | @vindex fortran-tab-mode-default | ||
| 2066 | Fortran mode can use either style of continuation line. When you | ||
| 2067 | enter Fortran mode, it tries to deduce the proper continuation style | ||
| 2068 | automatically from the buffer contents. It does this by scanning up to | ||
| 2069 | @code{fortran-analyze-depth} (default 100) lines from the start of the | ||
| 2070 | buffer. The first line that begins with either a tab character or six | ||
| 2071 | spaces determines the choice. If the scan fails (for example, if the | ||
| 2072 | buffer is new and therefore empty), the value of | ||
| 2073 | @code{fortran-tab-mode-default} (@code{nil} for fixed format, and | ||
| 2074 | non-@code{nil} for tab format) is used. @samp{/t} in the mode line | ||
| 2075 | indicates tab format is selected. Fortran mode sets the value of | ||
| 2076 | @code{indent-tabs-mode} accordingly. | ||
| 2077 | |||
| 2078 | If the text on a line starts with the Fortran continuation marker | ||
| 2079 | @samp{$}, or if it begins with any non-whitespace character in column | ||
| 2080 | 5, Fortran mode treats it as a continuation line. When you indent a | ||
| 2081 | continuation line with @key{TAB}, it converts the line to the current | ||
| 2082 | continuation style. When you split a Fortran statement with | ||
| 2083 | @kbd{C-M-j}, the continuation marker on the newline is created according | ||
| 2084 | to the continuation style. | ||
| 2085 | |||
| 2086 | The setting of continuation style affects several other aspects of | ||
| 2087 | editing in Fortran mode. In fixed format mode, the minimum column | ||
| 2088 | number for the body of a statement is 6. Lines inside of Fortran | ||
| 2089 | blocks that are indented to larger column numbers always use only the | ||
| 2090 | space character for whitespace. In tab format mode, the minimum | ||
| 2091 | column number for the statement body is 8, and the whitespace before | ||
| 2092 | column 8 must always consist of one tab character. | ||
| 2093 | |||
| 2094 | @node ForIndent Num | ||
| 2095 | @subsection Line Numbers | ||
| 2096 | |||
| 2097 | If a number is the first non-whitespace in the line, Fortran | ||
| 2098 | indentation assumes it is a line number and moves it to columns 0 | ||
| 2099 | through 4. (Columns always count from 0 in GNU Emacs.) | ||
| 2100 | |||
| 2101 | @vindex fortran-line-number-indent | ||
| 2102 | Line numbers of four digits or less are normally indented one space. | ||
| 2103 | The variable @code{fortran-line-number-indent} controls this; it | ||
| 2104 | specifies the maximum indentation a line number can have. The default | ||
| 2105 | value of the variable is 1. Fortran mode tries to prevent line number | ||
| 2106 | digits passing column 4, reducing the indentation below the specified | ||
| 2107 | maximum if necessary. If @code{fortran-line-number-indent} has the | ||
| 2108 | value 5, line numbers are right-justified to end in column 4. | ||
| 2109 | |||
| 2110 | @vindex fortran-electric-line-number | ||
| 2111 | Simply inserting a line number is enough to indent it according to | ||
| 2112 | these rules. As each digit is inserted, the indentation is recomputed. | ||
| 2113 | To turn off this feature, set the variable | ||
| 2114 | @code{fortran-electric-line-number} to @code{nil}. | ||
| 2115 | |||
| 2116 | |||
| 2117 | @node ForIndent Conv | ||
| 2118 | @subsection Syntactic Conventions | ||
| 2119 | |||
| 2120 | Fortran mode assumes that you follow certain conventions that simplify | ||
| 2121 | the task of understanding a Fortran program well enough to indent it | ||
| 2122 | properly: | ||
| 2123 | |||
| 2124 | @itemize @bullet | ||
| 2125 | @item | ||
| 2126 | Two nested @samp{do} loops never share a @samp{continue} statement. | ||
| 2127 | |||
| 2128 | @item | ||
| 2129 | Fortran keywords such as @samp{if}, @samp{else}, @samp{then}, @samp{do} | ||
| 2130 | and others are written without embedded whitespace or line breaks. | ||
| 2131 | |||
| 2132 | Fortran compilers generally ignore whitespace outside of string | ||
| 2133 | constants, but Fortran mode does not recognize these keywords if they | ||
| 2134 | are not contiguous. Constructs such as @samp{else if} or @samp{end do} | ||
| 2135 | are acceptable, but the second word should be on the same line as the | ||
| 2136 | first and not on a continuation line. | ||
| 2137 | @end itemize | ||
| 2138 | |||
| 2139 | @noindent | ||
| 2140 | If you fail to follow these conventions, the indentation commands may | ||
| 2141 | indent some lines unaesthetically. However, a correct Fortran program | ||
| 2142 | retains its meaning when reindented even if the conventions are not | ||
| 2143 | followed. | ||
| 2144 | |||
| 2145 | @node ForIndent Vars | ||
| 2146 | @subsection Variables for Fortran Indentation | ||
| 2147 | |||
| 2148 | @vindex fortran-do-indent | ||
| 2149 | @vindex fortran-if-indent | ||
| 2150 | @vindex fortran-structure-indent | ||
| 2151 | @vindex fortran-continuation-indent | ||
| 2152 | @vindex fortran-check-all-num@dots{} | ||
| 2153 | @vindex fortran-minimum-statement-indent@dots{} | ||
| 2154 | Several additional variables control how Fortran indentation works: | ||
| 2155 | |||
| 2156 | @table @code | ||
| 2157 | @item fortran-do-indent | ||
| 2158 | Extra indentation within each level of @samp{do} statement (default 3). | ||
| 2159 | |||
| 2160 | @item fortran-if-indent | ||
| 2161 | Extra indentation within each level of @samp{if}, @samp{select case}, or | ||
| 2162 | @samp{where} statements (default 3). | ||
| 2163 | |||
| 2164 | @item fortran-structure-indent | ||
| 2165 | Extra indentation within each level of @samp{structure}, @samp{union}, | ||
| 2166 | @samp{map}, or @samp{interface} statements (default 3). | ||
| 2167 | |||
| 2168 | @item fortran-continuation-indent | ||
| 2169 | Extra indentation for bodies of continuation lines (default 5). | ||
| 2170 | |||
| 2171 | @item fortran-check-all-num-for-matching-do | ||
| 2172 | In Fortran77, a numbered @samp{do} statement is ended by any statement | ||
| 2173 | with a matching line number. It is common (but not compulsory) to use a | ||
| 2174 | @samp{continue} statement for this purpose. If this variable has a | ||
| 2175 | non-@code{nil} value, indenting any numbered statement must check for a | ||
| 2176 | @samp{do} that ends there. If you always end @samp{do} statements with | ||
| 2177 | a @samp{continue} line (or if you use the more modern @samp{enddo}), | ||
| 2178 | then you can speed up indentation by setting this variable to | ||
| 2179 | @code{nil}. The default is @code{nil}. | ||
| 2180 | |||
| 2181 | @item fortran-blink-matching-if | ||
| 2182 | If this is @code{t}, indenting an @samp{endif} (or @samp{enddo} | ||
| 2183 | statement moves the cursor momentarily to the matching @samp{if} (or | ||
| 2184 | @samp{do}) statement to show where it is. The default is @code{nil}. | ||
| 2185 | |||
| 2186 | @item fortran-minimum-statement-indent-fixed | ||
| 2187 | Minimum indentation for Fortran statements when using fixed format | ||
| 2188 | continuation line style. Statement bodies are never indented less than | ||
| 2189 | this much. The default is 6. | ||
| 2190 | |||
| 2191 | @item fortran-minimum-statement-indent-tab | ||
| 2192 | Minimum indentation for Fortran statements for tab format continuation line | ||
| 2193 | style. Statement bodies are never indented less than this much. The | ||
| 2194 | default is 8. | ||
| 2195 | @end table | ||
| 2196 | |||
| 2197 | The variables controlling the indentation of comments are described in | ||
| 2198 | the following section. | ||
| 2199 | |||
| 2200 | @node Fortran Comments | ||
| 2201 | @section Fortran Comments | ||
| 2202 | |||
| 2203 | The usual Emacs comment commands assume that a comment can follow a | ||
| 2204 | line of code. In Fortran77, the standard comment syntax requires an | ||
| 2205 | entire line to be just a comment. Therefore, Fortran mode replaces the | ||
| 2206 | standard Emacs comment commands and defines some new variables. | ||
| 2207 | |||
| 2208 | @vindex fortran-comment-line-start | ||
| 2209 | Fortran mode can also handle the Fortran90 comment syntax where comments | ||
| 2210 | start with @samp{!} and can follow other text. Because only some Fortran77 | ||
| 2211 | compilers accept this syntax, Fortran mode will not insert such comments | ||
| 2212 | unless you have said in advance to do so. To do this, set the variable | ||
| 2213 | @code{fortran-comment-line-start} to @samp{"!"}. | ||
| 2214 | |||
| 2215 | @table @kbd | ||
| 2216 | @item M-; | ||
| 2217 | Align comment or insert new comment (@code{fortran-indent-comment}). | ||
| 2218 | |||
| 2219 | @item C-x ; | ||
| 2220 | Applies to nonstandard @samp{!} comments only. | ||
| 2221 | |||
| 2222 | @item C-c ; | ||
| 2223 | Turn all lines of the region into comments, or (with argument) turn them back | ||
| 2224 | into real code (@code{fortran-comment-region}). | ||
| 2225 | @end table | ||
| 2226 | |||
| 2227 | @findex fortran-indent-comment | ||
| 2228 | @kbd{M-;} in Fortran mode is redefined as the command | ||
| 2229 | @code{fortran-indent-comment}. Like the usual @kbd{M-;} command, this | ||
| 2230 | recognizes any kind of existing comment and aligns its text appropriately; | ||
| 2231 | if there is no existing comment, a comment is inserted and aligned. But | ||
| 2232 | inserting and aligning comments are not the same in Fortran mode as in | ||
| 2233 | other modes. | ||
| 2234 | |||
| 2235 | When a new comment must be inserted, if the current line is blank, a | ||
| 2236 | full-line comment is inserted. On a non-blank line, a nonstandard @samp{!} | ||
| 2237 | comment is inserted if you have said you want to use them. Otherwise a | ||
| 2238 | full-line comment is inserted on a new line before the current line. | ||
| 2239 | |||
| 2240 | Nonstandard @samp{!} comments are aligned like comments in other | ||
| 2241 | languages, but full-line comments are different. In a standard full-line | ||
| 2242 | comment, the comment delimiter itself must always appear in column zero. | ||
| 2243 | What can be aligned is the text within the comment. You can choose from | ||
| 2244 | three styles of alignment by setting the variable | ||
| 2245 | @code{fortran-comment-indent-style} to one of these values: | ||
| 2246 | |||
| 2247 | @vindex fortran-comment-indent-style | ||
| 2248 | @vindex fortran-comment-line-extra-indent | ||
| 2249 | @table @code | ||
| 2250 | @item fixed | ||
| 2251 | Align the text at a fixed column, which is the sum of | ||
| 2252 | @code{fortran-comment-line-extra-indent} and the minimum statement | ||
| 2253 | indentation. This is the default. | ||
| 2254 | |||
| 2255 | The minimum statement indentation is | ||
| 2256 | @code{fortran-minimum-statement-indent-fixed} for fixed format | ||
| 2257 | continuation line style and @code{fortran-minimum-statement-indent-tab} | ||
| 2258 | for tab format style. | ||
| 2259 | |||
| 2260 | @item relative | ||
| 2261 | Align the text as if it were a line of code, but with an additional | ||
| 2262 | @code{fortran-comment-line-extra-indent} columns of indentation. | ||
| 2263 | |||
| 2264 | @item nil | ||
| 2265 | Don't move text in full-line comments automatically. | ||
| 2266 | @end table | ||
| 2267 | |||
| 2268 | @vindex fortran-comment-indent-char | ||
| 2269 | In addition, you can specify the character to be used to indent within | ||
| 2270 | full-line comments by setting the variable | ||
| 2271 | @code{fortran-comment-indent-char} to the single-character string you want | ||
| 2272 | to use. | ||
| 2273 | |||
| 2274 | @vindex fortran-directive-re | ||
| 2275 | Compiler directive lines, or preprocessor lines, have much the same | ||
| 2276 | appearance as comment lines. It is important, though, that such lines | ||
| 2277 | never be indented at all, no matter what the value of | ||
| 2278 | @code{fortran-comment-indent-style}. The variable | ||
| 2279 | @code{fortran-directive-re} is a regular expression that specifies which | ||
| 2280 | lines are directives. Matching lines are never indented, and receive | ||
| 2281 | distinctive font-locking. | ||
| 2282 | |||
| 2283 | The normal Emacs comment command @kbd{C-x ;} has not been redefined. If | ||
| 2284 | you use @samp{!} comments, this command can be used with them. Otherwise | ||
| 2285 | it is useless in Fortran mode. | ||
| 2286 | |||
| 2287 | @kindex C-c ; @r{(Fortran mode)} | ||
| 2288 | @findex fortran-comment-region | ||
| 2289 | @vindex fortran-comment-region | ||
| 2290 | The command @kbd{C-c ;} (@code{fortran-comment-region}) turns all the | ||
| 2291 | lines of the region into comments by inserting the string @samp{C$$$} at | ||
| 2292 | the front of each one. With a numeric argument, it turns the region | ||
| 2293 | back into live code by deleting @samp{C$$$} from the front of each line | ||
| 2294 | in it. The string used for these comments can be controlled by setting | ||
| 2295 | the variable @code{fortran-comment-region}. Note that here we have an | ||
| 2296 | example of a command and a variable with the same name; these two uses | ||
| 2297 | of the name never conflict because in Lisp and in Emacs it is always | ||
| 2298 | clear from the context which one is meant. | ||
| 2299 | |||
| 2300 | @node Fortran Autofill | ||
| 2301 | @section Auto Fill in Fortran Mode | ||
| 2302 | |||
| 2303 | Fortran mode has specialized support for Auto Fill mode, which is a | ||
| 2304 | minor mode that automatically splits statements as you insert them | ||
| 2305 | when they become too wide. Splitting a statement involves making | ||
| 2306 | continuation lines using @code{fortran-continuation-string} | ||
| 2307 | (@pxref{ForIndent Cont}). This splitting happens when you type | ||
| 2308 | @key{SPC}, @key{RET}, or @key{TAB}, and also in the Fortran | ||
| 2309 | indentation commands. You activate Auto Fill in Fortran mode in the | ||
| 2310 | normal way. @xref{Auto Fill,,, emacs, the Emacs Manual}. | ||
| 2311 | |||
| 2312 | @vindex fortran-break-before-delimiters | ||
| 2313 | Auto Fill breaks lines at spaces or delimiters when the lines get | ||
| 2314 | longer than the desired width (the value of @code{fill-column}). The | ||
| 2315 | delimiters (besides whitespace) that Auto Fill can break at are | ||
| 2316 | @samp{+}, @samp{-}, @samp{/}, @samp{*}, @samp{=}, @samp{<}, @samp{>}, | ||
| 2317 | and @samp{,}. The line break comes after the delimiter if the | ||
| 2318 | variable @code{fortran-break-before-delimiters} is @code{nil}. | ||
| 2319 | Otherwise (and by default), the break comes before the delimiter. | ||
| 2320 | |||
| 2321 | To enable Auto Fill in all Fortran buffers, add | ||
| 2322 | @code{turn-on-auto-fill} to @code{fortran-mode-hook}. @xref{Hooks,,, | ||
| 2323 | emacs, the Emacs Manual}. | ||
| 2324 | |||
| 2325 | @node Fortran Columns | ||
| 2326 | @section Checking Columns in Fortran | ||
| 2327 | |||
| 2328 | @table @kbd | ||
| 2329 | @item C-c C-r | ||
| 2330 | Display a ``column ruler'' momentarily above the current line | ||
| 2331 | (@code{fortran-column-ruler}). | ||
| 2332 | @item C-c C-w | ||
| 2333 | Split the current window horizontally temporarily so that it is 72 | ||
| 2334 | columns wide (@code{fortran-window-create-momentarily}). This may | ||
| 2335 | help you avoid making lines longer than the 72-character limit that | ||
| 2336 | some Fortran compilers impose. | ||
| 2337 | @item C-u C-c C-w | ||
| 2338 | Split the current window horizontally so that it is 72 columns wide | ||
| 2339 | (@code{fortran-window-create}). You can then continue editing. | ||
| 2340 | @item M-x fortran-strip-sequence-nos | ||
| 2341 | Delete all text in column 72 and beyond. | ||
| 2342 | @end table | ||
| 2343 | |||
| 2344 | @kindex C-c C-r @r{(Fortran mode)} | ||
| 2345 | @findex fortran-column-ruler | ||
| 2346 | The command @kbd{C-c C-r} (@code{fortran-column-ruler}) shows a column | ||
| 2347 | ruler momentarily above the current line. The comment ruler is two lines | ||
| 2348 | of text that show you the locations of columns with special significance in | ||
| 2349 | Fortran programs. Square brackets show the limits of the columns for line | ||
| 2350 | numbers, and curly brackets show the limits of the columns for the | ||
| 2351 | statement body. Column numbers appear above them. | ||
| 2352 | |||
| 2353 | Note that the column numbers count from zero, as always in GNU Emacs. | ||
| 2354 | As a result, the numbers may be one less than those you are familiar | ||
| 2355 | with; but the positions they indicate in the line are standard for | ||
| 2356 | Fortran. | ||
| 2357 | |||
| 2358 | @vindex fortran-column-ruler-fixed | ||
| 2359 | @vindex fortran-column-ruler-tabs | ||
| 2360 | The text used to display the column ruler depends on the value of the | ||
| 2361 | variable @code{indent-tabs-mode}. If @code{indent-tabs-mode} is | ||
| 2362 | @code{nil}, then the value of the variable | ||
| 2363 | @code{fortran-column-ruler-fixed} is used as the column ruler. | ||
| 2364 | Otherwise, the value of the variable @code{fortran-column-ruler-tab} is | ||
| 2365 | displayed. By changing these variables, you can change the column ruler | ||
| 2366 | display. | ||
| 2367 | |||
| 2368 | @kindex C-c C-w @r{(Fortran mode)} | ||
| 2369 | @findex fortran-window-create-momentarily | ||
| 2370 | @kbd{C-c C-w} (@code{fortran-window-create-momentarily}) temporarily | ||
| 2371 | splits the current window horizontally, making a window 72 columns | ||
| 2372 | wide, so you can see any lines that are too long. Type a space to | ||
| 2373 | restore the normal width. | ||
| 2374 | |||
| 2375 | @kindex C-u C-c C-w @r{(Fortran mode)} | ||
| 2376 | @findex fortran-window-create | ||
| 2377 | You can also split the window horizontally and continue editing with | ||
| 2378 | the split in place. To do this, use @kbd{C-u C-c C-w} (@code{M-x | ||
| 2379 | fortran-window-create}). By editing in this window you can | ||
| 2380 | immediately see when you make a line too wide to be correct Fortran. | ||
| 2381 | |||
| 2382 | @findex fortran-strip-sequence-nos | ||
| 2383 | The command @kbd{M-x fortran-strip-sequence-nos} deletes all text in | ||
| 2384 | column 72 and beyond, on all lines in the current buffer. This is the | ||
| 2385 | easiest way to get rid of old sequence numbers. | ||
| 2386 | |||
| 2387 | @node Fortran Abbrev | ||
| 2388 | @section Fortran Keyword Abbrevs | ||
| 2389 | |||
| 2390 | Fortran mode provides many built-in abbrevs for common keywords and | ||
| 2391 | declarations. These are the same sort of abbrev that you can define | ||
| 2392 | yourself. To use them, you must turn on Abbrev mode. | ||
| 2393 | @xref{Abbrevs,,, emacs, the Emacs Manual}. | ||
| 2394 | |||
| 2395 | The built-in abbrevs are unusual in one way: they all start with a | ||
| 2396 | semicolon. You cannot normally use semicolon in an abbrev, but Fortran | ||
| 2397 | mode makes this possible by changing the syntax of semicolon to ``word | ||
| 2398 | constituent.'' | ||
| 2399 | |||
| 2400 | For example, one built-in Fortran abbrev is @samp{;c} for | ||
| 2401 | @samp{continue}. If you insert @samp{;c} and then insert a punctuation | ||
| 2402 | character such as a space or a newline, the @samp{;c} expands automatically | ||
| 2403 | to @samp{continue}, provided Abbrev mode is enabled.@refill | ||
| 2404 | |||
| 2405 | Type @samp{;?} or @samp{;C-h} to display a list of all the built-in | ||
| 2406 | Fortran abbrevs and what they stand for. | ||
| 1225 | 2407 | ||
| 1226 | @node Index | 2408 | @node Index |
| 1227 | @unnumbered Index | 2409 | @unnumbered Index |
diff --git a/man/emacs.texi b/man/emacs.texi index ce3c7318945..647d199f612 100644 --- a/man/emacs.texi +++ b/man/emacs.texi | |||
| @@ -103,8 +103,6 @@ Text Mode | |||
| 103 | Outline Mode | 103 | Outline Mode |
| 104 | @TeX{} Mode | 104 | @TeX{} Mode |
| 105 | Formatted Text | 105 | Formatted Text |
| 106 | Fortran Mode | ||
| 107 | Fortran Indentation | ||
| 108 | Shell Command History | 106 | Shell Command History |
| 109 | 107 | ||
| 110 | The ones for Dired and Rmail have had the items turned into :: items | 108 | The ones for Dired and Rmail have had the items turned into :: items |
| @@ -182,8 +180,6 @@ Advanced Features | |||
| 182 | * Maintaining:: Features for maintaining large programs. | 180 | * Maintaining:: Features for maintaining large programs. |
| 183 | * Abbrevs:: How to define text abbreviations to reduce | 181 | * Abbrevs:: How to define text abbreviations to reduce |
| 184 | the number of characters you must type. | 182 | the number of characters you must type. |
| 185 | * Picture:: Editing pictures made up of characters | ||
| 186 | using the quarter-plane screen model. | ||
| 187 | * Sending Mail:: Sending mail in Emacs. | 183 | * Sending Mail:: Sending mail in Emacs. |
| 188 | * Rmail:: Reading mail in Emacs. | 184 | * Rmail:: Reading mail in Emacs. |
| 189 | * Dired:: You can ``edit'' a directory to manage files in it. | 185 | * Dired:: You can ``edit'' a directory to manage files in it. |
| @@ -525,7 +521,6 @@ Editing Programs | |||
| 525 | * Misc for Programs:: Other Emacs features useful for editing programs. | 521 | * Misc for Programs:: Other Emacs features useful for editing programs. |
| 526 | * C Modes:: Special commands of C, C++, Objective-C, | 522 | * C Modes:: Special commands of C, C++, Objective-C, |
| 527 | Java, and Pike modes. | 523 | Java, and Pike modes. |
| 528 | * Fortran:: Fortran mode and its special features. | ||
| 529 | * Asm Mode:: Asm mode and its special features. | 524 | * Asm Mode:: Asm mode and its special features. |
| 530 | 525 | ||
| 531 | Top-Level Definitions, or Defuns | 526 | Top-Level Definitions, or Defuns |
| @@ -572,15 +567,6 @@ C and Related Modes | |||
| 572 | * Other C Commands:: Filling comments, viewing expansion of macros, | 567 | * Other C Commands:: Filling comments, viewing expansion of macros, |
| 573 | and other neat features. | 568 | and other neat features. |
| 574 | 569 | ||
| 575 | Fortran Mode | ||
| 576 | |||
| 577 | * Fortran Motion:: Moving point by statements or subprograms. | ||
| 578 | * Fortran Indent:: Indentation commands for Fortran. | ||
| 579 | * Fortran Comments:: Inserting and aligning comments. | ||
| 580 | * Fortran Autofill:: Auto fill minor mode for Fortran. | ||
| 581 | * Fortran Columns:: Measuring columns for valid Fortran. | ||
| 582 | * Fortran Abbrev:: Built-in abbrevs for Fortran keywords. | ||
| 583 | |||
| 584 | Compiling and Testing Programs | 570 | Compiling and Testing Programs |
| 585 | 571 | ||
| 586 | * Compilation:: Compiling programs in languages other | 572 | * Compilation:: Compiling programs in languages other |
| @@ -615,7 +601,6 @@ Maintaining Large Programs | |||
| 615 | * Format of ChangeLog:: What the change log file looks like. | 601 | * Format of ChangeLog:: What the change log file looks like. |
| 616 | * Tags:: Go direct to any function in your program in one | 602 | * Tags:: Go direct to any function in your program in one |
| 617 | command. Tags remembers which file it is in. | 603 | command. Tags remembers which file it is in. |
| 618 | * Emerge:: A convenient way of merging two versions of a program. | ||
| 619 | 604 | ||
| 620 | Tags Tables | 605 | Tags Tables |
| 621 | 606 | ||
| @@ -627,19 +612,6 @@ Tags Tables | |||
| 627 | * Tags Search:: Using a tags table for searching and replacing. | 612 | * Tags Search:: Using a tags table for searching and replacing. |
| 628 | * List Tags:: Listing and finding tags defined in a file. | 613 | * List Tags:: Listing and finding tags defined in a file. |
| 629 | 614 | ||
| 630 | Merging Files with Emerge | ||
| 631 | |||
| 632 | * Overview of Emerge:: How to start Emerge. Basic concepts. | ||
| 633 | * Submodes of Emerge:: Fast mode vs. Edit mode. | ||
| 634 | Skip Prefers mode and Auto Advance mode. | ||
| 635 | * State of Difference:: You do the merge by specifying state A or B | ||
| 636 | for each difference. | ||
| 637 | * Merge Commands:: Commands for selecting a difference, | ||
| 638 | changing states of differences, etc. | ||
| 639 | * Exiting Emerge:: What to do when you've finished the merge. | ||
| 640 | * Combining in Emerge:: How to keep both alternatives for a difference. | ||
| 641 | * Fine Points of Emerge:: Misc. | ||
| 642 | |||
| 643 | Abbrevs | 615 | Abbrevs |
| 644 | 616 | ||
| 645 | * Abbrev Concepts:: Fundamentals of defined abbrevs. | 617 | * Abbrev Concepts:: Fundamentals of defined abbrevs. |
| @@ -650,14 +622,6 @@ Abbrevs | |||
| 650 | * Dynamic Abbrevs:: Abbreviations for words already in the buffer. | 622 | * Dynamic Abbrevs:: Abbreviations for words already in the buffer. |
| 651 | * Dabbrev Customization:: What is a word, for dynamic abbrevs. Case handling. | 623 | * Dabbrev Customization:: What is a word, for dynamic abbrevs. Case handling. |
| 652 | 624 | ||
| 653 | Editing Pictures | ||
| 654 | |||
| 655 | * Basic Picture:: Basic concepts and simple commands of Picture Mode. | ||
| 656 | * Insert in Picture:: Controlling direction of cursor motion | ||
| 657 | after "self-inserting" characters. | ||
| 658 | * Tabs in Picture:: Various features for tab stops and indentation. | ||
| 659 | * Rectangles in Picture:: Clearing and superimposing rectangles. | ||
| 660 | |||
| 661 | Sending Mail | 625 | Sending Mail |
| 662 | 626 | ||
| 663 | * Mail Format:: Format of the mail being composed. | 627 | * Mail Format:: Format of the mail being composed. |
| @@ -1179,7 +1143,6 @@ shell commands. | |||
| 1179 | @include building.texi | 1143 | @include building.texi |
| 1180 | @include maintaining.texi | 1144 | @include maintaining.texi |
| 1181 | @include abbrevs.texi | 1145 | @include abbrevs.texi |
| 1182 | @include picture.texi | ||
| 1183 | @include sending.texi | 1146 | @include sending.texi |
| 1184 | @include rmail.texi | 1147 | @include rmail.texi |
| 1185 | @include dired.texi | 1148 | @include dired.texi |
diff --git a/man/files.texi b/man/files.texi index 23846167b6e..3d671397b34 100644 --- a/man/files.texi +++ b/man/files.texi | |||
| @@ -3037,8 +3037,8 @@ typically the result of a failed merge from a version control system | |||
| 3037 | mode provides commands to resolve conflicts by selecting specific | 3037 | mode provides commands to resolve conflicts by selecting specific |
| 3038 | changes. | 3038 | changes. |
| 3039 | 3039 | ||
| 3040 | See also @ref{Emerge}, and @ref{Top,,, ediff, The Ediff Manual}, for | 3040 | @inforef{Emerge,, emacs-xtra} for the Emerge facility, which |
| 3041 | convenient facilities for merging two similar files. | 3041 | provides a powerful interface for merging files. |
| 3042 | 3042 | ||
| 3043 | @node Misc File Ops | 3043 | @node Misc File Ops |
| 3044 | @section Miscellaneous File Operations | 3044 | @section Miscellaneous File Operations |
diff --git a/man/maintaining.texi b/man/maintaining.texi index 9836aae4e83..f0b5f1c31af 100644 --- a/man/maintaining.texi +++ b/man/maintaining.texi | |||
| @@ -14,7 +14,6 @@ also particularly useful for this purpose. | |||
| 14 | * Format of ChangeLog:: What the change log file looks like. | 14 | * Format of ChangeLog:: What the change log file looks like. |
| 15 | * Tags:: Go direct to any function in your program in one | 15 | * Tags:: Go direct to any function in your program in one |
| 16 | command. Tags remembers which file it is in. | 16 | command. Tags remembers which file it is in. |
| 17 | * Emerge:: A convenient way of merging two versions of a program. | ||
| 18 | @end menu | 17 | @end menu |
| 19 | 18 | ||
| 20 | @node Change Log | 19 | @node Change Log |
| @@ -846,393 +845,6 @@ details. | |||
| 846 | You can also use the collection of tag names to complete a symbol | 845 | You can also use the collection of tag names to complete a symbol |
| 847 | name in the buffer. @xref{Symbol Completion}. | 846 | name in the buffer. @xref{Symbol Completion}. |
| 848 | 847 | ||
| 849 | @node Emerge | ||
| 850 | @section Merging Files with Emerge | ||
| 851 | @cindex Emerge | ||
| 852 | @cindex merging files | ||
| 853 | |||
| 854 | It's not unusual for programmers to get their signals crossed and | ||
| 855 | modify the same program in two different directions. To recover from | ||
| 856 | this confusion, you need to merge the two versions. Emerge makes this | ||
| 857 | easier. See also @ref{Comparing Files}, for other ways to compare | ||
| 858 | files, and @ref{Top, Ediff,, ediff, The Ediff Manual}. | ||
| 859 | |||
| 860 | @menu | ||
| 861 | * Overview of Emerge:: How to start Emerge. Basic concepts. | ||
| 862 | * Submodes of Emerge:: Fast mode vs. Edit mode. | ||
| 863 | Skip Prefers mode and Auto Advance mode. | ||
| 864 | * State of Difference:: You do the merge by specifying state A or B | ||
| 865 | for each difference. | ||
| 866 | * Merge Commands:: Commands for selecting a difference, | ||
| 867 | changing states of differences, etc. | ||
| 868 | * Exiting Emerge:: What to do when you've finished the merge. | ||
| 869 | * Combining in Emerge:: How to keep both alternatives for a difference. | ||
| 870 | * Fine Points of Emerge:: Misc. | ||
| 871 | @end menu | ||
| 872 | |||
| 873 | @node Overview of Emerge | ||
| 874 | @subsection Overview of Emerge | ||
| 875 | |||
| 876 | To start Emerge, run one of these four commands: | ||
| 877 | |||
| 878 | @table @kbd | ||
| 879 | @item M-x emerge-files | ||
| 880 | @findex emerge-files | ||
| 881 | Merge two specified files. | ||
| 882 | |||
| 883 | @item M-x emerge-files-with-ancestor | ||
| 884 | @findex emerge-files-with-ancestor | ||
| 885 | Merge two specified files, with reference to a common ancestor. | ||
| 886 | |||
| 887 | @item M-x emerge-buffers | ||
| 888 | @findex emerge-buffers | ||
| 889 | Merge two buffers. | ||
| 890 | |||
| 891 | @item M-x emerge-buffers-with-ancestor | ||
| 892 | @findex emerge-buffers-with-ancestor | ||
| 893 | Merge two buffers with reference to a common ancestor in a third | ||
| 894 | buffer. | ||
| 895 | @end table | ||
| 896 | |||
| 897 | @cindex merge buffer (Emerge) | ||
| 898 | @cindex A and B buffers (Emerge) | ||
| 899 | The Emerge commands compare two files or buffers, and display the | ||
| 900 | comparison in three buffers: one for each input text (the @dfn{A buffer} | ||
| 901 | and the @dfn{B buffer}), and one (the @dfn{merge buffer}) where merging | ||
| 902 | takes place. The merge buffer shows the full merged text, not just the | ||
| 903 | differences. Wherever the two input texts differ, you can choose which | ||
| 904 | one of them to include in the merge buffer. | ||
| 905 | |||
| 906 | The Emerge commands that take input from existing buffers use only the | ||
| 907 | accessible portions of those buffers, if they are narrowed | ||
| 908 | (@pxref{Narrowing}). | ||
| 909 | |||
| 910 | If a common ancestor version is available, from which the two texts to | ||
| 911 | be merged were both derived, Emerge can use it to guess which | ||
| 912 | alternative is right. Wherever one current version agrees with the | ||
| 913 | ancestor, Emerge presumes that the other current version is a deliberate | ||
| 914 | change which should be kept in the merged version. Use the | ||
| 915 | @samp{with-ancestor} commands if you want to specify a common ancestor | ||
| 916 | text. These commands read three file or buffer names---variant A, | ||
| 917 | variant B, and the common ancestor. | ||
| 918 | |||
| 919 | After the comparison is done and the buffers are prepared, the | ||
| 920 | interactive merging starts. You control the merging by typing special | ||
| 921 | @dfn{merge commands} in the merge buffer (@pxref{Merge Commands}). | ||
| 922 | For each run of differences between the input texts, you can choose | ||
| 923 | which one of them to keep, or edit them both together. | ||
| 924 | |||
| 925 | The merge buffer uses a special major mode, Emerge mode, with commands | ||
| 926 | for making these choices. But you can also edit the buffer with | ||
| 927 | ordinary Emacs commands. | ||
| 928 | |||
| 929 | At any given time, the attention of Emerge is focused on one | ||
| 930 | particular difference, called the @dfn{selected} difference. This | ||
| 931 | difference is marked off in the three buffers like this: | ||
| 932 | |||
| 933 | @example | ||
| 934 | vvvvvvvvvvvvvvvvvvvv | ||
| 935 | @var{text that differs} | ||
| 936 | ^^^^^^^^^^^^^^^^^^^^ | ||
| 937 | @end example | ||
| 938 | |||
| 939 | @noindent | ||
| 940 | Emerge numbers all the differences sequentially and the mode | ||
| 941 | line always shows the number of the selected difference. | ||
| 942 | |||
| 943 | Normally, the merge buffer starts out with the A version of the text. | ||
| 944 | But when the A version of a difference agrees with the common ancestor, | ||
| 945 | then the B version is initially preferred for that difference. | ||
| 946 | |||
| 947 | Emerge leaves the merged text in the merge buffer when you exit. At | ||
| 948 | that point, you can save it in a file with @kbd{C-x C-w}. If you give a | ||
| 949 | numeric argument to @code{emerge-files} or | ||
| 950 | @code{emerge-files-with-ancestor}, it reads the name of the output file | ||
| 951 | using the minibuffer. (This is the last file name those commands read.) | ||
| 952 | Then exiting from Emerge saves the merged text in the output file. | ||
| 953 | |||
| 954 | Normally, Emerge commands save the output buffer in its file when you | ||
| 955 | exit. If you abort Emerge with @kbd{C-]}, the Emerge command does not | ||
| 956 | save the output buffer, but you can save it yourself if you wish. | ||
| 957 | |||
| 958 | @node Submodes of Emerge | ||
| 959 | @subsection Submodes of Emerge | ||
| 960 | |||
| 961 | You can choose between two modes for giving merge commands: Fast mode | ||
| 962 | and Edit mode. In Fast mode, basic merge commands are single | ||
| 963 | characters, but ordinary Emacs commands are disabled. This is | ||
| 964 | convenient if you use only merge commands. In Edit mode, all merge | ||
| 965 | commands start with the prefix key @kbd{C-c C-c}, and the normal Emacs | ||
| 966 | commands are also available. This allows editing the merge buffer, but | ||
| 967 | slows down Emerge operations. | ||
| 968 | |||
| 969 | Use @kbd{e} to switch to Edit mode, and @kbd{C-c C-c f} to switch to | ||
| 970 | Fast mode. The mode line indicates Edit and Fast modes with @samp{E} | ||
| 971 | and @samp{F}. | ||
| 972 | |||
| 973 | Emerge has two additional submodes that affect how particular merge | ||
| 974 | commands work: Auto Advance mode and Skip Prefers mode. | ||
| 975 | |||
| 976 | If Auto Advance mode is in effect, the @kbd{a} and @kbd{b} commands | ||
| 977 | advance to the next difference. This lets you go through the merge | ||
| 978 | faster as long as you simply choose one of the alternatives from the | ||
| 979 | input. The mode line indicates Auto Advance mode with @samp{A}. | ||
| 980 | |||
| 981 | If Skip Prefers mode is in effect, the @kbd{n} and @kbd{p} commands | ||
| 982 | skip over differences in states prefer-A and prefer-B (@pxref{State of | ||
| 983 | Difference}). Thus you see only differences for which neither version | ||
| 984 | is presumed ``correct.'' The mode line indicates Skip Prefers mode with | ||
| 985 | @samp{S}. | ||
| 986 | |||
| 987 | @findex emerge-auto-advance-mode | ||
| 988 | @findex emerge-skip-prefers-mode | ||
| 989 | Use the command @kbd{s a} (@code{emerge-auto-advance-mode}) to set or | ||
| 990 | clear Auto Advance mode. Use @kbd{s s} | ||
| 991 | (@code{emerge-skip-prefers-mode}) to set or clear Skip Prefers mode. | ||
| 992 | These commands turn on the mode with a positive argument, turns it off | ||
| 993 | with a negative or zero argument, and toggle the mode with no argument. | ||
| 994 | |||
| 995 | @node State of Difference | ||
| 996 | @subsection State of a Difference | ||
| 997 | |||
| 998 | In the merge buffer, a difference is marked with lines of @samp{v} and | ||
| 999 | @samp{^} characters. Each difference has one of these seven states: | ||
| 1000 | |||
| 1001 | @table @asis | ||
| 1002 | @item A | ||
| 1003 | The difference is showing the A version. The @kbd{a} command always | ||
| 1004 | produces this state; the mode line indicates it with @samp{A}. | ||
| 1005 | |||
| 1006 | @item B | ||
| 1007 | The difference is showing the B version. The @kbd{b} command always | ||
| 1008 | produces this state; the mode line indicates it with @samp{B}. | ||
| 1009 | |||
| 1010 | @item default-A | ||
| 1011 | @itemx default-B | ||
| 1012 | The difference is showing the A or the B state by default, because you | ||
| 1013 | haven't made a choice. All differences start in the default-A state | ||
| 1014 | (and thus the merge buffer is a copy of the A buffer), except those for | ||
| 1015 | which one alternative is ``preferred'' (see below). | ||
| 1016 | |||
| 1017 | When you select a difference, its state changes from default-A or | ||
| 1018 | default-B to plain A or B. Thus, the selected difference never has | ||
| 1019 | state default-A or default-B, and these states are never displayed in | ||
| 1020 | the mode line. | ||
| 1021 | |||
| 1022 | The command @kbd{d a} chooses default-A as the default state, and @kbd{d | ||
| 1023 | b} chooses default-B. This chosen default applies to all differences | ||
| 1024 | which you haven't ever selected and for which no alternative is preferred. | ||
| 1025 | If you are moving through the merge sequentially, the differences you | ||
| 1026 | haven't selected are those following the selected one. Thus, while | ||
| 1027 | moving sequentially, you can effectively make the A version the default | ||
| 1028 | for some sections of the merge buffer and the B version the default for | ||
| 1029 | others by using @kbd{d a} and @kbd{d b} between sections. | ||
| 1030 | |||
| 1031 | @item prefer-A | ||
| 1032 | @itemx prefer-B | ||
| 1033 | The difference is showing the A or B state because it is | ||
| 1034 | @dfn{preferred}. This means that you haven't made an explicit choice, | ||
| 1035 | but one alternative seems likely to be right because the other | ||
| 1036 | alternative agrees with the common ancestor. Thus, where the A buffer | ||
| 1037 | agrees with the common ancestor, the B version is preferred, because | ||
| 1038 | chances are it is the one that was actually changed. | ||
| 1039 | |||
| 1040 | These two states are displayed in the mode line as @samp{A*} and @samp{B*}. | ||
| 1041 | |||
| 1042 | @item combined | ||
| 1043 | The difference is showing a combination of the A and B states, as a | ||
| 1044 | result of the @kbd{x c} or @kbd{x C} commands. | ||
| 1045 | |||
| 1046 | Once a difference is in this state, the @kbd{a} and @kbd{b} commands | ||
| 1047 | don't do anything to it unless you give them a numeric argument. | ||
| 1048 | |||
| 1049 | The mode line displays this state as @samp{comb}. | ||
| 1050 | @end table | ||
| 1051 | |||
| 1052 | @node Merge Commands | ||
| 1053 | @subsection Merge Commands | ||
| 1054 | |||
| 1055 | Here are the Merge commands for Fast mode; in Edit mode, precede them | ||
| 1056 | with @kbd{C-c C-c}: | ||
| 1057 | |||
| 1058 | @table @kbd | ||
| 1059 | @item p | ||
| 1060 | Select the previous difference. | ||
| 1061 | |||
| 1062 | @item n | ||
| 1063 | Select the next difference. | ||
| 1064 | |||
| 1065 | @item a | ||
| 1066 | Choose the A version of this difference. | ||
| 1067 | |||
| 1068 | @item b | ||
| 1069 | Choose the B version of this difference. | ||
| 1070 | |||
| 1071 | @item C-u @var{n} j | ||
| 1072 | Select difference number @var{n}. | ||
| 1073 | |||
| 1074 | @item . | ||
| 1075 | Select the difference containing point. You can use this command in the | ||
| 1076 | merge buffer or in the A or B buffer. | ||
| 1077 | |||
| 1078 | @item q | ||
| 1079 | Quit---finish the merge. | ||
| 1080 | |||
| 1081 | @item C-] | ||
| 1082 | Abort---exit merging and do not save the output. | ||
| 1083 | |||
| 1084 | @item f | ||
| 1085 | Go into Fast mode. (In Edit mode, this is actually @kbd{C-c C-c f}.) | ||
| 1086 | |||
| 1087 | @item e | ||
| 1088 | Go into Edit mode. | ||
| 1089 | |||
| 1090 | @item l | ||
| 1091 | Recenter (like @kbd{C-l}) all three windows. | ||
| 1092 | |||
| 1093 | @item - | ||
| 1094 | Specify part of a prefix numeric argument. | ||
| 1095 | |||
| 1096 | @item @var{digit} | ||
| 1097 | Also specify part of a prefix numeric argument. | ||
| 1098 | |||
| 1099 | @item d a | ||
| 1100 | Choose the A version as the default from here down in | ||
| 1101 | the merge buffer. | ||
| 1102 | |||
| 1103 | @item d b | ||
| 1104 | Choose the B version as the default from here down in | ||
| 1105 | the merge buffer. | ||
| 1106 | |||
| 1107 | @item c a | ||
| 1108 | Copy the A version of this difference into the kill ring. | ||
| 1109 | |||
| 1110 | @item c b | ||
| 1111 | Copy the B version of this difference into the kill ring. | ||
| 1112 | |||
| 1113 | @item i a | ||
| 1114 | Insert the A version of this difference at point. | ||
| 1115 | |||
| 1116 | @item i b | ||
| 1117 | Insert the B version of this difference at point. | ||
| 1118 | |||
| 1119 | @item m | ||
| 1120 | Put point and mark around the difference. | ||
| 1121 | |||
| 1122 | @item ^ | ||
| 1123 | Scroll all three windows down (like @kbd{M-v}). | ||
| 1124 | |||
| 1125 | @item v | ||
| 1126 | Scroll all three windows up (like @kbd{C-v}). | ||
| 1127 | |||
| 1128 | @item < | ||
| 1129 | Scroll all three windows left (like @kbd{C-x <}). | ||
| 1130 | |||
| 1131 | @item > | ||
| 1132 | Scroll all three windows right (like @kbd{C-x >}). | ||
| 1133 | |||
| 1134 | @item | | ||
| 1135 | Reset horizontal scroll on all three windows. | ||
| 1136 | |||
| 1137 | @item x 1 | ||
| 1138 | Shrink the merge window to one line. (Use @kbd{C-u l} to restore it | ||
| 1139 | to full size.) | ||
| 1140 | |||
| 1141 | @item x c | ||
| 1142 | Combine the two versions of this difference (@pxref{Combining in | ||
| 1143 | Emerge}). | ||
| 1144 | |||
| 1145 | @item x f | ||
| 1146 | Show the names of the files/buffers Emerge is operating on, in a Help | ||
| 1147 | window. (Use @kbd{C-u l} to restore windows.) | ||
| 1148 | |||
| 1149 | @item x j | ||
| 1150 | Join this difference with the following one. | ||
| 1151 | (@kbd{C-u x j} joins this difference with the previous one.) | ||
| 1152 | |||
| 1153 | @item x s | ||
| 1154 | Split this difference into two differences. Before you use this | ||
| 1155 | command, position point in each of the three buffers at the place where | ||
| 1156 | you want to split the difference. | ||
| 1157 | |||
| 1158 | @item x t | ||
| 1159 | Trim identical lines off the top and bottom of the difference. | ||
| 1160 | Such lines occur when the A and B versions are | ||
| 1161 | identical but differ from the ancestor version. | ||
| 1162 | @end table | ||
| 1163 | |||
| 1164 | @node Exiting Emerge | ||
| 1165 | @subsection Exiting Emerge | ||
| 1166 | |||
| 1167 | The @kbd{q} command (@code{emerge-quit}) finishes the merge, storing | ||
| 1168 | the results into the output file if you specified one. It restores the | ||
| 1169 | A and B buffers to their proper contents, or kills them if they were | ||
| 1170 | created by Emerge and you haven't changed them. It also disables the | ||
| 1171 | Emerge commands in the merge buffer, since executing them later could | ||
| 1172 | damage the contents of the various buffers. | ||
| 1173 | |||
| 1174 | @kbd{C-]} aborts the merge. This means exiting without writing the | ||
| 1175 | output file. If you didn't specify an output file, then there is no | ||
| 1176 | real difference between aborting and finishing the merge. | ||
| 1177 | |||
| 1178 | If the Emerge command was called from another Lisp program, then its | ||
| 1179 | return value is @code{t} for successful completion, or @code{nil} if you | ||
| 1180 | abort. | ||
| 1181 | |||
| 1182 | @node Combining in Emerge | ||
| 1183 | @subsection Combining the Two Versions | ||
| 1184 | |||
| 1185 | Sometimes you want to keep @emph{both} alternatives for a particular | ||
| 1186 | difference. To do this, use @kbd{x c}, which edits the merge buffer | ||
| 1187 | like this: | ||
| 1188 | |||
| 1189 | @example | ||
| 1190 | @group | ||
| 1191 | #ifdef NEW | ||
| 1192 | @var{version from A buffer} | ||
| 1193 | #else /* not NEW */ | ||
| 1194 | @var{version from B buffer} | ||
| 1195 | #endif /* not NEW */ | ||
| 1196 | @end group | ||
| 1197 | @end example | ||
| 1198 | |||
| 1199 | @noindent | ||
| 1200 | @vindex emerge-combine-versions-template | ||
| 1201 | While this example shows C preprocessor conditionals delimiting the two | ||
| 1202 | alternative versions, you can specify the strings to use by setting | ||
| 1203 | the variable @code{emerge-combine-versions-template} to a string of your | ||
| 1204 | choice. In the string, @samp{%a} says where to put version A, and | ||
| 1205 | @samp{%b} says where to put version B. The default setting, which | ||
| 1206 | produces the results shown above, looks like this: | ||
| 1207 | |||
| 1208 | @example | ||
| 1209 | @group | ||
| 1210 | "#ifdef NEW\n%a#else /* not NEW */\n%b#endif /* not NEW */\n" | ||
| 1211 | @end group | ||
| 1212 | @end example | ||
| 1213 | |||
| 1214 | @node Fine Points of Emerge | ||
| 1215 | @subsection Fine Points of Emerge | ||
| 1216 | |||
| 1217 | During the merge, you mustn't try to edit the A and B buffers yourself. | ||
| 1218 | Emerge modifies them temporarily, but ultimately puts them back the way | ||
| 1219 | they were. | ||
| 1220 | |||
| 1221 | You can have any number of merges going at once---just don't use any one | ||
| 1222 | buffer as input to more than one merge at once, since the temporary | ||
| 1223 | changes made in these buffers would get in each other's way. | ||
| 1224 | |||
| 1225 | Starting Emerge can take a long time because it needs to compare the | ||
| 1226 | files fully. Emacs can't do anything else until @code{diff} finishes. | ||
| 1227 | Perhaps in the future someone will change Emerge to do the comparison in | ||
| 1228 | the background when the input files are large---then you could keep on | ||
| 1229 | doing other things with Emacs until Emerge is ready to accept | ||
| 1230 | commands. | ||
| 1231 | |||
| 1232 | @vindex emerge-startup-hook | ||
| 1233 | After setting up the merge, Emerge runs the hook | ||
| 1234 | @code{emerge-startup-hook} (@pxref{Hooks}). | ||
| 1235 | |||
| 1236 | @ignore | 848 | @ignore |
| 1237 | arch-tag: b9d83dfb-82ea-4ff6-bab5-05a3617091fb | 849 | arch-tag: b9d83dfb-82ea-4ff6-bab5-05a3617091fb |
| 1238 | @end ignore | 850 | @end ignore |
diff --git a/man/programs.texi b/man/programs.texi index 643e6445fb0..9ec4f7ff2d3 100644 --- a/man/programs.texi +++ b/man/programs.texi | |||
| @@ -41,7 +41,6 @@ Highlight program syntax (@pxref{Font Lock}). | |||
| 41 | * Misc for Programs:: Other Emacs features useful for editing programs. | 41 | * Misc for Programs:: Other Emacs features useful for editing programs. |
| 42 | * C Modes:: Special commands of C, C++, Objective-C, | 42 | * C Modes:: Special commands of C, C++, Objective-C, |
| 43 | Java, and Pike modes. | 43 | Java, and Pike modes. |
| 44 | * Fortran:: Fortran mode and its special features. | ||
| 45 | * Asm Mode:: Asm mode and its special features. | 44 | * Asm Mode:: Asm mode and its special features. |
| 46 | @end menu | 45 | @end menu |
| 47 | 46 | ||
| @@ -109,7 +108,8 @@ tab character before point, in these modes. | |||
| 109 | Separate manuals are available for the modes for Ada (@pxref{Top, , Ada | 108 | Separate manuals are available for the modes for Ada (@pxref{Top, , Ada |
| 110 | Mode, ada-mode, Ada Mode}), C/C++/Objective C/Java/Corba IDL/Pike/AWK | 109 | Mode, ada-mode, Ada Mode}), C/C++/Objective C/Java/Corba IDL/Pike/AWK |
| 111 | (@pxref{Top, , CC Mode, ccmode, CC Mode}) and the IDLWAVE modes | 110 | (@pxref{Top, , CC Mode, ccmode, CC Mode}) and the IDLWAVE modes |
| 112 | (@pxref{Top, , IDLWAVE, idlwave, IDLWAVE User Manual}). | 111 | (@pxref{Top, , IDLWAVE, idlwave, IDLWAVE User Manual}). For Fortran |
| 112 | mode, @inforef{Fortran,, emacs-xtra}. | ||
| 113 | 113 | ||
| 114 | @cindex mode hook | 114 | @cindex mode hook |
| 115 | @vindex c-mode-hook | 115 | @vindex c-mode-hook |
| @@ -1715,521 +1715,6 @@ to a C/C++ source file, or vice versa. The variable | |||
| 1715 | names. | 1715 | names. |
| 1716 | @end table | 1716 | @end table |
| 1717 | 1717 | ||
| 1718 | @node Fortran | ||
| 1719 | @section Fortran Mode | ||
| 1720 | @cindex Fortran mode | ||
| 1721 | @cindex mode, Fortran | ||
| 1722 | |||
| 1723 | Fortran mode provides special motion commands for Fortran statements | ||
| 1724 | and subprograms, and indentation commands that understand Fortran | ||
| 1725 | conventions of nesting, line numbers and continuation statements. | ||
| 1726 | Fortran mode has support for Auto Fill mode that breaks long lines into | ||
| 1727 | proper Fortran continuation lines. | ||
| 1728 | |||
| 1729 | Special commands for comments are provided because Fortran comments | ||
| 1730 | are unlike those of other languages. Built-in abbrevs optionally save | ||
| 1731 | typing when you insert Fortran keywords. | ||
| 1732 | |||
| 1733 | Use @kbd{M-x fortran-mode} to switch to this major mode. This command | ||
| 1734 | runs the hook @code{fortran-mode-hook} (@pxref{Hooks}). | ||
| 1735 | |||
| 1736 | @cindex Fortran77 and Fortran90 | ||
| 1737 | @findex f90-mode | ||
| 1738 | @findex fortran-mode | ||
| 1739 | Fortran mode is meant for editing Fortran77 ``fixed format'' (and also | ||
| 1740 | ``tab format'') source code. For editing the modern Fortran90 or | ||
| 1741 | Fortran95 ``free format'' source code, use F90 mode (@code{f90-mode}). | ||
| 1742 | Emacs normally uses Fortran mode for files with extension @samp{.f}, | ||
| 1743 | @samp{.F} or @samp{.for}, and F90 mode for the extension @samp{.f90} and | ||
| 1744 | @samp{.f95}. GNU Fortran supports both kinds of format. | ||
| 1745 | |||
| 1746 | @menu | ||
| 1747 | * Motion: Fortran Motion. Moving point by statements or subprograms. | ||
| 1748 | * Indent: Fortran Indent. Indentation commands for Fortran. | ||
| 1749 | * Comments: Fortran Comments. Inserting and aligning comments. | ||
| 1750 | * Autofill: Fortran Autofill. Auto fill support for Fortran. | ||
| 1751 | * Columns: Fortran Columns. Measuring columns for valid Fortran. | ||
| 1752 | * Abbrev: Fortran Abbrev. Built-in abbrevs for Fortran keywords. | ||
| 1753 | @end menu | ||
| 1754 | |||
| 1755 | @node Fortran Motion | ||
| 1756 | @subsection Motion Commands | ||
| 1757 | |||
| 1758 | In addition to the normal commands for moving by and operating on | ||
| 1759 | ``defuns'' (Fortran subprograms---functions and subroutines, as well as | ||
| 1760 | modules for F90 mode), Fortran mode provides special commands to move by | ||
| 1761 | statements and other program units. | ||
| 1762 | |||
| 1763 | @table @kbd | ||
| 1764 | @kindex C-c C-n @r{(Fortran mode)} | ||
| 1765 | @findex fortran-next-statement | ||
| 1766 | @findex f90-next-statement | ||
| 1767 | @item C-c C-n | ||
| 1768 | Move to the beginning of the next statement | ||
| 1769 | (@code{fortran-next-statement}/@code{f90-next-statement}). | ||
| 1770 | |||
| 1771 | @kindex C-c C-p @r{(Fortran mode)} | ||
| 1772 | @findex fortran-previous-statement | ||
| 1773 | @findex f90-previous-statement | ||
| 1774 | @item C-c C-p | ||
| 1775 | Move to the beginning of the previous statement | ||
| 1776 | (@code{fortran-previous-statement}/@code{f90-previous-statement}). | ||
| 1777 | If there is no previous statement (i.e. if called from the first | ||
| 1778 | statement in the buffer), move to the start of the buffer. | ||
| 1779 | |||
| 1780 | @kindex C-c C-e @r{(F90 mode)} | ||
| 1781 | @findex f90-next-block | ||
| 1782 | @item C-c C-e | ||
| 1783 | Move point forward to the start of the next code block | ||
| 1784 | (@code{f90-next-block}). A code block is a subroutine, | ||
| 1785 | @code{if}--@code{endif} statement, and so forth. This command exists | ||
| 1786 | for F90 mode only, not Fortran mode. With a numeric argument, this | ||
| 1787 | moves forward that many blocks. | ||
| 1788 | |||
| 1789 | @kindex C-c C-a @r{(F90 mode)} | ||
| 1790 | @findex f90-previous-block | ||
| 1791 | @item C-c C-a | ||
| 1792 | Move point backward to the previous code block | ||
| 1793 | (@code{f90-previous-block}). This is like @code{f90-next-block}, but | ||
| 1794 | moves backwards. | ||
| 1795 | |||
| 1796 | @kindex C-M-n @r{(Fortran mode)} | ||
| 1797 | @findex fortran-end-of-block | ||
| 1798 | @findex f90-end-of-block | ||
| 1799 | @item C-M-n | ||
| 1800 | Move to the end of the current code block | ||
| 1801 | (@code{fortran-end-of-block}/@code{f90-end-of-block}). With a numeric | ||
| 1802 | agument, move forward that number of blocks. The mark is set before | ||
| 1803 | moving point. The F90 mode version of this command checks for | ||
| 1804 | consistency of block types and labels (if present), but it does not | ||
| 1805 | check the outermost block since that may be incomplete. | ||
| 1806 | |||
| 1807 | @kindex C-M-p @r{(Fortran mode)} | ||
| 1808 | @findex fortran-beginning-of-block | ||
| 1809 | @findex f90-beginning-of-block | ||
| 1810 | @item C-M-p | ||
| 1811 | Move to the start of the current code block | ||
| 1812 | (@code{fortran-beginning-of-block}/@code{f90-beginning-of-block}). This | ||
| 1813 | is like @code{fortran-end-of-block}, but moves backwards. | ||
| 1814 | @end table | ||
| 1815 | |||
| 1816 | @node Fortran Indent | ||
| 1817 | @subsection Fortran Indentation | ||
| 1818 | |||
| 1819 | Special commands and features are needed for indenting Fortran code in | ||
| 1820 | order to make sure various syntactic entities (line numbers, comment line | ||
| 1821 | indicators and continuation line flags) appear in the columns that are | ||
| 1822 | required for standard, fixed (or tab) format Fortran. | ||
| 1823 | |||
| 1824 | @menu | ||
| 1825 | * Commands: ForIndent Commands. Commands for indenting and filling Fortran. | ||
| 1826 | * Contline: ForIndent Cont. How continuation lines indent. | ||
| 1827 | * Numbers: ForIndent Num. How line numbers auto-indent. | ||
| 1828 | * Conv: ForIndent Conv. Conventions you must obey to avoid trouble. | ||
| 1829 | * Vars: ForIndent Vars. Variables controlling Fortran indent style. | ||
| 1830 | @end menu | ||
| 1831 | |||
| 1832 | @node ForIndent Commands | ||
| 1833 | @subsubsection Fortran Indentation and Filling Commands | ||
| 1834 | |||
| 1835 | @table @kbd | ||
| 1836 | @item C-M-j | ||
| 1837 | Break the current line at point and set up a continuation line | ||
| 1838 | (@code{fortran-split-line}). | ||
| 1839 | @item M-^ | ||
| 1840 | Join this line to the previous line (@code{fortran-join-line}). | ||
| 1841 | @item C-M-q | ||
| 1842 | Indent all the lines of the subprogram point is in | ||
| 1843 | (@code{fortran-indent-subprogram}). | ||
| 1844 | @item M-q | ||
| 1845 | Fill a comment block or statement. | ||
| 1846 | @end table | ||
| 1847 | |||
| 1848 | @kindex C-M-q @r{(Fortran mode)} | ||
| 1849 | @findex fortran-indent-subprogram | ||
| 1850 | The key @kbd{C-M-q} runs @code{fortran-indent-subprogram}, a command | ||
| 1851 | to reindent all the lines of the Fortran subprogram (function or | ||
| 1852 | subroutine) containing point. | ||
| 1853 | |||
| 1854 | @kindex C-M-j @r{(Fortran mode)} | ||
| 1855 | @findex fortran-split-line | ||
| 1856 | The key @kbd{C-M-j} runs @code{fortran-split-line}, which splits | ||
| 1857 | a line in the appropriate fashion for Fortran. In a non-comment line, | ||
| 1858 | the second half becomes a continuation line and is indented | ||
| 1859 | accordingly. In a comment line, both halves become separate comment | ||
| 1860 | lines. | ||
| 1861 | |||
| 1862 | @kindex M-^ @r{(Fortran mode)} | ||
| 1863 | @kindex C-c C-d @r{(Fortran mode)} | ||
| 1864 | @findex fortran-join-line | ||
| 1865 | @kbd{M-^} or @kbd{C-c C-d} runs the command @code{fortran-join-line}, | ||
| 1866 | which joins a continuation line back to the previous line, roughly as | ||
| 1867 | the inverse of @code{fortran-split-line}. The point must be on a | ||
| 1868 | continuation line when this command is invoked. | ||
| 1869 | |||
| 1870 | @kindex M-q @r{(Fortran mode)} | ||
| 1871 | @kbd{M-q} in Fortran mode fills the comment block or statement that | ||
| 1872 | point is in. This removes any excess statement continuations. | ||
| 1873 | |||
| 1874 | @node ForIndent Cont | ||
| 1875 | @subsubsection Continuation Lines | ||
| 1876 | @cindex Fortran continuation lines | ||
| 1877 | |||
| 1878 | @vindex fortran-continuation-string | ||
| 1879 | Most Fortran77 compilers allow two ways of writing continuation lines. | ||
| 1880 | If the first non-space character on a line is in column 5, then that | ||
| 1881 | line is a continuation of the previous line. We call this @dfn{fixed | ||
| 1882 | format}. (In GNU Emacs we always count columns from 0; but note that | ||
| 1883 | the Fortran standard counts from 1.) The variable | ||
| 1884 | @code{fortran-continuation-string} specifies what character to put in | ||
| 1885 | column 5. A line that starts with a tab character followed by any digit | ||
| 1886 | except @samp{0} is also a continuation line. We call this style of | ||
| 1887 | continuation @dfn{tab format}. (Fortran90 introduced ``free format'', | ||
| 1888 | with another style of continuation lines). | ||
| 1889 | |||
| 1890 | @vindex indent-tabs-mode @r{(Fortran mode)} | ||
| 1891 | @vindex fortran-analyze-depth | ||
| 1892 | @vindex fortran-tab-mode-default | ||
| 1893 | Fortran mode can use either style of continuation line. When you | ||
| 1894 | enter Fortran mode, it tries to deduce the proper continuation style | ||
| 1895 | automatically from the buffer contents. It does this by scanning up to | ||
| 1896 | @code{fortran-analyze-depth} (default 100) lines from the start of the | ||
| 1897 | buffer. The first line that begins with either a tab character or six | ||
| 1898 | spaces determines the choice. If the scan fails (for example, if the | ||
| 1899 | buffer is new and therefore empty), the value of | ||
| 1900 | @code{fortran-tab-mode-default} (@code{nil} for fixed format, and | ||
| 1901 | non-@code{nil} for tab format) is used. @samp{/t} in the mode line | ||
| 1902 | indicates tab format is selected. Fortran mode sets the value of | ||
| 1903 | @code{indent-tabs-mode} accordingly (@pxref{Just Spaces}). | ||
| 1904 | |||
| 1905 | If the text on a line starts with the Fortran continuation marker | ||
| 1906 | @samp{$}, or if it begins with any non-whitespace character in column | ||
| 1907 | 5, Fortran mode treats it as a continuation line. When you indent a | ||
| 1908 | continuation line with @key{TAB}, it converts the line to the current | ||
| 1909 | continuation style. When you split a Fortran statement with | ||
| 1910 | @kbd{C-M-j}, the continuation marker on the newline is created according | ||
| 1911 | to the continuation style. | ||
| 1912 | |||
| 1913 | The setting of continuation style affects several other aspects of | ||
| 1914 | editing in Fortran mode. In fixed format mode, the minimum column | ||
| 1915 | number for the body of a statement is 6. Lines inside of Fortran | ||
| 1916 | blocks that are indented to larger column numbers always use only the | ||
| 1917 | space character for whitespace. In tab format mode, the minimum | ||
| 1918 | column number for the statement body is 8, and the whitespace before | ||
| 1919 | column 8 must always consist of one tab character. | ||
| 1920 | |||
| 1921 | @node ForIndent Num | ||
| 1922 | @subsubsection Line Numbers | ||
| 1923 | |||
| 1924 | If a number is the first non-whitespace in the line, Fortran | ||
| 1925 | indentation assumes it is a line number and moves it to columns 0 | ||
| 1926 | through 4. (Columns always count from 0 in GNU Emacs.) | ||
| 1927 | |||
| 1928 | @vindex fortran-line-number-indent | ||
| 1929 | Line numbers of four digits or less are normally indented one space. | ||
| 1930 | The variable @code{fortran-line-number-indent} controls this; it | ||
| 1931 | specifies the maximum indentation a line number can have. The default | ||
| 1932 | value of the variable is 1. Fortran mode tries to prevent line number | ||
| 1933 | digits passing column 4, reducing the indentation below the specified | ||
| 1934 | maximum if necessary. If @code{fortran-line-number-indent} has the | ||
| 1935 | value 5, line numbers are right-justified to end in column 4. | ||
| 1936 | |||
| 1937 | @vindex fortran-electric-line-number | ||
| 1938 | Simply inserting a line number is enough to indent it according to | ||
| 1939 | these rules. As each digit is inserted, the indentation is recomputed. | ||
| 1940 | To turn off this feature, set the variable | ||
| 1941 | @code{fortran-electric-line-number} to @code{nil}. | ||
| 1942 | |||
| 1943 | |||
| 1944 | @node ForIndent Conv | ||
| 1945 | @subsubsection Syntactic Conventions | ||
| 1946 | |||
| 1947 | Fortran mode assumes that you follow certain conventions that simplify | ||
| 1948 | the task of understanding a Fortran program well enough to indent it | ||
| 1949 | properly: | ||
| 1950 | |||
| 1951 | @itemize @bullet | ||
| 1952 | @item | ||
| 1953 | Two nested @samp{do} loops never share a @samp{continue} statement. | ||
| 1954 | |||
| 1955 | @item | ||
| 1956 | Fortran keywords such as @samp{if}, @samp{else}, @samp{then}, @samp{do} | ||
| 1957 | and others are written without embedded whitespace or line breaks. | ||
| 1958 | |||
| 1959 | Fortran compilers generally ignore whitespace outside of string | ||
| 1960 | constants, but Fortran mode does not recognize these keywords if they | ||
| 1961 | are not contiguous. Constructs such as @samp{else if} or @samp{end do} | ||
| 1962 | are acceptable, but the second word should be on the same line as the | ||
| 1963 | first and not on a continuation line. | ||
| 1964 | @end itemize | ||
| 1965 | |||
| 1966 | @noindent | ||
| 1967 | If you fail to follow these conventions, the indentation commands may | ||
| 1968 | indent some lines unaesthetically. However, a correct Fortran program | ||
| 1969 | retains its meaning when reindented even if the conventions are not | ||
| 1970 | followed. | ||
| 1971 | |||
| 1972 | @node ForIndent Vars | ||
| 1973 | @subsubsection Variables for Fortran Indentation | ||
| 1974 | |||
| 1975 | @vindex fortran-do-indent | ||
| 1976 | @vindex fortran-if-indent | ||
| 1977 | @vindex fortran-structure-indent | ||
| 1978 | @vindex fortran-continuation-indent | ||
| 1979 | @vindex fortran-check-all-num@dots{} | ||
| 1980 | @vindex fortran-minimum-statement-indent@dots{} | ||
| 1981 | Several additional variables control how Fortran indentation works: | ||
| 1982 | |||
| 1983 | @table @code | ||
| 1984 | @item fortran-do-indent | ||
| 1985 | Extra indentation within each level of @samp{do} statement (default 3). | ||
| 1986 | |||
| 1987 | @item fortran-if-indent | ||
| 1988 | Extra indentation within each level of @samp{if}, @samp{select case}, or | ||
| 1989 | @samp{where} statements (default 3). | ||
| 1990 | |||
| 1991 | @item fortran-structure-indent | ||
| 1992 | Extra indentation within each level of @samp{structure}, @samp{union}, | ||
| 1993 | @samp{map}, or @samp{interface} statements (default 3). | ||
| 1994 | |||
| 1995 | @item fortran-continuation-indent | ||
| 1996 | Extra indentation for bodies of continuation lines (default 5). | ||
| 1997 | |||
| 1998 | @item fortran-check-all-num-for-matching-do | ||
| 1999 | In Fortran77, a numbered @samp{do} statement is ended by any statement | ||
| 2000 | with a matching line number. It is common (but not compulsory) to use a | ||
| 2001 | @samp{continue} statement for this purpose. If this variable has a | ||
| 2002 | non-@code{nil} value, indenting any numbered statement must check for a | ||
| 2003 | @samp{do} that ends there. If you always end @samp{do} statements with | ||
| 2004 | a @samp{continue} line (or if you use the more modern @samp{enddo}), | ||
| 2005 | then you can speed up indentation by setting this variable to | ||
| 2006 | @code{nil}. The default is @code{nil}. | ||
| 2007 | |||
| 2008 | @item fortran-blink-matching-if | ||
| 2009 | If this is @code{t}, indenting an @samp{endif} (or @samp{enddo} | ||
| 2010 | statement moves the cursor momentarily to the matching @samp{if} (or | ||
| 2011 | @samp{do}) statement to show where it is. The default is @code{nil}. | ||
| 2012 | |||
| 2013 | @item fortran-minimum-statement-indent-fixed | ||
| 2014 | Minimum indentation for Fortran statements when using fixed format | ||
| 2015 | continuation line style. Statement bodies are never indented less than | ||
| 2016 | this much. The default is 6. | ||
| 2017 | |||
| 2018 | @item fortran-minimum-statement-indent-tab | ||
| 2019 | Minimum indentation for Fortran statements for tab format continuation line | ||
| 2020 | style. Statement bodies are never indented less than this much. The | ||
| 2021 | default is 8. | ||
| 2022 | @end table | ||
| 2023 | |||
| 2024 | The variables controlling the indentation of comments are described in | ||
| 2025 | the following section. | ||
| 2026 | |||
| 2027 | @node Fortran Comments | ||
| 2028 | @subsection Fortran Comments | ||
| 2029 | |||
| 2030 | The usual Emacs comment commands assume that a comment can follow a | ||
| 2031 | line of code. In Fortran77, the standard comment syntax requires an | ||
| 2032 | entire line to be just a comment. Therefore, Fortran mode replaces the | ||
| 2033 | standard Emacs comment commands and defines some new variables. | ||
| 2034 | |||
| 2035 | @vindex fortran-comment-line-start | ||
| 2036 | Fortran mode can also handle the Fortran90 comment syntax where comments | ||
| 2037 | start with @samp{!} and can follow other text. Because only some Fortran77 | ||
| 2038 | compilers accept this syntax, Fortran mode will not insert such comments | ||
| 2039 | unless you have said in advance to do so. To do this, set the variable | ||
| 2040 | @code{fortran-comment-line-start} to @samp{"!"}. | ||
| 2041 | |||
| 2042 | @table @kbd | ||
| 2043 | @item M-; | ||
| 2044 | Align comment or insert new comment (@code{fortran-indent-comment}). | ||
| 2045 | |||
| 2046 | @item C-x ; | ||
| 2047 | Applies to nonstandard @samp{!} comments only. | ||
| 2048 | |||
| 2049 | @item C-c ; | ||
| 2050 | Turn all lines of the region into comments, or (with argument) turn them back | ||
| 2051 | into real code (@code{fortran-comment-region}). | ||
| 2052 | @end table | ||
| 2053 | |||
| 2054 | @findex fortran-indent-comment | ||
| 2055 | @kbd{M-;} in Fortran mode is redefined as the command | ||
| 2056 | @code{fortran-indent-comment}. Like the usual @kbd{M-;} command, this | ||
| 2057 | recognizes any kind of existing comment and aligns its text appropriately; | ||
| 2058 | if there is no existing comment, a comment is inserted and aligned. But | ||
| 2059 | inserting and aligning comments are not the same in Fortran mode as in | ||
| 2060 | other modes. | ||
| 2061 | |||
| 2062 | When a new comment must be inserted, if the current line is blank, a | ||
| 2063 | full-line comment is inserted. On a non-blank line, a nonstandard @samp{!} | ||
| 2064 | comment is inserted if you have said you want to use them. Otherwise a | ||
| 2065 | full-line comment is inserted on a new line before the current line. | ||
| 2066 | |||
| 2067 | Nonstandard @samp{!} comments are aligned like comments in other | ||
| 2068 | languages, but full-line comments are different. In a standard full-line | ||
| 2069 | comment, the comment delimiter itself must always appear in column zero. | ||
| 2070 | What can be aligned is the text within the comment. You can choose from | ||
| 2071 | three styles of alignment by setting the variable | ||
| 2072 | @code{fortran-comment-indent-style} to one of these values: | ||
| 2073 | |||
| 2074 | @vindex fortran-comment-indent-style | ||
| 2075 | @vindex fortran-comment-line-extra-indent | ||
| 2076 | @table @code | ||
| 2077 | @item fixed | ||
| 2078 | Align the text at a fixed column, which is the sum of | ||
| 2079 | @code{fortran-comment-line-extra-indent} and the minimum statement | ||
| 2080 | indentation. This is the default. | ||
| 2081 | |||
| 2082 | The minimum statement indentation is | ||
| 2083 | @code{fortran-minimum-statement-indent-fixed} for fixed format | ||
| 2084 | continuation line style and @code{fortran-minimum-statement-indent-tab} | ||
| 2085 | for tab format style. | ||
| 2086 | |||
| 2087 | @item relative | ||
| 2088 | Align the text as if it were a line of code, but with an additional | ||
| 2089 | @code{fortran-comment-line-extra-indent} columns of indentation. | ||
| 2090 | |||
| 2091 | @item nil | ||
| 2092 | Don't move text in full-line comments automatically. | ||
| 2093 | @end table | ||
| 2094 | |||
| 2095 | @vindex fortran-comment-indent-char | ||
| 2096 | In addition, you can specify the character to be used to indent within | ||
| 2097 | full-line comments by setting the variable | ||
| 2098 | @code{fortran-comment-indent-char} to the single-character string you want | ||
| 2099 | to use. | ||
| 2100 | |||
| 2101 | @vindex fortran-directive-re | ||
| 2102 | Compiler directive lines, or preprocessor lines, have much the same | ||
| 2103 | appearance as comment lines. It is important, though, that such lines | ||
| 2104 | never be indented at all, no matter what the value of | ||
| 2105 | @code{fortran-comment-indent-style}. The variable | ||
| 2106 | @code{fortran-directive-re} is a regular expression that specifies which | ||
| 2107 | lines are directives. Matching lines are never indented, and receive | ||
| 2108 | distinctive font-locking. | ||
| 2109 | |||
| 2110 | The normal Emacs comment command @kbd{C-x ;} has not been redefined. If | ||
| 2111 | you use @samp{!} comments, this command can be used with them. Otherwise | ||
| 2112 | it is useless in Fortran mode. | ||
| 2113 | |||
| 2114 | @kindex C-c ; @r{(Fortran mode)} | ||
| 2115 | @findex fortran-comment-region | ||
| 2116 | @vindex fortran-comment-region | ||
| 2117 | The command @kbd{C-c ;} (@code{fortran-comment-region}) turns all the | ||
| 2118 | lines of the region into comments by inserting the string @samp{C$$$} at | ||
| 2119 | the front of each one. With a numeric argument, it turns the region | ||
| 2120 | back into live code by deleting @samp{C$$$} from the front of each line | ||
| 2121 | in it. The string used for these comments can be controlled by setting | ||
| 2122 | the variable @code{fortran-comment-region}. Note that here we have an | ||
| 2123 | example of a command and a variable with the same name; these two uses | ||
| 2124 | of the name never conflict because in Lisp and in Emacs it is always | ||
| 2125 | clear from the context which one is meant. | ||
| 2126 | |||
| 2127 | @node Fortran Autofill | ||
| 2128 | @subsection Auto Fill in Fortran Mode | ||
| 2129 | |||
| 2130 | Fortran mode has specialized support for Auto Fill mode, which is a | ||
| 2131 | minor mode that automatically splits statements as you insert them when | ||
| 2132 | they become too wide. Splitting a statement involves making | ||
| 2133 | continuation lines using @code{fortran-continuation-string} | ||
| 2134 | (@pxref{ForIndent Cont}). This splitting happens when you type | ||
| 2135 | @key{SPC}, @key{RET}, or @key{TAB}, and also in the Fortran indentation | ||
| 2136 | commands. You activate Auto Fill in Fortran mode in the normal way | ||
| 2137 | (@pxref{Auto Fill}). | ||
| 2138 | |||
| 2139 | @vindex fortran-break-before-delimiters | ||
| 2140 | Auto Fill breaks lines at spaces or delimiters when the lines get | ||
| 2141 | longer than the desired width (the value of @code{fill-column}). The | ||
| 2142 | delimiters (besides whitespace) that Auto Fill can break at are | ||
| 2143 | @samp{+}, @samp{-}, @samp{/}, @samp{*}, @samp{=}, @samp{<}, @samp{>}, | ||
| 2144 | and @samp{,}. The line break comes after the delimiter if the | ||
| 2145 | variable @code{fortran-break-before-delimiters} is @code{nil}. | ||
| 2146 | Otherwise (and by default), the break comes before the delimiter. | ||
| 2147 | |||
| 2148 | To enable Auto Fill in all Fortran buffers, add | ||
| 2149 | @code{turn-on-auto-fill} to @code{fortran-mode-hook}. @xref{Hooks}. | ||
| 2150 | |||
| 2151 | @node Fortran Columns | ||
| 2152 | @subsection Checking Columns in Fortran | ||
| 2153 | |||
| 2154 | @table @kbd | ||
| 2155 | @item C-c C-r | ||
| 2156 | Display a ``column ruler'' momentarily above the current line | ||
| 2157 | (@code{fortran-column-ruler}). | ||
| 2158 | @item C-c C-w | ||
| 2159 | Split the current window horizontally temporarily so that it is 72 | ||
| 2160 | columns wide (@code{fortran-window-create-momentarily}). This may | ||
| 2161 | help you avoid making lines longer than the 72-character limit that | ||
| 2162 | some Fortran compilers impose. | ||
| 2163 | @item C-u C-c C-w | ||
| 2164 | Split the current window horizontally so that it is 72 columns wide | ||
| 2165 | (@code{fortran-window-create}). You can then continue editing. | ||
| 2166 | @item M-x fortran-strip-sequence-nos | ||
| 2167 | Delete all text in column 72 and beyond. | ||
| 2168 | @end table | ||
| 2169 | |||
| 2170 | @kindex C-c C-r @r{(Fortran mode)} | ||
| 2171 | @findex fortran-column-ruler | ||
| 2172 | The command @kbd{C-c C-r} (@code{fortran-column-ruler}) shows a column | ||
| 2173 | ruler momentarily above the current line. The comment ruler is two lines | ||
| 2174 | of text that show you the locations of columns with special significance in | ||
| 2175 | Fortran programs. Square brackets show the limits of the columns for line | ||
| 2176 | numbers, and curly brackets show the limits of the columns for the | ||
| 2177 | statement body. Column numbers appear above them. | ||
| 2178 | |||
| 2179 | Note that the column numbers count from zero, as always in GNU Emacs. | ||
| 2180 | As a result, the numbers may be one less than those you are familiar | ||
| 2181 | with; but the positions they indicate in the line are standard for | ||
| 2182 | Fortran. | ||
| 2183 | |||
| 2184 | @vindex fortran-column-ruler-fixed | ||
| 2185 | @vindex fortran-column-ruler-tabs | ||
| 2186 | The text used to display the column ruler depends on the value of the | ||
| 2187 | variable @code{indent-tabs-mode}. If @code{indent-tabs-mode} is | ||
| 2188 | @code{nil}, then the value of the variable | ||
| 2189 | @code{fortran-column-ruler-fixed} is used as the column ruler. | ||
| 2190 | Otherwise, the value of the variable @code{fortran-column-ruler-tab} is | ||
| 2191 | displayed. By changing these variables, you can change the column ruler | ||
| 2192 | display. | ||
| 2193 | |||
| 2194 | @kindex C-c C-w @r{(Fortran mode)} | ||
| 2195 | @findex fortran-window-create-momentarily | ||
| 2196 | @kbd{C-c C-w} (@code{fortran-window-create-momentarily}) temporarily | ||
| 2197 | splits the current window horizontally, making a window 72 columns | ||
| 2198 | wide, so you can see any lines that are too long. Type a space to | ||
| 2199 | restore the normal width. | ||
| 2200 | |||
| 2201 | @kindex C-u C-c C-w @r{(Fortran mode)} | ||
| 2202 | @findex fortran-window-create | ||
| 2203 | You can also split the window horizontally and continue editing with | ||
| 2204 | the split in place. To do this, use @kbd{C-u C-c C-w} (@code{M-x | ||
| 2205 | fortran-window-create}). By editing in this window you can | ||
| 2206 | immediately see when you make a line too wide to be correct Fortran. | ||
| 2207 | |||
| 2208 | @findex fortran-strip-sequence-nos | ||
| 2209 | The command @kbd{M-x fortran-strip-sequence-nos} deletes all text in | ||
| 2210 | column 72 and beyond, on all lines in the current buffer. This is the | ||
| 2211 | easiest way to get rid of old sequence numbers. | ||
| 2212 | |||
| 2213 | @node Fortran Abbrev | ||
| 2214 | @subsection Fortran Keyword Abbrevs | ||
| 2215 | |||
| 2216 | Fortran mode provides many built-in abbrevs for common keywords and | ||
| 2217 | declarations. These are the same sort of abbrev that you can define | ||
| 2218 | yourself. To use them, you must turn on Abbrev mode. @xref{Abbrevs}. | ||
| 2219 | |||
| 2220 | The built-in abbrevs are unusual in one way: they all start with a | ||
| 2221 | semicolon. You cannot normally use semicolon in an abbrev, but Fortran | ||
| 2222 | mode makes this possible by changing the syntax of semicolon to ``word | ||
| 2223 | constituent.'' | ||
| 2224 | |||
| 2225 | For example, one built-in Fortran abbrev is @samp{;c} for | ||
| 2226 | @samp{continue}. If you insert @samp{;c} and then insert a punctuation | ||
| 2227 | character such as a space or a newline, the @samp{;c} expands automatically | ||
| 2228 | to @samp{continue}, provided Abbrev mode is enabled.@refill | ||
| 2229 | |||
| 2230 | Type @samp{;?} or @samp{;C-h} to display a list of all the built-in | ||
| 2231 | Fortran abbrevs and what they stand for. | ||
| 2232 | |||
| 2233 | @node Asm Mode | 1718 | @node Asm Mode |
| 2234 | @section Asm Mode | 1719 | @section Asm Mode |
| 2235 | 1720 | ||
diff --git a/man/sending.texi b/man/sending.texi index 2fbf9a189c7..299787e529c 100644 --- a/man/sending.texi +++ b/man/sending.texi | |||
| @@ -2,7 +2,7 @@ | |||
| 2 | @c Copyright (C) 1985, 1986, 1987, 1993, 1994, 1995, 1997, 2000, 2001, 2002, | 2 | @c Copyright (C) 1985, 1986, 1987, 1993, 1994, 1995, 1997, 2000, 2001, 2002, |
| 3 | @c 2003, 2004, 2005, 2006 Free Software Foundation, Inc. | 3 | @c 2003, 2004, 2005, 2006 Free Software Foundation, Inc. |
| 4 | @c See file emacs.texi for copying conditions. | 4 | @c See file emacs.texi for copying conditions. |
| 5 | @node Sending Mail, Rmail, Picture, Top | 5 | @node Sending Mail, Rmail, Abbrevs, Top |
| 6 | @chapter Sending Mail | 6 | @chapter Sending Mail |
| 7 | @cindex sending mail | 7 | @cindex sending mail |
| 8 | @cindex mail | 8 | @cindex mail |
diff --git a/man/text.texi b/man/text.texi index 2b70c599b89..cf3d03af4d5 100644 --- a/man/text.texi +++ b/man/text.texi | |||
| @@ -51,6 +51,12 @@ Then the formatting appears on the screen in Emacs while you edit. | |||
| 51 | @xref{Formatted Text}. | 51 | @xref{Formatted Text}. |
| 52 | @end iftex | 52 | @end iftex |
| 53 | 53 | ||
| 54 | @cindex ASCII art | ||
| 55 | If you need to edit pictures made out of text characters (commonly | ||
| 56 | referred to as ``ASCII art''), use @kbd{M-x edit-picture} to enter | ||
| 57 | Picture mode, a special major mode for editing such pictures. | ||
| 58 | @inforef{Picture Mode,, emacs-xtra}. | ||
| 59 | |||
| 54 | @cindex skeletons | 60 | @cindex skeletons |
| 55 | @cindex templates | 61 | @cindex templates |
| 56 | @cindex autotyping | 62 | @cindex autotyping |