diff options
| author | Glenn Morris | 2012-11-10 15:13:33 -0800 |
|---|---|---|
| committer | Glenn Morris | 2012-11-10 15:13:33 -0800 |
| commit | 6baf66d53bbedd85a443e0d69d1f4311a93f0677 (patch) | |
| tree | 38d7a00d5f7d5aecb86285d334fa15a31e5fbab1 /doc | |
| parent | 05a859c1bd9cd07b2c0fad06a0694e88ea929fcf (diff) | |
| parent | e4e46889223296e8875548d278340b21db449a4a (diff) | |
| download | emacs-6baf66d53bbedd85a443e0d69d1f4311a93f0677.tar.gz emacs-6baf66d53bbedd85a443e0d69d1f4311a93f0677.zip | |
Merge from emacs-24; up to 2012-11-08T14:54:03Z!monnier@iro.umontreal.ca
Diffstat (limited to 'doc')
| -rw-r--r-- | doc/emacs/ChangeLog | 43 | ||||
| -rw-r--r-- | doc/emacs/ack.texi | 8 | ||||
| -rw-r--r-- | doc/emacs/buffers.texi | 186 | ||||
| -rw-r--r-- | doc/emacs/dired.texi | 20 | ||||
| -rw-r--r-- | doc/emacs/display.texi | 28 | ||||
| -rw-r--r-- | doc/emacs/emacs.texi | 3 | ||||
| -rw-r--r-- | doc/emacs/files.texi | 23 | ||||
| -rw-r--r-- | doc/emacs/mini.texi | 54 | ||||
| -rw-r--r-- | doc/emacs/misc.texi | 48 | ||||
| -rw-r--r-- | doc/emacs/trouble.texi | 59 | ||||
| -rw-r--r-- | doc/lispref/ChangeLog | 36 | ||||
| -rw-r--r-- | doc/lispref/edebug.texi | 4 | ||||
| -rw-r--r-- | doc/lispref/elisp.texi | 7 | ||||
| -rw-r--r-- | doc/lispref/frames.texi | 14 | ||||
| -rw-r--r-- | doc/lispref/lists.texi | 44 | ||||
| -rw-r--r-- | doc/lispref/searching.texi | 27 | ||||
| -rw-r--r-- | doc/lispref/variables.texi | 119 | ||||
| -rw-r--r-- | doc/lispref/windows.texi | 528 | ||||
| -rw-r--r-- | doc/misc/ChangeLog | 29 | ||||
| -rw-r--r-- | doc/misc/cl.texi | 151 | ||||
| -rw-r--r-- | doc/misc/url.texi | 644 |
21 files changed, 1334 insertions, 741 deletions
diff --git a/doc/emacs/ChangeLog b/doc/emacs/ChangeLog index c7cbc78f910..f6d536a08d1 100644 --- a/doc/emacs/ChangeLog +++ b/doc/emacs/ChangeLog | |||
| @@ -1,3 +1,46 @@ | |||
| 1 | 2012-11-10 Glenn Morris <rgm@gnu.org> | ||
| 2 | |||
| 3 | * misc.texi (Terminal emulator): Rename `term-face' to `term'. | ||
| 4 | |||
| 5 | * emacs.texi (Acknowledgments): Add profiler author. | ||
| 6 | * ack.texi (Acknowledgments): Add some recent contributions. | ||
| 7 | |||
| 8 | 2012-11-10 Chong Yidong <cyd@gnu.org> | ||
| 9 | |||
| 10 | * files.texi (Diff Mode): Doc fixes for | ||
| 11 | diff-delete-trailing-whitespace (Bug#12831). | ||
| 12 | |||
| 13 | * trouble.texi (Crashing): Copyedits. | ||
| 14 | |||
| 15 | 2012-11-10 Glenn Morris <rgm@gnu.org> | ||
| 16 | |||
| 17 | * files.texi (Diff Mode): Trailing whitespace updates. | ||
| 18 | |||
| 19 | 2012-11-10 Chong Yidong <cyd@gnu.org> | ||
| 20 | |||
| 21 | * misc.texi (Terminal emulator): Document Term mode faces. | ||
| 22 | |||
| 23 | * mini.texi (Basic Minibuffer): New node. Document | ||
| 24 | minibuffer-electric-default-mode. | ||
| 25 | |||
| 26 | * display.texi (Visual Line Mode): Fix index entry. | ||
| 27 | |||
| 28 | * buffers.texi (Several Buffers): List Buffer Menu command anmes, | ||
| 29 | and index the keybindings. Document tabulated-list-sort. | ||
| 30 | (Kill Buffer): Capitalize Buffer Menu. | ||
| 31 | |||
| 32 | * trouble.texi (Memory Full): Capitalize Buffer Menu. | ||
| 33 | |||
| 34 | 2012-11-10 Eli Zaretskii <eliz@gnu.org> | ||
| 35 | |||
| 36 | * display.texi (Auto Scrolling): Clarify that scroll-step is | ||
| 37 | ignored when scroll-conservatively is set to a non-zero value. | ||
| 38 | (Bug#12801) | ||
| 39 | |||
| 40 | 2012-11-10 Chong Yidong <cyd@gnu.org> | ||
| 41 | |||
| 42 | * dired.texi (Dired Updating): Doc fix (Bug#11744). | ||
| 43 | |||
| 1 | 2012-10-30 Michael Albinus <michael.albinus@gmx.de> | 44 | 2012-10-30 Michael Albinus <michael.albinus@gmx.de> |
| 2 | 45 | ||
| 3 | * trouble.texi (Known Problems): Mention command `debbugs-gnu-usertags'. | 46 | * trouble.texi (Known Problems): Mention command `debbugs-gnu-usertags'. |
diff --git a/doc/emacs/ack.texi b/doc/emacs/ack.texi index 79710f4992b..9fdead70f8a 100644 --- a/doc/emacs/ack.texi +++ b/doc/emacs/ack.texi | |||
| @@ -244,8 +244,9 @@ files as ``thumbnails''. | |||
| 244 | 244 | ||
| 245 | @item | 245 | @item |
| 246 | Julien Danjou wrote an implementation of ``Desktop Notifications'' | 246 | Julien Danjou wrote an implementation of ``Desktop Notifications'' |
| 247 | (@file{notifications.el}); and @file{color.el}, a library for general | 247 | (@file{notifications.el}, and related packages for ERC and Gnus); |
| 248 | color manipulation. He also made various contributions to Gnus. | 248 | and @file{color.el}, a library for general color manipulation. |
| 249 | He also made various contributions to Gnus. | ||
| 249 | 250 | ||
| 250 | @item | 251 | @item |
| 251 | Vivek Dasmohapatra wrote @file{htmlfontify.el}, to convert a buffer or | 252 | Vivek Dasmohapatra wrote @file{htmlfontify.el}, to convert a buffer or |
| @@ -790,6 +791,9 @@ mode-sensitive insertion of text into new files. | |||
| 790 | Yukihiro Matsumoto and Nobuyoshi Nakada wrote Ruby-mode. | 791 | Yukihiro Matsumoto and Nobuyoshi Nakada wrote Ruby-mode. |
| 791 | 792 | ||
| 792 | @item | 793 | @item |
| 794 | Tomohiro Matsuyama wrote the native Elisp profiler. | ||
| 795 | |||
| 796 | @item | ||
| 793 | Thomas May wrote @file{blackbox.el}, a version of the traditional | 797 | Thomas May wrote @file{blackbox.el}, a version of the traditional |
| 794 | blackbox game. | 798 | blackbox game. |
| 795 | 799 | ||
diff --git a/doc/emacs/buffers.texi b/doc/emacs/buffers.texi index dfd8f792300..8c6705cc0c9 100644 --- a/doc/emacs/buffers.texi +++ b/doc/emacs/buffers.texi | |||
| @@ -309,7 +309,7 @@ whose names begin with a space, which are used internally by Emacs. | |||
| 309 | To kill internal buffers as well, call @code{kill-matching-buffers} | 309 | To kill internal buffers as well, call @code{kill-matching-buffers} |
| 310 | with a prefix argument. | 310 | with a prefix argument. |
| 311 | 311 | ||
| 312 | The buffer menu feature is also convenient for killing various | 312 | The Buffer Menu feature is also convenient for killing various |
| 313 | buffers. @xref{Several Buffers}. | 313 | buffers. @xref{Several Buffers}. |
| 314 | 314 | ||
| 315 | @vindex kill-buffer-hook | 315 | @vindex kill-buffer-hook |
| @@ -339,7 +339,7 @@ the Customization buffer to set the variable @code{midnight-mode} to | |||
| 339 | 339 | ||
| 340 | @node Several Buffers | 340 | @node Several Buffers |
| 341 | @section Operating on Several Buffers | 341 | @section Operating on Several Buffers |
| 342 | @cindex buffer menu | 342 | @cindex Buffer Menu |
| 343 | 343 | ||
| 344 | @table @kbd | 344 | @table @kbd |
| 345 | @item M-x buffer-menu | 345 | @item M-x buffer-menu |
| @@ -348,7 +348,7 @@ Begin editing a buffer listing all Emacs buffers. | |||
| 348 | Similar, but do it in another window. | 348 | Similar, but do it in another window. |
| 349 | @end table | 349 | @end table |
| 350 | 350 | ||
| 351 | The @dfn{buffer menu} opened by @kbd{C-x C-b} (@pxref{List Buffers}) | 351 | The @dfn{Buffer Menu} opened by @kbd{C-x C-b} (@pxref{List Buffers}) |
| 352 | does not merely list buffers. It also allows you to perform various | 352 | does not merely list buffers. It also allows you to perform various |
| 353 | operations on buffers, through an interface similar to Dired | 353 | operations on buffers, through an interface similar to Dired |
| 354 | (@pxref{Dired}). You can save buffers, kill them (here called | 354 | (@pxref{Dired}). You can save buffers, kill them (here called |
| @@ -356,106 +356,169 @@ operations on buffers, through an interface similar to Dired | |||
| 356 | 356 | ||
| 357 | @findex buffer-menu | 357 | @findex buffer-menu |
| 358 | @findex buffer-menu-other-window | 358 | @findex buffer-menu-other-window |
| 359 | To use the buffer menu, type @kbd{C-x C-b} and switch to the window | 359 | To use the Buffer Menu, type @kbd{C-x C-b} and switch to the window |
| 360 | displaying the @file{*Buffer List*} buffer. You can also type | 360 | displaying the @file{*Buffer List*} buffer. You can also type |
| 361 | @kbd{M-x buffer-menu} to open the buffer menu in the selected window. | 361 | @kbd{M-x buffer-menu} to open the Buffer Menu in the selected window. |
| 362 | Alternatively, the command @kbd{M-x buffer-menu-other-window} opens | 362 | Alternatively, the command @kbd{M-x buffer-menu-other-window} opens |
| 363 | the buffer menu in another window, and selects that window. | 363 | the Buffer Menu in another window, and selects that window. |
| 364 | 364 | ||
| 365 | The buffer menu is a read-only buffer, and can be changed only | 365 | The Buffer Menu is a read-only buffer, and can be changed only |
| 366 | through the special commands described in this section. The usual | 366 | through the special commands described in this section. The usual |
| 367 | cursor motion commands can be used in this buffer. The | 367 | cursor motion commands can be used in this buffer. The following |
| 368 | following commands apply to the buffer described on the current line: | 368 | commands apply to the buffer described on the current line: |
| 369 | 369 | ||
| 370 | @table @kbd | 370 | @table @kbd |
| 371 | @item d | 371 | @item d |
| 372 | Request to delete (kill) the buffer, then move down. The request | 372 | @findex Buffer-menu-delete |
| 373 | shows as a @samp{D} on the line, before the buffer name. Requested | 373 | @kindex d @r{(Buffer Menu)} |
| 374 | deletions take place when you type the @kbd{x} command. | 374 | Flag the buffer for deletion (killing), then move point to the next |
| 375 | line (@code{Buffer-menu-delete}). The deletion flag is indicated by | ||
| 376 | the character @samp{D} on the line, before the buffer name. The | ||
| 377 | deletion occurs only when you type the @kbd{x} command (see below). | ||
| 378 | |||
| 375 | @item C-d | 379 | @item C-d |
| 376 | Like @kbd{d} but move up afterwards instead of down. | 380 | @findex Buffer-menu-delete-backwards |
| 381 | @kindex C-d @r{(Buffer Menu)} | ||
| 382 | Like @kbd{d}, but move point up instead of down | ||
| 383 | (@code{Buffer-menu-delete-backwards}). | ||
| 384 | |||
| 377 | @item s | 385 | @item s |
| 378 | Request to save the buffer. The request shows as an @samp{S} on the | 386 | @findex Buffer-menu-save |
| 379 | line. Requested saves take place when you type the @kbd{x} command. | 387 | @kindex s @r{(Buffer Menu)} |
| 380 | You may request both saving and deletion for the same buffer. | 388 | Flag the buffer for saving (@code{Buffer-menu-save}). The save flag |
| 389 | is indicated by the character @samp{S} on the line, before the buffer | ||
| 390 | name. The saving occurs only when you type @kbd{x}. You may request | ||
| 391 | both saving and deletion for the same buffer. | ||
| 392 | |||
| 381 | @item x | 393 | @item x |
| 382 | Perform previously requested deletions and saves. | 394 | @findex Buffer-menu-execute |
| 395 | @kindex x @r{(Buffer Menu)} | ||
| 396 | Perform all flagged deletions and saves (@code{Buffer-menu-execute}). | ||
| 397 | |||
| 383 | @item u | 398 | @item u |
| 384 | Remove any request made for the current line, and move down. | 399 | @findex Buffer-menu-unmark |
| 400 | @kindex u @r{(Buffer Menu)} | ||
| 401 | Remove all flags from the current line, and move down | ||
| 402 | (@code{Buffer-menu-unmark}). | ||
| 403 | |||
| 385 | @item @key{DEL} | 404 | @item @key{DEL} |
| 386 | Move to previous line and remove any request made for that line. | 405 | @findex Buffer-menu-backup-unmark |
| 406 | @kindex DEL @r{(Buffer Menu)} | ||
| 407 | Move to the previous line and remove all flags on that line | ||
| 408 | (@code{Buffer-menu-backup-unmark}). | ||
| 387 | @end table | 409 | @end table |
| 388 | 410 | ||
| 389 | The @kbd{d}, @kbd{C-d}, @kbd{s} and @kbd{u} commands to add or remove | 411 | @noindent |
| 390 | flags also move down (or up) one line. They accept a numeric argument | 412 | The commands for adding or removing flags, @kbd{d}, @kbd{C-d}, @kbd{s} |
| 391 | as a repeat count. | 413 | and @kbd{u}, all accept a numeric argument as a repeat count. |
| 392 | 414 | ||
| 393 | These commands operate immediately on the buffer listed on the current | 415 | The following commands operate immediately on the buffer listed on |
| 394 | line: | 416 | the current line. They also accept a numeric argument as a repeat |
| 417 | count. | ||
| 395 | 418 | ||
| 396 | @table @kbd | 419 | @table @kbd |
| 397 | @item ~ | 420 | @item ~ |
| 398 | Mark the buffer ``unmodified''. The command @kbd{~} does this | 421 | @findex Buffer-menu-not-modified |
| 399 | immediately when you type it. | 422 | @kindex ~ @r{(Buffer Menu)} |
| 423 | Mark the buffer as unmodified (@code{Buffer-menu-not-modified}). | ||
| 424 | @xref{Save Commands}. | ||
| 425 | |||
| 400 | @item % | 426 | @item % |
| 401 | Toggle the buffer's read-only flag. The command @kbd{%} does | 427 | @findex Buffer-menu-toggle-read-only |
| 402 | this immediately when you type it. | 428 | @kindex % @r{(Buffer Menu)} |
| 429 | Toggle the buffer's read-only status | ||
| 430 | (@code{Buffer-menu-toggle-read-only}). @xref{Misc Buffer}. | ||
| 431 | |||
| 403 | @item t | 432 | @item t |
| 404 | Visit the buffer as a tags table. @xref{Select Tags Table}. | 433 | @findex Buffer-menu-visit-tags-table |
| 434 | @kindex % @r{(Buffer Menu)} | ||
| 435 | Visit the buffer as a tags table | ||
| 436 | (@code{Buffer-menu-visit-tags-table}). @xref{Select Tags Table}. | ||
| 405 | @end table | 437 | @end table |
| 406 | 438 | ||
| 407 | There are also commands to select another buffer or buffers: | 439 | The following commands are used to select another buffer or buffers: |
| 408 | 440 | ||
| 409 | @table @kbd | 441 | @table @kbd |
| 410 | @item q | 442 | @item q |
| 411 | Quit the buffer menu---immediately display the most recent formerly | 443 | @findex quit-window |
| 412 | visible buffer in its place. | 444 | @kindex q @r{(Buffer Menu)} |
| 445 | Quit the Buffer Menu (@code{quit-window}). The most recent formerly | ||
| 446 | visible buffer is displayed in its place. | ||
| 447 | |||
| 413 | @item @key{RET} | 448 | @item @key{RET} |
| 414 | @itemx f | 449 | @itemx f |
| 415 | Immediately select this line's buffer in place of the @file{*Buffer | 450 | @findex Buffer-menu-this-window |
| 416 | List*} buffer. | 451 | @kindex f @r{(Buffer Menu)} |
| 452 | @kindex RET @r{(Buffer Menu)} | ||
| 453 | Select this line's buffer, replacing the @file{*Buffer List*} buffer | ||
| 454 | in its window (@code{Buffer-menu-this-window}). | ||
| 455 | |||
| 417 | @item o | 456 | @item o |
| 418 | Immediately select this line's buffer in another window as if by | 457 | @findex Buffer-menu-other-window |
| 419 | @kbd{C-x 4 b}, leaving @file{*Buffer List*} visible. | 458 | @kindex o @r{(Buffer Menu)} |
| 459 | Select this line's buffer in another window, as if by @kbd{C-x 4 b}, | ||
| 460 | leaving @file{*Buffer List*} visible | ||
| 461 | (@code{Buffer-menu-other-window}). | ||
| 462 | |||
| 420 | @item C-o | 463 | @item C-o |
| 421 | Immediately display this line's buffer in another window, but don't | 464 | @findex Buffer-menu-switch-other-window |
| 422 | select the window. | 465 | @kindex C-o @r{(Buffer Menu)} |
| 466 | Display this line's buffer in another window, without selecting it | ||
| 467 | (@code{Buffer-menu-switch-other-window}). | ||
| 468 | |||
| 423 | @item 1 | 469 | @item 1 |
| 424 | Immediately select this line's buffer in a full-screen window. | 470 | @findex Buffer-menu-1-window |
| 471 | @kindex 1 @r{(Buffer Menu)} | ||
| 472 | Select this line's buffer in a full-frame window | ||
| 473 | (@code{Buffer-menu-1-window}). | ||
| 474 | |||
| 425 | @item 2 | 475 | @item 2 |
| 426 | Immediately set up two windows, with this line's buffer selected in | 476 | @findex Buffer-menu-2-window |
| 427 | one, and the previously current buffer (aside from the buffer | 477 | @kindex 2 @r{(Buffer Menu)} |
| 428 | @file{*Buffer List*}) displayed in the other. | 478 | Set up two windows on the current frame, with this line's buffer |
| 479 | selected in one, and a previously current buffer (aside from | ||
| 480 | @file{*Buffer List*}) in the other (@code{Buffer-menu-2-window}). | ||
| 481 | |||
| 429 | @item b | 482 | @item b |
| 430 | Bury the buffer listed on this line. | 483 | @findex Buffer-menu-bury |
| 484 | @kindex b @r{(Buffer Menu)} | ||
| 485 | Bury this line's buffer (@code{Buffer-menu-bury}). | ||
| 486 | |||
| 431 | @item m | 487 | @item m |
| 488 | @findex Buffer-menu-mark | ||
| 489 | @kindex m @r{(Buffer Menu)} | ||
| 432 | Mark this line's buffer to be displayed in another window if you exit | 490 | Mark this line's buffer to be displayed in another window if you exit |
| 433 | with the @kbd{v} command. The request shows as a @samp{>} at the | 491 | with the @kbd{v} command (@code{Buffer-menu-mark}). The display flag |
| 434 | beginning of the line. (A single buffer may not have both a delete | 492 | is indicated by the character @samp{>} at the beginning of the line. |
| 435 | request and a display request.) | 493 | (A single buffer may not have both deletion and display flags.) |
| 494 | |||
| 436 | @item v | 495 | @item v |
| 437 | Immediately select this line's buffer, and also display in other windows | 496 | @findex Buffer-menu-select |
| 438 | any buffers previously marked with the @kbd{m} command. If you have not | 497 | @kindex v @r{(Buffer Menu)} |
| 439 | marked any buffers, this command is equivalent to @kbd{1}. | 498 | Select this line's buffer, and also display in other windows any |
| 499 | buffers flagged with the @kbd{m} command (@code{Buffer-menu-select}). | ||
| 500 | If you have not flagged any buffers, this command is equivalent to | ||
| 501 | @kbd{1}. | ||
| 440 | @end table | 502 | @end table |
| 441 | 503 | ||
| 442 | There is also a command that affects the entire buffer list: | 504 | The following commands affect the entire buffer list: |
| 443 | 505 | ||
| 444 | @table @kbd | 506 | @table @kbd |
| 507 | @item S | ||
| 508 | @findex tabulated-list-sort | ||
| 509 | @kindex S @r{(Buffer Menu)} | ||
| 510 | Sort the Buffer Menu entries according to their values in the column | ||
| 511 | at point. With a numeric prefix argument @var{n}, sort according to | ||
| 512 | the @var{n}-th column (@code{tabulated-list-sort}). | ||
| 513 | |||
| 445 | @item T | 514 | @item T |
| 446 | Delete, or reinsert, lines for non-file buffers. This command toggles | 515 | @findex Buffer-menu-toggle-files-only |
| 447 | the inclusion of such buffers in the buffer list. | 516 | @kindex T @r{(Buffer Menu)} |
| 517 | Delete, or reinsert, lines for non-file buffers | ||
| 518 | @code{Buffer-menu-toggle-files-only}). This command toggles the | ||
| 519 | inclusion of such buffers in the buffer list. | ||
| 448 | @end table | 520 | @end table |
| 449 | 521 | ||
| 450 | What @code{buffer-menu} actually does is create and switch to a | ||
| 451 | suitable buffer, and turn on Buffer Menu mode in it. Everything else | ||
| 452 | described above is implemented by the special commands provided in | ||
| 453 | Buffer Menu mode. One consequence of this is that you can switch from | ||
| 454 | the @file{*Buffer List*} buffer to another Emacs buffer, and edit | ||
| 455 | there. You can reselect the @file{*Buffer List*} buffer later, to | ||
| 456 | perform the operations already requested, or you can kill it, or pay | ||
| 457 | no further attention to it. | ||
| 458 | |||
| 459 | Normally, the buffer @file{*Buffer List*} is not updated | 522 | Normally, the buffer @file{*Buffer List*} is not updated |
| 460 | automatically when buffers are created and killed; its contents are | 523 | automatically when buffers are created and killed; its contents are |
| 461 | just text. If you have created, deleted or renamed buffers, the way | 524 | just text. If you have created, deleted or renamed buffers, the way |
| @@ -633,7 +696,6 @@ C-b}. To customize this buffer list, use the @code{bs} Custom group | |||
| 633 | @findex msb-mode | 696 | @findex msb-mode |
| 634 | @cindex mode, MSB | 697 | @cindex mode, MSB |
| 635 | @cindex MSB mode | 698 | @cindex MSB mode |
| 636 | @cindex buffer menu | ||
| 637 | @findex mouse-buffer-menu | 699 | @findex mouse-buffer-menu |
| 638 | @kindex C-Down-Mouse-1 | 700 | @kindex C-Down-Mouse-1 |
| 639 | MSB global minor mode (``MSB'' stands for ``mouse select buffer'') | 701 | MSB global minor mode (``MSB'' stands for ``mouse select buffer'') |
diff --git a/doc/emacs/dired.texi b/doc/emacs/dired.texi index c08dc02b04b..69b72b2c73a 100644 --- a/doc/emacs/dired.texi +++ b/doc/emacs/dired.texi | |||
| @@ -1170,17 +1170,17 @@ automatically when you revisit it, by setting the variable | |||
| 1170 | 1170 | ||
| 1171 | @kindex k @r{(Dired)} | 1171 | @kindex k @r{(Dired)} |
| 1172 | @findex dired-do-kill-lines | 1172 | @findex dired-do-kill-lines |
| 1173 | To delete the specified @emph{file lines} from the buffer---not | 1173 | To delete @emph{file lines} from the buffer---without actually |
| 1174 | delete the files---type @kbd{k} (@code{dired-do-kill-lines}). Like | 1174 | deleting the files---type @kbd{k} (@code{dired-do-kill-lines}). Like |
| 1175 | the file-operating commands, this command operates on the next @var{n} | 1175 | the file-operating commands, this command operates on the next @var{n} |
| 1176 | files, or on the marked files if any; but it does not operate on the | 1176 | files, or on the marked files if any. However, it does not operate on |
| 1177 | current file as a last resort. | 1177 | the current file, since otherwise mistyping @kbd{k} could be annoying. |
| 1178 | 1178 | ||
| 1179 | If you use @kbd{k} with a numeric prefix argument to kill the line | 1179 | If you use @kbd{k} to kill the line for a directory file which you |
| 1180 | for a file that is a directory, which you have inserted in the Dired | 1180 | had inserted in the Dired buffer as a subdirectory |
| 1181 | buffer as a subdirectory, it removed that subdirectory line from the | 1181 | (@pxref{Subdirectories in Dired}), it removes the subdirectory listing |
| 1182 | buffer as well. Typing @kbd{C-u k} on the header line for a | 1182 | as well. Typing @kbd{C-u k} on the header line for a subdirectory |
| 1183 | subdirectory also removes the subdirectory line from the Dired buffer. | 1183 | also removes the subdirectory line from the Dired buffer. |
| 1184 | 1184 | ||
| 1185 | The @kbd{g} command brings back any individual lines that you have | 1185 | The @kbd{g} command brings back any individual lines that you have |
| 1186 | killed in this way, but not subdirectories---you must use @kbd{i} to | 1186 | killed in this way, but not subdirectories---you must use @kbd{i} to |
diff --git a/doc/emacs/display.texi b/doc/emacs/display.texi index 90bfcf147c5..b6ab4913f9c 100644 --- a/doc/emacs/display.texi +++ b/doc/emacs/display.texi | |||
| @@ -221,20 +221,27 @@ visible portion of the text. | |||
| 221 | if you set @code{scroll-conservatively} to a small number @var{n}, | 221 | if you set @code{scroll-conservatively} to a small number @var{n}, |
| 222 | then if you move point just a little off the screen (less than @var{n} | 222 | then if you move point just a little off the screen (less than @var{n} |
| 223 | lines), Emacs scrolls the text just far enough to bring point back on | 223 | lines), Emacs scrolls the text just far enough to bring point back on |
| 224 | screen. By default, @code{scroll-conservatively} is@tie{}0. If you | 224 | screen. If doing so fails to make point visible, Emacs centers point |
| 225 | set @code{scroll-conservatively} to a large number (larger than 100), | 225 | in the window. By default, @code{scroll-conservatively} is@tie{}0. |
| 226 | Emacs will never center point as result of scrolling, even if point | 226 | If you set @code{scroll-conservatively} to a large number (larger than |
| 227 | moves far away from the text previously displayed in the window. With | 227 | 100), Emacs will never center point as result of scrolling, even if |
| 228 | such a large value, Emacs will always scroll text just enough for | 228 | point moves far away from the text previously displayed in the window. |
| 229 | With such a large value, Emacs will always scroll text just enough for | ||
| 229 | bringing point into view, so point will end up at the top or bottom of | 230 | bringing point into view, so point will end up at the top or bottom of |
| 230 | the window, depending on the scroll direction. | 231 | the window, depending on the scroll direction. |
| 231 | 232 | ||
| 232 | @vindex scroll-step | 233 | @vindex scroll-step |
| 233 | The variable @code{scroll-step} determines how many lines to scroll | 234 | An alternative way of controlling how Emacs scrolls text is by |
| 234 | the window when point moves off the screen. If moving by that number | 235 | customizing the variable @code{scroll-step}. Its value determines how |
| 235 | of lines fails to bring point back into view, point is centered | 236 | many lines to scroll the window when point moves off the screen. If |
| 236 | instead. The default value is zero, which causes point to always be | 237 | moving by that number of lines fails to bring point back into view, |
| 237 | centered after scrolling. | 238 | point is centered instead. The default value is zero, which causes |
| 239 | point to always be centered after scrolling. | ||
| 240 | |||
| 241 | Since both @code{scroll-conservatively} and @code{scroll-step} | ||
| 242 | control automatic scrolling in contradicting ways, you should set only | ||
| 243 | one of them. If you customize both, the value of | ||
| 244 | @code{scroll-conservatively} takes precedence. | ||
| 238 | 245 | ||
| 239 | @cindex aggressive scrolling | 246 | @cindex aggressive scrolling |
| 240 | @vindex scroll-up-aggressively | 247 | @vindex scroll-up-aggressively |
| @@ -1493,6 +1500,7 @@ attempts to wrap the line at word boundaries near the right window | |||
| 1493 | edge. This makes the text easier to read, as wrapping does not occur | 1500 | edge. This makes the text easier to read, as wrapping does not occur |
| 1494 | in the middle of words. | 1501 | in the middle of words. |
| 1495 | 1502 | ||
| 1503 | @cindex mode, Visual Line | ||
| 1496 | @cindex Visual Line mode | 1504 | @cindex Visual Line mode |
| 1497 | @findex visual-line-mode | 1505 | @findex visual-line-mode |
| 1498 | @findex global-visual-line-mode | 1506 | @findex global-visual-line-mode |
diff --git a/doc/emacs/emacs.texi b/doc/emacs/emacs.texi index e7e0feb9e88..005215de645 100644 --- a/doc/emacs/emacs.texi +++ b/doc/emacs/emacs.texi | |||
| @@ -261,6 +261,7 @@ Basic Editing Commands | |||
| 261 | 261 | ||
| 262 | The Minibuffer | 262 | The Minibuffer |
| 263 | 263 | ||
| 264 | * Basic Minibuffer:: Basic usage of the minibuffer. | ||
| 264 | * Minibuffer File:: Entering file names with the minibuffer. | 265 | * Minibuffer File:: Entering file names with the minibuffer. |
| 265 | * Minibuffer Edit:: How to edit in the minibuffer. | 266 | * Minibuffer Edit:: How to edit in the minibuffer. |
| 266 | * Completion:: An abbreviation facility for minibuffer input. | 267 | * Completion:: An abbreviation facility for minibuffer input. |
| @@ -1402,7 +1403,7 @@ Martin Lorentzon, Dave Love, Eric Ludlam, Károly L@H{o}rentey, Sascha | |||
| 1402 | Lüdecke, Greg McGary, Roland McGrath, Michael McNamara, Alan Mackenzie, | 1403 | Lüdecke, Greg McGary, Roland McGrath, Michael McNamara, Alan Mackenzie, |
| 1403 | Christopher J.@: Madsen, Neil M.@: Mager, Ken Manheimer, Bill Mann, | 1404 | Christopher J.@: Madsen, Neil M.@: Mager, Ken Manheimer, Bill Mann, |
| 1404 | Brian Marick, Simon Marshall, Bengt Martensson, Charlie Martin, | 1405 | Brian Marick, Simon Marshall, Bengt Martensson, Charlie Martin, |
| 1405 | Yukihiro Matsumoto, David Maus, Thomas May, Will Mengarini, David | 1406 | Yukihiro Matsumoto, Tomohiro Matsuyama, David Maus, Thomas May, Will Mengarini, David |
| 1406 | Megginson, Stefan Merten, Ben A.@: Mesander, Wayne Mesard, Brad | 1407 | Megginson, Stefan Merten, Ben A.@: Mesander, Wayne Mesard, Brad |
| 1407 | Miller, Lawrence Mitchell, Richard Mlynarik, Gerd Moellmann, Stefan | 1408 | Miller, Lawrence Mitchell, Richard Mlynarik, Gerd Moellmann, Stefan |
| 1408 | Monnier, Keith Moore, Jan Moringen, Morioka Tomohiko, Glenn Morris, | 1409 | Monnier, Keith Moore, Jan Moringen, Morioka Tomohiko, Glenn Morris, |
diff --git a/doc/emacs/files.texi b/doc/emacs/files.texi index 36cd3658e2d..8b609891caf 100644 --- a/doc/emacs/files.texi +++ b/doc/emacs/files.texi | |||
| @@ -1341,7 +1341,7 @@ contents of the hunk. | |||
| 1341 | You can edit a Diff mode buffer like any other buffer. (If it is | 1341 | You can edit a Diff mode buffer like any other buffer. (If it is |
| 1342 | read-only, you need to make it writable first. @xref{Misc Buffer}.) | 1342 | read-only, you need to make it writable first. @xref{Misc Buffer}.) |
| 1343 | Whenever you change a hunk, Diff mode attempts to automatically | 1343 | Whenever you change a hunk, Diff mode attempts to automatically |
| 1344 | correct the line numbers in the hunk headers, to ensure that the diff | 1344 | correct the line numbers in the hunk headers, to ensure that the patch |
| 1345 | remains ``correct''. To disable automatic line number correction, | 1345 | remains ``correct''. To disable automatic line number correction, |
| 1346 | change the variable @code{diff-update-on-the-fly} to @code{nil}. | 1346 | change the variable @code{diff-update-on-the-fly} to @code{nil}. |
| 1347 | 1347 | ||
| @@ -1470,11 +1470,22 @@ name from the patch itself. This is useful for making log entries for | |||
| 1470 | functions that are deleted by the patch. | 1470 | functions that are deleted by the patch. |
| 1471 | @end table | 1471 | @end table |
| 1472 | 1472 | ||
| 1473 | By default, Diff mode highlights trailing whitespace on modified | 1473 | @c Trailing whitespace is NOT shown by default. |
| 1474 | lines, so that they are more obvious. This is done by enabling | 1474 | @c Emacs's dir-locals file enables this (for some reason). |
| 1475 | Whitespace mode in the Diff buffer (@pxref{Useless Whitespace}). Diff | 1475 | @cindex trailing whitespace, in patches |
| 1476 | mode buffers are set up so that Whitespace mode avoids highlighting | 1476 | @findex diff-delete-trailing-whitespace |
| 1477 | trailing whitespace occurring in the diff context. | 1477 | Patches sometimes include trailing whitespace on modified lines, as |
| 1478 | an unintentional and undesired change. There are two ways to deal | ||
| 1479 | with this problem. Firstly, if you enable Whitespace mode in a Diff | ||
| 1480 | buffer (@pxref{Useless Whitespace}), it automatically highlights | ||
| 1481 | trailing whitespace in modified lines. Secondly, you can use the | ||
| 1482 | command @kbd{M-x diff-delete-trailing-whitespace}, which searches for | ||
| 1483 | trailing whitespace in the lines modified by the patch, and removes | ||
| 1484 | that whitespace in both the patch and the patched source file(s). | ||
| 1485 | This command does not save the modifications that it makes, so you can | ||
| 1486 | decide whether to save the changes (the list of modified files is | ||
| 1487 | displayed in the echo area). With a prefix argument, it tries to | ||
| 1488 | modify the original source files rather than the patched source files. | ||
| 1478 | 1489 | ||
| 1479 | @node Misc File Ops | 1490 | @node Misc File Ops |
| 1480 | @section Miscellaneous File Operations | 1491 | @section Miscellaneous File Operations |
diff --git a/doc/emacs/mini.texi b/doc/emacs/mini.texi index e5a84bda56d..ebccedacc05 100644 --- a/doc/emacs/mini.texi +++ b/doc/emacs/mini.texi | |||
| @@ -13,24 +13,54 @@ special-purpose buffer with a small amount of screen space. You can | |||
| 13 | use the usual Emacs editing commands in the minibuffer to edit the | 13 | use the usual Emacs editing commands in the minibuffer to edit the |
| 14 | argument text. | 14 | argument text. |
| 15 | 15 | ||
| 16 | @menu | ||
| 17 | * Basic Minibuffer:: Basic usage of the minibuffer. | ||
| 18 | * Minibuffer File:: Entering file names with the minibuffer. | ||
| 19 | * Minibuffer Edit:: How to edit in the minibuffer. | ||
| 20 | * Completion:: An abbreviation facility for minibuffer input. | ||
| 21 | * Minibuffer History:: Reusing recent minibuffer arguments. | ||
| 22 | * Repetition:: Re-executing commands that used the minibuffer. | ||
| 23 | * Passwords:: Entering passwords in the echo area. | ||
| 24 | * Yes or No Prompts:: Replying yes or no in the echo area. | ||
| 25 | @end menu | ||
| 26 | |||
| 27 | @node Basic Minibuffer | ||
| 28 | @section Using the Minibuffer | ||
| 29 | |||
| 16 | @cindex prompt | 30 | @cindex prompt |
| 17 | When the minibuffer is in use, it appears in the echo area, with a | 31 | When the minibuffer is in use, it appears in the echo area, with a |
| 18 | cursor. The minibuffer starts with a @dfn{prompt} in a distinct | 32 | cursor. The minibuffer starts with a @dfn{prompt}, usually ending |
| 19 | color, usually ending with a colon. The prompt states what kind of | 33 | with a colon. The prompt states what kind of input is expected, and |
| 20 | input is expected, and how it will be used. | 34 | how it will be used. The prompt is highlighted using the |
| 35 | @code{minibuffer-prompt} face (@pxref{Faces}). | ||
| 21 | 36 | ||
| 22 | The simplest way to enter a minibuffer argument is to type the text, | 37 | The simplest way to enter a minibuffer argument is to type the text, |
| 23 | then @key{RET} to submit the argument and exit the minibuffer. You | 38 | then @key{RET} to submit the argument and exit the minibuffer. |
| 24 | can cancel the minibuffer, and the command that wants the argument, by | 39 | Alternatively, you can type @kbd{C-g} to exit the minibuffer by |
| 25 | typing @kbd{C-g}. | 40 | cancelling the command asking for the argument (@pxref{Quitting}). |
| 26 | 41 | ||
| 27 | @cindex default argument | 42 | @cindex default argument |
| 28 | Sometimes, a @dfn{default argument} appears in the prompt, inside | 43 | Sometimes, the prompt shows a @dfn{default argument}, inside |
| 29 | parentheses before the colon. This default will be used as the | 44 | parentheses before the colon. This default will be used as the |
| 30 | argument if you just type @key{RET}. For example, commands that read | 45 | argument if you just type @key{RET}. For example, commands that read |
| 31 | buffer names usually show a buffer name as the default; you can type | 46 | buffer names usually show a buffer name as the default; you can type |
| 32 | @key{RET} to operate on that default buffer. | 47 | @key{RET} to operate on that default buffer. |
| 33 | 48 | ||
| 49 | @cindex Minibuffer Electric Default mode | ||
| 50 | @cindex mode, Minibuffer Electric Default | ||
| 51 | @findex minibuffer-electric-default-mode | ||
| 52 | @vindex minibuffer-eldef-shorten-default | ||
| 53 | If you enable Minibuffer Electric Default mode, a global minor mode, | ||
| 54 | Emacs hides the default argument as soon as you modify the contents of | ||
| 55 | the minibuffer (since typing @key{RET} would no longer submit that | ||
| 56 | default). If you ever bring back the original minibuffer text, the | ||
| 57 | prompt again shows the default. Furthermore, if you change the | ||
| 58 | variable @code{minibuffer-eldef-shorten-default} to a non-@code{nil} | ||
| 59 | value, the default argument is displayed as @samp{[@var{default}]} | ||
| 60 | instead of @samp{(default @var{default})}, saving some screen space. | ||
| 61 | To enable this minor mode, type @kbd{M-x | ||
| 62 | minibuffer-electric-default-mode}. | ||
| 63 | |||
| 34 | Since the minibuffer appears in the echo area, it can conflict with | 64 | Since the minibuffer appears in the echo area, it can conflict with |
| 35 | other uses of the echo area. If an error message or an informative | 65 | other uses of the echo area. If an error message or an informative |
| 36 | message is emitted while the minibuffer is active, the message hides | 66 | message is emitted while the minibuffer is active, the message hides |
| @@ -38,16 +68,6 @@ the minibuffer for a few seconds, or until you type something; then | |||
| 38 | the minibuffer comes back. While the minibuffer is in use, keystrokes | 68 | the minibuffer comes back. While the minibuffer is in use, keystrokes |
| 39 | do not echo. | 69 | do not echo. |
| 40 | 70 | ||
| 41 | @menu | ||
| 42 | * Minibuffer File:: Entering file names with the minibuffer. | ||
| 43 | * Minibuffer Edit:: How to edit in the minibuffer. | ||
| 44 | * Completion:: An abbreviation facility for minibuffer input. | ||
| 45 | * Minibuffer History:: Reusing recent minibuffer arguments. | ||
| 46 | * Repetition:: Re-executing commands that used the minibuffer. | ||
| 47 | * Passwords:: Entering passwords in the echo area. | ||
| 48 | * Yes or No Prompts:: Replying yes or no in the echo area. | ||
| 49 | @end menu | ||
| 50 | |||
| 51 | @node Minibuffer File | 71 | @node Minibuffer File |
| 52 | @section Minibuffers for File Names | 72 | @section Minibuffers for File Names |
| 53 | 73 | ||
diff --git a/doc/emacs/misc.texi b/doc/emacs/misc.texi index 4f0a1009e30..244920a23ae 100644 --- a/doc/emacs/misc.texi +++ b/doc/emacs/misc.texi | |||
| @@ -1186,30 +1186,39 @@ underlying shell, of course. | |||
| 1186 | @subsection Emacs Terminal Emulator | 1186 | @subsection Emacs Terminal Emulator |
| 1187 | @findex term | 1187 | @findex term |
| 1188 | 1188 | ||
| 1189 | To run a subshell in a terminal emulator, use @kbd{M-x term}. This | 1189 | To run a subshell in a text terminal emulator, use @kbd{M-x term}. |
| 1190 | creates (or reuses) a buffer named @file{*terminal*}, and runs a | 1190 | This creates (or reuses) a buffer named @file{*terminal*}, and runs a |
| 1191 | subshell with input coming from your keyboard, and output going to | 1191 | subshell with input coming from your keyboard, and output going to |
| 1192 | that buffer. | 1192 | that buffer. |
| 1193 | 1193 | ||
| 1194 | @cindex line mode @r{(terminal emulator)} | ||
| 1195 | @cindex char mode @r{(terminal emulator)} | ||
| 1194 | The terminal emulator uses Term mode, which has two input modes. In | 1196 | The terminal emulator uses Term mode, which has two input modes. In |
| 1195 | line mode, Term basically acts like Shell mode (@pxref{Shell Mode}). | 1197 | @dfn{line mode}, Term basically acts like Shell mode (@pxref{Shell |
| 1196 | 1198 | Mode}). In @dfn{char mode}, each character is sent directly to the | |
| 1197 | In char mode, each character is sent directly to the subshell, as | 1199 | subshell, as terminal input; the sole exception is the terminal escape |
| 1198 | ``terminal input''. Any ``echoing'' of your input is the | 1200 | character, which by default is @kbd{C-c} (@pxref{Term Mode}). Any |
| 1199 | responsibility of the subshell. The sole exception is the terminal | 1201 | echoing of your input is the responsibility of the subshell; any |
| 1200 | escape character, which by default is @kbd{C-c} (@pxref{Term Mode}). | 1202 | terminal output from the subshell goes into the buffer, advancing |
| 1201 | Any ``terminal output'' from the subshell goes into the buffer, | 1203 | point. |
| 1202 | advancing point. | ||
| 1203 | 1204 | ||
| 1204 | Some programs (such as Emacs itself) need to control the appearance | 1205 | Some programs (such as Emacs itself) need to control the appearance |
| 1205 | on the terminal screen in detail. They do this by sending special | 1206 | of the terminal screen in detail. They do this by emitting special |
| 1206 | control codes. The exact control codes needed vary from terminal to | 1207 | control codes. Term mode recognizes and handles ANSI-standard |
| 1207 | terminal, but nowadays most terminals and terminal emulators | 1208 | VT100-style escape sequences, which are accepted by most modern |
| 1208 | (including @code{xterm}) understand the ANSI-standard (VT100-style) | 1209 | terminals, including @command{xterm}. (Hence, you can actually run |
| 1209 | escape sequences. Term mode recognizes these escape sequences, and | 1210 | Emacs inside an Emacs Term window.) |
| 1210 | handles each one appropriately, changing the buffer so that the | 1211 | |
| 1211 | appearance of the window matches what it would be on a real terminal. | 1212 | The @code{term} face specifies the default appearance of text |
| 1212 | You can actually run Emacs inside an Emacs Term window. | 1213 | in the terminal emulator (the default is the same appearance as the |
| 1214 | @code{default} face). When terminal control codes are used to change | ||
| 1215 | the appearance of text, these are represented in the terminal emulator | ||
| 1216 | by the faces @code{term-color-black}, @code{term-color-red}, | ||
| 1217 | @code{term-color-green}, @code{term-color-yellow} | ||
| 1218 | @code{term-color-blue}, @code{term-color-magenta}, | ||
| 1219 | @code{term-color-cyan}, @code{term-color-white}, | ||
| 1220 | @code{term-color-underline}, and @code{term-color-bold}. | ||
| 1221 | @xref{Faces}. | ||
| 1213 | 1222 | ||
| 1214 | You can also Term mode to communicate with a device connected to a | 1223 | You can also Term mode to communicate with a device connected to a |
| 1215 | serial port. @xref{Serial Terminal}. | 1224 | serial port. @xref{Serial Terminal}. |
| @@ -1224,6 +1233,9 @@ examining your input. But some shells can tell Term what the current | |||
| 1224 | directory is. This is done automatically by @code{bash} version 1.15 | 1233 | directory is. This is done automatically by @code{bash} version 1.15 |
| 1225 | and later. | 1234 | and later. |
| 1226 | 1235 | ||
| 1236 | |||
| 1237 | |||
| 1238 | |||
| 1227 | @node Term Mode | 1239 | @node Term Mode |
| 1228 | @subsection Term Mode | 1240 | @subsection Term Mode |
| 1229 | @cindex Term mode | 1241 | @cindex Term mode |
diff --git a/doc/emacs/trouble.texi b/doc/emacs/trouble.texi index fc99ff3d7bf..1a891a62b33 100644 --- a/doc/emacs/trouble.texi +++ b/doc/emacs/trouble.texi | |||
| @@ -275,24 +275,25 @@ will disappear from the mode line. That means you can safely go on | |||
| 275 | editing in the same Emacs session. | 275 | editing in the same Emacs session. |
| 276 | 276 | ||
| 277 | Do not use @kbd{M-x buffer-menu} to save or kill buffers when you run | 277 | Do not use @kbd{M-x buffer-menu} to save or kill buffers when you run |
| 278 | out of memory, because the buffer menu needs a fair amount of memory | 278 | out of memory, because the Buffer Menu needs a fair amount of memory |
| 279 | itself, and the reserve supply may not be enough. | 279 | itself, and the reserve supply may not be enough. |
| 280 | 280 | ||
| 281 | @node Crashing | 281 | @node Crashing |
| 282 | @subsection When Emacs Crashes | 282 | @subsection When Emacs Crashes |
| 283 | 283 | ||
| 284 | Emacs is not supposed to crash, but if it does, before it exits it | 284 | @cindex crash report |
| 285 | reports a brief summary of the crash to the standard error stream | 285 | Emacs is not supposed to crash, but if it does, it produces a |
| 286 | @code{stderr}. If enabled, a crashed Emacs also generates a core dump | 286 | @dfn{crash report} prior to exiting. The crash report is printed to |
| 287 | containing voluminous data about the crash. On many platforms you can | 287 | the standard error stream. If Emacs was started from a graphical |
| 288 | enable core dumps by putting the shell command @samp{ulimit -c unlimited} | 288 | desktop, the standard error stream is commonly redirected to a file |
| 289 | into your shell startup script. The crash report and core dump can be | 289 | such as @file{~/.xsession-errors}, so you can look for the crash |
| 290 | used when debugging the same version of Emacs on the same platform. | 290 | report there. |
| 291 | 291 | ||
| 292 | The format of the crash report depends on the platform, and some | 292 | The format of the crash report depends on the platform. On some |
| 293 | platforms support backtraces. | 293 | platforms, such as those using the GNU C Library, the crash report |
| 294 | Here is an example, generated on x86-64 GNU/Linux with version 2.15 of | 294 | includes a @dfn{backtrace} describing the execution state prior to |
| 295 | the GNU C Library: | 295 | crashing, which can be used to help debug the crash. Here is an |
| 296 | example: | ||
| 296 | 297 | ||
| 297 | @example | 298 | @example |
| 298 | Fatal error 11: Segmentation fault | 299 | Fatal error 11: Segmentation fault |
| @@ -304,25 +305,18 @@ emacs[0x4ed504] | |||
| 304 | /lib64/libpthread.so.0(read+0xe)[0x375220e08e] | 305 | /lib64/libpthread.so.0(read+0xe)[0x375220e08e] |
| 305 | emacs[0x509af6] | 306 | emacs[0x509af6] |
| 306 | emacs[0x5acc26] | 307 | emacs[0x5acc26] |
| 307 | emacs[0x5adbfb] | 308 | @dots{} |
| 308 | emacs[0x56566b] | ||
| 309 | emacs[0x59bac3] | ||
| 310 | emacs[0x565151] | ||
| 311 | ... | ||
| 312 | @end example | 309 | @end example |
| 313 | 310 | ||
| 314 | @noindent | 311 | @noindent |
| 315 | The number @samp{11} is the system signal number that corresponds to | 312 | The number @samp{11} is the system signal number corresponding to the |
| 316 | the problem, a segmentation fault here. The three dots at the end | 313 | crash---in this case a segmentation fault. The hexadecimal numbers |
| 317 | indicate that Emacs suppressed further backtrace entries, in the | 314 | are program addresses, which can be associated with source code lines |
| 318 | interest of brevity. | 315 | using a debugging tool. For example, the GDB command |
| 319 | 316 | @samp{list *0x509af6} prints the source-code lines corresponding to | |
| 320 | The hexadecimal program addresses can be useful in debugging sessions. | 317 | the @samp{emacs[0x509af6]} entry. If your system has the |
| 321 | For example, the GDB command @samp{list *0x509af6} prints the | 318 | @command{addr2line} utility, the following shell command outputs a |
| 322 | source-code lines corresponding to the @samp{emacs[0x509af6]} entry in | 319 | backtrace with source-code line numbers: |
| 323 | the backtrace. Or, if your system has @command{addr2line}, the | ||
| 324 | following shell command outputs a backtrace with source-code line | ||
| 325 | numbers: | ||
| 326 | 320 | ||
| 327 | @example | 321 | @example |
| 328 | sed -n 's/.*\[\(.*\)]$/\1/p' @var{backtrace} | | 322 | sed -n 's/.*\[\(.*\)]$/\1/p' @var{backtrace} | |
| @@ -334,6 +328,15 @@ Here, @var{backtrace} is the name of a text file containing a copy of | |||
| 334 | the backtrace, and @var{bindir} is the name of the directory that | 328 | the backtrace, and @var{bindir} is the name of the directory that |
| 335 | contains the Emacs executable. | 329 | contains the Emacs executable. |
| 336 | 330 | ||
| 331 | @cindex core dump | ||
| 332 | Optionally, Emacs can generate a @dfn{core dump} when it crashes. A | ||
| 333 | core dump is a file containing voluminous data about the state of the | ||
| 334 | program prior to the crash, usually examined by loading it into a | ||
| 335 | debugger such as GDB. On many platforms, core dumps are disabled by | ||
| 336 | default, and you must explicitly enable them by running the shell | ||
| 337 | command @samp{ulimit -c unlimited} (e.g.@: in your shell startup | ||
| 338 | script). | ||
| 339 | |||
| 337 | @node After a Crash | 340 | @node After a Crash |
| 338 | @subsection Recovery After a Crash | 341 | @subsection Recovery After a Crash |
| 339 | 342 | ||
diff --git a/doc/lispref/ChangeLog b/doc/lispref/ChangeLog index f5aad901d44..7eb75ceac55 100644 --- a/doc/lispref/ChangeLog +++ b/doc/lispref/ChangeLog | |||
| @@ -1,3 +1,39 @@ | |||
| 1 | 2012-11-10 Martin Rudalics <rudalics@gmx.at> | ||
| 2 | |||
| 3 | * elisp.texi (Top): Add Recombining Windows to menu. | ||
| 4 | * windows.texi (Recombining Windows): New subsection. | ||
| 5 | (Splitting Windows): Rewrite text on handling of window | ||
| 6 | combinations and move it to new subsection. | ||
| 7 | |||
| 8 | 2012-11-10 Chong Yidong <cyd@gnu.org> | ||
| 9 | |||
| 10 | * searching.texi (Replacing Match): Document \? in replace-match. | ||
| 11 | |||
| 12 | * variables.texi (Creating Buffer-Local): Document setq-local and | ||
| 13 | defvar-local. | ||
| 14 | (Setting Generalized Variables): Arrange table alphabetically. | ||
| 15 | |||
| 16 | * lists.texi (List Elements, List Variables): Clarify descriptions | ||
| 17 | of push and pop for generalized variables. | ||
| 18 | |||
| 19 | * edebug.texi (Specification List): setf is no longer CL-only. | ||
| 20 | |||
| 21 | 2012-11-10 Glenn Morris <rgm@gnu.org> | ||
| 22 | |||
| 23 | * variables.texi (Adding Generalized Variables): | ||
| 24 | Update description of FIX-RETURN expansion. | ||
| 25 | |||
| 26 | * variables.texi (Setting Generalized Variables): | ||
| 27 | Split most of previous contents into this subsection. | ||
| 28 | (Adding Generalized Variables): New subsection. | ||
| 29 | Move note on lack of setf functions here from misc/cl.texi. | ||
| 30 | |||
| 31 | * elisp.texi: Add Generalized Variables subsections to detailed menu. | ||
| 32 | |||
| 33 | 2012-11-10 Chong Yidong <cyd@gnu.org> | ||
| 34 | |||
| 35 | * frames.texi (Initial Parameters): Doc fix (Bug#12144). | ||
| 36 | |||
| 1 | 2012-11-08 Michael Albinus <michael.albinus@gmx.de> | 37 | 2012-11-08 Michael Albinus <michael.albinus@gmx.de> |
| 2 | 38 | ||
| 3 | * os.texi (Notifications): Update descriptions of | 39 | * os.texi (Notifications): Update descriptions of |
diff --git a/doc/lispref/edebug.texi b/doc/lispref/edebug.texi index 0211f9e1b9c..b5edda06bad 100644 --- a/doc/lispref/edebug.texi +++ b/doc/lispref/edebug.texi | |||
| @@ -1211,9 +1211,7 @@ A single unevaluated Lisp object, which is not instrumented. | |||
| 1211 | A single evaluated expression, which is instrumented. | 1211 | A single evaluated expression, which is instrumented. |
| 1212 | 1212 | ||
| 1213 | @item place | 1213 | @item place |
| 1214 | @c I can't see that this index entry is useful without any explanation. | 1214 | A generalized variable. @xref{Generalized Variables}. |
| 1215 | @c @findex edebug-unwrap | ||
| 1216 | A place to store a value, as in the Common Lisp @code{setf} construct. | ||
| 1217 | 1215 | ||
| 1218 | @item body | 1216 | @item body |
| 1219 | Short for @code{&rest form}. See @code{&rest} below. | 1217 | Short for @code{&rest form}. See @code{&rest} below. |
diff --git a/doc/lispref/elisp.texi b/doc/lispref/elisp.texi index 06a2ebfcaf8..a70558bf09f 100644 --- a/doc/lispref/elisp.texi +++ b/doc/lispref/elisp.texi | |||
| @@ -502,6 +502,11 @@ Buffer-Local Variables | |||
| 502 | * Default Value:: The default value is seen in buffers | 502 | * Default Value:: The default value is seen in buffers |
| 503 | that don't have their own buffer-local values. | 503 | that don't have their own buffer-local values. |
| 504 | 504 | ||
| 505 | Generalized Variables | ||
| 506 | |||
| 507 | * Setting Generalized Variables:: The @code{setf} macro. | ||
| 508 | * Adding Generalized Variables:: Defining new @code{setf} forms. | ||
| 509 | |||
| 505 | Functions | 510 | Functions |
| 506 | 511 | ||
| 507 | * What Is a Function:: Lisp functions vs. primitives; terminology. | 512 | * What Is a Function:: Lisp functions vs. primitives; terminology. |
| @@ -996,6 +1001,8 @@ Windows | |||
| 996 | * Resizing Windows:: Changing the sizes of windows. | 1001 | * Resizing Windows:: Changing the sizes of windows. |
| 997 | * Splitting Windows:: Splitting one window into two windows. | 1002 | * Splitting Windows:: Splitting one window into two windows. |
| 998 | * Deleting Windows:: Deleting a window gives its space to other windows. | 1003 | * Deleting Windows:: Deleting a window gives its space to other windows. |
| 1004 | * Recombining Windows:: Preserving the frame layout when splitting and | ||
| 1005 | deleting windows. | ||
| 999 | * Selecting Windows:: The selected window is the one that you edit in. | 1006 | * Selecting Windows:: The selected window is the one that you edit in. |
| 1000 | * Cyclic Window Ordering:: Moving around the existing windows. | 1007 | * Cyclic Window Ordering:: Moving around the existing windows. |
| 1001 | * Buffers and Windows:: Each window displays the contents of a buffer. | 1008 | * Buffers and Windows:: Each window displays the contents of a buffer. |
diff --git a/doc/lispref/frames.texi b/doc/lispref/frames.texi index f58d62675e5..27d55c4fdb9 100644 --- a/doc/lispref/frames.texi +++ b/doc/lispref/frames.texi | |||
| @@ -419,16 +419,16 @@ the initial frame, specify the same parameters in | |||
| 419 | @code{initial-frame-alist} with values that match the X resources. | 419 | @code{initial-frame-alist} with values that match the X resources. |
| 420 | @end defopt | 420 | @end defopt |
| 421 | 421 | ||
| 422 | If these parameters specify a separate @dfn{minibuffer-only frame} with | ||
| 423 | @code{(minibuffer . nil)}, and you have not created one, Emacs creates | ||
| 424 | one for you. | ||
| 425 | |||
| 426 | @cindex minibuffer-only frame | 422 | @cindex minibuffer-only frame |
| 423 | If these parameters include @code{(minibuffer . nil)}, that indicates | ||
| 424 | that the initial frame should have no minibuffer. In this case, Emacs | ||
| 425 | creates a separate @dfn{minibuffer-only frame} as well. | ||
| 426 | |||
| 427 | @defopt minibuffer-frame-alist | 427 | @defopt minibuffer-frame-alist |
| 428 | This variable's value is an alist of parameter values used when | 428 | This variable's value is an alist of parameter values used when |
| 429 | creating an initial minibuffer-only frame. This is the | 429 | creating an initial minibuffer-only frame (i.e.@: the minibuffer-only |
| 430 | minibuffer-only frame that Emacs creates if @code{initial-frame-alist} | 430 | frame that Emacs creates if @code{initial-frame-alist} specifies a |
| 431 | specifies a frame with no minibuffer. | 431 | frame with no minibuffer). |
| 432 | @end defopt | 432 | @end defopt |
| 433 | 433 | ||
| 434 | @defopt default-frame-alist | 434 | @defopt default-frame-alist |
diff --git a/doc/lispref/lists.texi b/doc/lispref/lists.texi index 458db838177..40e8d08f72c 100644 --- a/doc/lispref/lists.texi +++ b/doc/lispref/lists.texi | |||
| @@ -234,17 +234,15 @@ This is in contrast to @code{cdr}, which signals an error if | |||
| 234 | @end defun | 234 | @end defun |
| 235 | 235 | ||
| 236 | @defmac pop listname | 236 | @defmac pop listname |
| 237 | This macro is a way of examining the @sc{car} of a list, | 237 | This macro provides a convenient way to examine the @sc{car} of a |
| 238 | and taking it off the list, all at once. | 238 | list, and take it off the list, all at once. It operates on the list |
| 239 | @c FIXME I don't think is a particularly good way to do it, | 239 | stored in @var{listname}. It removes the first element from the list, |
| 240 | @c but generalized variables have not been introduced yet. | 240 | saves the @sc{cdr} into @var{listname}, then returns the removed |
| 241 | (In fact, this macro can act on generalized variables, not just lists. | 241 | element. |
| 242 | @xref{Generalized Variables}.) | 242 | |
| 243 | 243 | In the simplest case, @var{listname} is an unquoted symbol naming a | |
| 244 | It operates on the list which is stored in the symbol @var{listname}. | 244 | list; in that case, this macro is equivalent to @w{@code{(prog1 |
| 245 | It removes this element from the list by setting @var{listname} | 245 | (car listname) (setq listname (cdr listname)))}}. |
| 246 | to the @sc{cdr} of its old value---but it also returns the @sc{car} | ||
| 247 | of that list, which is the element being removed. | ||
| 248 | 246 | ||
| 249 | @example | 247 | @example |
| 250 | x | 248 | x |
| @@ -255,7 +253,10 @@ x | |||
| 255 | @result{} (b c) | 253 | @result{} (b c) |
| 256 | @end example | 254 | @end example |
| 257 | 255 | ||
| 258 | @noindent | 256 | More generally, @var{listname} can be a generalized variable. In that |
| 257 | case, this macro saves into @var{listname} using @code{setf}. | ||
| 258 | @xref{Generalized Variables}. | ||
| 259 | |||
| 259 | For the @code{push} macro, which adds an element to a list, | 260 | For the @code{push} macro, which adds an element to a list, |
| 260 | @xref{List Variables}. | 261 | @xref{List Variables}. |
| 261 | @end defmac | 262 | @end defmac |
| @@ -683,13 +684,12 @@ Some examples: | |||
| 683 | These functions, and one macro, provide convenient ways | 684 | These functions, and one macro, provide convenient ways |
| 684 | to modify a list which is stored in a variable. | 685 | to modify a list which is stored in a variable. |
| 685 | 686 | ||
| 686 | @defmac push newelt listname | 687 | @defmac push element listname |
| 687 | This macro provides an alternative way to write | 688 | This macro creates a new list whose @sc{car} is @var{element} and |
| 688 | @code{(setq @var{listname} (cons @var{newelt} @var{listname}))}. | 689 | whose @sc{cdr} is the list specified by @var{listname}, and saves that |
| 689 | @c FIXME I don't think is a particularly good way to do it, | 690 | list in @var{listname}. In the simplest case, @var{listname} is an |
| 690 | @c but generalized variables have not been introduced yet. | 691 | unquoted symbol naming a list, and this macro is equivalent |
| 691 | (In fact, this macro can act on generalized variables, not just lists. | 692 | to @w{@code{(setq @var{listname} (cons @var{element} @var{listname}))}}. |
| 692 | @xref{Generalized Variables}.) | ||
| 693 | 693 | ||
| 694 | @example | 694 | @example |
| 695 | (setq l '(a b)) | 695 | (setq l '(a b)) |
| @@ -700,7 +700,11 @@ l | |||
| 700 | @result{} (c a b) | 700 | @result{} (c a b) |
| 701 | @end example | 701 | @end example |
| 702 | 702 | ||
| 703 | @noindent | 703 | More generally, @code{listname} can be a generalized variable. In |
| 704 | that case, this macro does the equivalent of @w{@code{(setf | ||
| 705 | @var{listname} (cons @var{element} @var{listname}))}}. | ||
| 706 | @xref{Generalized Variables}. | ||
| 707 | |||
| 704 | For the @code{pop} macro, which removes the first element from a list, | 708 | For the @code{pop} macro, which removes the first element from a list, |
| 705 | @xref{List Elements}. | 709 | @xref{List Elements}. |
| 706 | @end defmac | 710 | @end defmac |
diff --git a/doc/lispref/searching.texi b/doc/lispref/searching.texi index 56c96363e81..f165381a0f8 100644 --- a/doc/lispref/searching.texi +++ b/doc/lispref/searching.texi | |||
| @@ -1310,22 +1310,31 @@ part of one of the following sequences: | |||
| 1310 | @table @asis | 1310 | @table @asis |
| 1311 | @item @samp{\&} | 1311 | @item @samp{\&} |
| 1312 | @cindex @samp{&} in replacement | 1312 | @cindex @samp{&} in replacement |
| 1313 | @samp{\&} stands for the entire text being replaced. | 1313 | This stands for the entire text being replaced. |
| 1314 | 1314 | ||
| 1315 | @item @samp{\@var{n}} | 1315 | @item @samp{\@var{n}}, where @var{n} is a digit |
| 1316 | @cindex @samp{\@var{n}} in replacement | 1316 | @cindex @samp{\@var{n}} in replacement |
| 1317 | @samp{\@var{n}}, where @var{n} is a digit, stands for the text that | 1317 | This stands for the text that matched the @var{n}th subexpression in |
| 1318 | matched the @var{n}th subexpression in the original regexp. | 1318 | the original regexp. Subexpressions are those expressions grouped |
| 1319 | Subexpressions are those expressions grouped inside @samp{\(@dots{}\)}. | 1319 | inside @samp{\(@dots{}\)}. If the @var{n}th subexpression never |
| 1320 | If the @var{n}th subexpression never matched, an empty string is substituted. | 1320 | matched, an empty string is substituted. |
| 1321 | 1321 | ||
| 1322 | @item @samp{\\} | 1322 | @item @samp{\\} |
| 1323 | @cindex @samp{\} in replacement | 1323 | @cindex @samp{\} in replacement |
| 1324 | @samp{\\} stands for a single @samp{\} in the replacement text. | 1324 | This stands for a single @samp{\} in the replacement text. |
| 1325 | |||
| 1326 | @item @samp{\?} | ||
| 1327 | This stands for itself (for compatibility with @code{replace-regexp} | ||
| 1328 | and related commands; @pxref{Regexp Replacement,,, emacs, The GNU | ||
| 1329 | Emacs Manual}). | ||
| 1325 | @end table | 1330 | @end table |
| 1326 | 1331 | ||
| 1327 | These substitutions occur after case conversion, if any, | 1332 | @noindent |
| 1328 | so the strings they substitute are never case-converted. | 1333 | Any other character following @samp{\} signals an error. |
| 1334 | |||
| 1335 | The substitutions performed by @samp{\&} and @samp{\@var{n}} occur | ||
| 1336 | after case conversion, if any. Therefore, the strings they substitute | ||
| 1337 | are never case-converted. | ||
| 1329 | 1338 | ||
| 1330 | If @var{subexp} is non-@code{nil}, that says to replace just | 1339 | If @var{subexp} is non-@code{nil}, that says to replace just |
| 1331 | subexpression number @var{subexp} of the regexp that was matched, not | 1340 | subexpression number @var{subexp} of the regexp that was matched, not |
diff --git a/doc/lispref/variables.texi b/doc/lispref/variables.texi index 88b7909126e..c8451527d4f 100644 --- a/doc/lispref/variables.texi +++ b/doc/lispref/variables.texi | |||
| @@ -1262,6 +1262,13 @@ needed if you use the @var{local} argument to @code{add-hook} or | |||
| 1262 | @code{remove-hook}. | 1262 | @code{remove-hook}. |
| 1263 | @end deffn | 1263 | @end deffn |
| 1264 | 1264 | ||
| 1265 | @defmac setq-local variable value | ||
| 1266 | This macro creates a buffer-local binding in the current buffer for | ||
| 1267 | @var{variable}, and gives it the buffer-local value @var{value}. It | ||
| 1268 | is equivalent to calling @code{make-local-variable} followed by | ||
| 1269 | @code{setq}. @var{variable} should be an unquoted symbol. | ||
| 1270 | @end defmac | ||
| 1271 | |||
| 1265 | @deffn Command make-variable-buffer-local variable | 1272 | @deffn Command make-variable-buffer-local variable |
| 1266 | This function marks @var{variable} (a symbol) automatically | 1273 | This function marks @var{variable} (a symbol) automatically |
| 1267 | buffer-local, so that any subsequent attempt to set it will make it | 1274 | buffer-local, so that any subsequent attempt to set it will make it |
| @@ -1297,6 +1304,14 @@ on having separate values in separate buffers, then using | |||
| 1297 | @code{make-variable-buffer-local} can be the best solution. | 1304 | @code{make-variable-buffer-local} can be the best solution. |
| 1298 | @end deffn | 1305 | @end deffn |
| 1299 | 1306 | ||
| 1307 | @defmac defvar-local variable value &optional docstring | ||
| 1308 | This macro defines @var{variable} as a variable with initial value | ||
| 1309 | @var{value} and @var{docstring}, and marks it as automatically | ||
| 1310 | buffer-local. It is equivalent to calling @code{defvar} followed by | ||
| 1311 | @code{make-variable-buffer-local}. @var{variable} should be an | ||
| 1312 | unquoted symbol. | ||
| 1313 | @end defmac | ||
| 1314 | |||
| 1300 | @defun local-variable-p variable &optional buffer | 1315 | @defun local-variable-p variable &optional buffer |
| 1301 | This returns @code{t} if @var{variable} is buffer-local in buffer | 1316 | This returns @code{t} if @var{variable} is buffer-local in buffer |
| 1302 | @var{buffer} (which defaults to the current buffer); otherwise, | 1317 | @var{buffer} (which defaults to the current buffer); otherwise, |
| @@ -1948,7 +1963,6 @@ Attempting to assign them any other value will result in an error: | |||
| 1948 | @error{} Wrong type argument: integerp, 1000.0 | 1963 | @error{} Wrong type argument: integerp, 1000.0 |
| 1949 | @end example | 1964 | @end example |
| 1950 | 1965 | ||
| 1951 | @c FIXME? Not sure this is the right place for this section. | ||
| 1952 | @node Generalized Variables | 1966 | @node Generalized Variables |
| 1953 | @section Generalized Variables | 1967 | @section Generalized Variables |
| 1954 | 1968 | ||
| @@ -1958,13 +1972,20 @@ a regular Lisp variable. But the @sc{car}s and @sc{cdr}s of lists, elements | |||
| 1958 | of arrays, properties of symbols, and many other locations are also | 1972 | of arrays, properties of symbols, and many other locations are also |
| 1959 | places where Lisp values are stored. | 1973 | places where Lisp values are stored. |
| 1960 | 1974 | ||
| 1961 | @c FIXME? Not sure this is a useful analogy... | ||
| 1962 | Generalized variables are analogous to ``lvalues'' in the C | 1975 | Generalized variables are analogous to ``lvalues'' in the C |
| 1963 | language, where @samp{x = a[i]} gets an element from an array | 1976 | language, where @samp{x = a[i]} gets an element from an array |
| 1964 | and @samp{a[i] = x} stores an element using the same notation. | 1977 | and @samp{a[i] = x} stores an element using the same notation. |
| 1965 | Just as certain forms like @code{a[i]} can be lvalues in C, there | 1978 | Just as certain forms like @code{a[i]} can be lvalues in C, there |
| 1966 | is a set of forms that can be generalized variables in Lisp. | 1979 | is a set of forms that can be generalized variables in Lisp. |
| 1967 | 1980 | ||
| 1981 | @menu | ||
| 1982 | * Setting Generalized Variables:: The @code{setf} macro. | ||
| 1983 | * Adding Generalized Variables:: Defining new @code{setf} forms. | ||
| 1984 | @end menu | ||
| 1985 | |||
| 1986 | @node Setting Generalized Variables | ||
| 1987 | @subsection The @code{setf} Macro | ||
| 1988 | |||
| 1968 | The @code{setf} macro is the most basic way to operate on generalized | 1989 | The @code{setf} macro is the most basic way to operate on generalized |
| 1969 | variables. The @code{setf} form is like @code{setq}, except that it | 1990 | variables. The @code{setf} form is like @code{setq}, except that it |
| 1970 | accepts arbitrary place forms on the left side rather than just | 1991 | accepts arbitrary place forms on the left side rather than just |
| @@ -1998,14 +2019,16 @@ so there is no performance penalty for using it in compiled code. | |||
| 1998 | A call to any of the following standard Lisp functions: | 2019 | A call to any of the following standard Lisp functions: |
| 1999 | 2020 | ||
| 2000 | @smallexample | 2021 | @smallexample |
| 2001 | car cdr nth nthcdr | 2022 | aref cddr symbol-function |
| 2002 | caar cadr cdar cddr | 2023 | car elt symbol-plist |
| 2003 | aref elt get gethash | 2024 | caar get symbol-value |
| 2004 | symbol-function symbol-value symbol-plist | 2025 | cadr gethash |
| 2026 | cdr nth | ||
| 2027 | cdar nthcdr | ||
| 2005 | @end smallexample | 2028 | @end smallexample |
| 2006 | 2029 | ||
| 2007 | @item | 2030 | @item |
| 2008 | The following Emacs-specific functions are also @code{setf}-able: | 2031 | A call to any of the following Emacs-specific functions: |
| 2009 | 2032 | ||
| 2010 | @smallexample | 2033 | @smallexample |
| 2011 | default-value process-get | 2034 | default-value process-get |
| @@ -2022,8 +2045,8 @@ process-filter | |||
| 2022 | @end itemize | 2045 | @end itemize |
| 2023 | 2046 | ||
| 2024 | @noindent | 2047 | @noindent |
| 2025 | Using any forms other than these in the @var{place} argument to | 2048 | @code{setf} signals an error if you pass a @var{place} form that it |
| 2026 | @code{setf} will signal an error. | 2049 | does not know how to handle. |
| 2027 | 2050 | ||
| 2028 | @c And for cl-lib's cl-getf. | 2051 | @c And for cl-lib's cl-getf. |
| 2029 | Note that for @code{nthcdr}, the list argument of the function must | 2052 | Note that for @code{nthcdr}, the list argument of the function must |
| @@ -2049,3 +2072,81 @@ place can be used to insert or delete at any position in a list. | |||
| 2049 | The @file{cl-lib} library defines various extensions for generalized | 2072 | The @file{cl-lib} library defines various extensions for generalized |
| 2050 | variables, including additional @code{setf} places. | 2073 | variables, including additional @code{setf} places. |
| 2051 | @xref{Generalized Variables,,, cl, Common Lisp Extensions}. | 2074 | @xref{Generalized Variables,,, cl, Common Lisp Extensions}. |
| 2075 | |||
| 2076 | |||
| 2077 | @node Adding Generalized Variables | ||
| 2078 | @subsection Defining new @code{setf} forms | ||
| 2079 | |||
| 2080 | This section describes how to define new forms that @code{setf} can | ||
| 2081 | operate on. | ||
| 2082 | |||
| 2083 | @defmac gv-define-simple-setter name setter &optional fix-return | ||
| 2084 | This macro enables you to easily define @code{setf} methods for simple | ||
| 2085 | cases. @var{name} is the name of a function, macro, or special form. | ||
| 2086 | You can use this macro whenever @var{name} has a directly | ||
| 2087 | corresponding @var{setter} function that updates it, e.g., | ||
| 2088 | @code{(gv-define-simple-setter car setcar)}. | ||
| 2089 | |||
| 2090 | This macro translates a call of the form | ||
| 2091 | |||
| 2092 | @example | ||
| 2093 | (setf (@var{name} @var{args}@dots{}) @var{value}) | ||
| 2094 | @end example | ||
| 2095 | |||
| 2096 | into | ||
| 2097 | @example | ||
| 2098 | (@var{setter} @var{args}@dots{} @var{value}) | ||
| 2099 | @end example | ||
| 2100 | |||
| 2101 | @noindent | ||
| 2102 | Such a @code{setf} call is documented to return @var{value}. This is | ||
| 2103 | no problem with, e.g., @code{car} and @code{setcar}, because | ||
| 2104 | @code{setcar} returns the value that it set. If your @var{setter} | ||
| 2105 | function does not return @var{value}, use a non-@code{nil} value for | ||
| 2106 | the @var{fix-return} argument of @code{gv-define-simple-setter}. This | ||
| 2107 | expands into something equivalent to | ||
| 2108 | @example | ||
| 2109 | (let ((temp @var{value})) | ||
| 2110 | (@var{setter} @var{args}@dots{} temp) | ||
| 2111 | temp) | ||
| 2112 | @end example | ||
| 2113 | so ensuring that it returns the correct result. | ||
| 2114 | @end defmac | ||
| 2115 | |||
| 2116 | |||
| 2117 | @defmac gv-define-setter name arglist &rest body | ||
| 2118 | This macro allows for more complex @code{setf} expansions than the | ||
| 2119 | previous form. You may need to use this form, for example, if there | ||
| 2120 | is no simple setter function to call, or if there is one but it | ||
| 2121 | requires different arguments to the place form. | ||
| 2122 | |||
| 2123 | This macro expands the form | ||
| 2124 | @code{(setf (@var{name} @var{args}@dots{}) @var{value})} by | ||
| 2125 | first binding the @code{setf} argument forms | ||
| 2126 | @code{(@var{value} @var{args}@dots{})} according to @var{arglist}, | ||
| 2127 | and then executing @var{body}. @var{body} should return a Lisp | ||
| 2128 | form that does the assignment, and finally returns the value that was | ||
| 2129 | set. An example of using this macro is: | ||
| 2130 | |||
| 2131 | @example | ||
| 2132 | (gv-define-setter caar (val x) `(setcar (car ,x) ,val)) | ||
| 2133 | @end example | ||
| 2134 | @end defmac | ||
| 2135 | |||
| 2136 | @c FIXME? Not sure what, if anything, to say about this. | ||
| 2137 | @ignore | ||
| 2138 | @defmac gv-define-expander name handler | ||
| 2139 | This is the most general way to define a new @code{setf} expansion. | ||
| 2140 | @end defmac | ||
| 2141 | @end ignore | ||
| 2142 | |||
| 2143 | @cindex CL note---no @code{setf} functions | ||
| 2144 | Common Lisp defines another way to specify the @code{setf} behavior of | ||
| 2145 | a function, namely ``@code{setf} functions'', whose names are lists | ||
| 2146 | @code{(setf @var{name})} rather than symbols. For example, | ||
| 2147 | @code{(defun (setf foo) @dots{})} defines the function that is used | ||
| 2148 | when @code{setf} is applied to @code{foo}. Emacs does not support | ||
| 2149 | this. It is a compile-time error to use @code{setf} on a form that | ||
| 2150 | has not already had an appropriate expansion defined. In Common Lisp, | ||
| 2151 | this is not an error since the function @code{(setf @var{func})} might | ||
| 2152 | be defined later. | ||
diff --git a/doc/lispref/windows.texi b/doc/lispref/windows.texi index 2fbb59cd1dd..bb02b1d54fd 100644 --- a/doc/lispref/windows.texi +++ b/doc/lispref/windows.texi | |||
| @@ -16,8 +16,10 @@ is displayed in windows. | |||
| 16 | * Windows and Frames:: Relating windows to the frame they appear on. | 16 | * Windows and Frames:: Relating windows to the frame they appear on. |
| 17 | * Window Sizes:: Accessing a window's size. | 17 | * Window Sizes:: Accessing a window's size. |
| 18 | * Resizing Windows:: Changing the sizes of windows. | 18 | * Resizing Windows:: Changing the sizes of windows. |
| 19 | * Splitting Windows:: Splitting one window into two windows. | 19 | * Splitting Windows:: Creating a new window. |
| 20 | * Deleting Windows:: Deleting a window gives its space to other windows. | 20 | * Deleting Windows:: Removing a window from its frame. |
| 21 | * Recombining Windows:: Preserving the frame layout when splitting and | ||
| 22 | deleting windows. | ||
| 21 | * Selecting Windows:: The selected window is the one that you edit in. | 23 | * Selecting Windows:: The selected window is the one that you edit in. |
| 22 | * Cyclic Window Ordering:: Moving around the existing windows. | 24 | * Cyclic Window Ordering:: Moving around the existing windows. |
| 23 | * Buffers and Windows:: Each window displays the contents of a buffer. | 25 | * Buffers and Windows:: Each window displays the contents of a buffer. |
| @@ -587,7 +589,7 @@ function @code{window-resizable} above. | |||
| 587 | The choice of which window edges this function alters depends on the | 589 | The choice of which window edges this function alters depends on the |
| 588 | values of the option @code{window-combination-resize} and the | 590 | values of the option @code{window-combination-resize} and the |
| 589 | combination limits of the involved windows; in some cases, it may alter | 591 | combination limits of the involved windows; in some cases, it may alter |
| 590 | both edges. @xref{Splitting Windows}. To resize by moving only the | 592 | both edges. @xref{Recombining Windows}. To resize by moving only the |
| 591 | bottom or right edge of a window, use the function | 593 | bottom or right edge of a window, use the function |
| 592 | @code{adjust-window-trailing-edge}, below. | 594 | @code{adjust-window-trailing-edge}, below. |
| 593 | @end defun | 595 | @end defun |
| @@ -795,26 +797,169 @@ A new live window @var{W2} is created, to the left of the internal | |||
| 795 | window @var{W3}. A new internal window @var{W1} is created, becoming | 797 | window @var{W3}. A new internal window @var{W1} is created, becoming |
| 796 | the new root window. | 798 | the new root window. |
| 797 | 799 | ||
| 798 | @defopt window-combination-resize | 800 | For interactive use, Emacs provides two commands which always split |
| 799 | If this variable is @code{nil}, @code{split-window} can only split a | 801 | the selected window. These call @code{split-window} internally. |
| 800 | window (denoted by @var{window}) if @var{window}'s screen area is large | ||
| 801 | enough to accommodate both itself and the new window. | ||
| 802 | 802 | ||
| 803 | If this variable is @code{t}, @code{split-window} tries to resize all | 803 | @deffn Command split-window-right &optional size |
| 804 | windows that are part of the same combination as @var{window}, in order | 804 | This function splits the selected window into two side-by-side |
| 805 | to accommodate the new window. In particular, this may allow | 805 | windows, putting the selected window on the left. If @var{size} is |
| 806 | @code{split-window} to succeed even if @var{window} is a fixed-size | 806 | positive, the left window gets @var{size} columns; if @var{size} is |
| 807 | window or too small to ordinarily split. Furthermore, subsequently | 807 | negative, the right window gets @minus{}@var{size} columns. |
| 808 | resizing or deleting @var{window} may resize all other windows in its | 808 | @end deffn |
| 809 | combination. | ||
| 810 | 809 | ||
| 811 | The default is @code{nil}. Other values are reserved for future use. | 810 | @deffn Command split-window-below &optional size |
| 812 | The value of this variable is ignored when | 811 | This function splits the selected window into two windows, one above |
| 813 | @code{window-combination-limit} is non-@code{nil} (see below). | 812 | the other, leaving the upper window selected. If @var{size} is |
| 813 | positive, the upper window gets @var{size} lines; if @var{size} is | ||
| 814 | negative, the lower window gets @minus{}@var{size} lines. | ||
| 815 | @end deffn | ||
| 816 | |||
| 817 | @defopt split-window-keep-point | ||
| 818 | If the value of this variable is non-@code{nil} (the default), | ||
| 819 | @code{split-window-below} behaves as described above. | ||
| 820 | |||
| 821 | If it is @code{nil}, @code{split-window-below} adjusts point in each | ||
| 822 | of the two windows to minimize redisplay. (This is useful on slow | ||
| 823 | terminals.) It selects whichever window contains the screen line that | ||
| 824 | point was previously on. Note that this only affects | ||
| 825 | @code{split-window-below}, not the lower-level @code{split-window} | ||
| 826 | function. | ||
| 814 | @end defopt | 827 | @end defopt |
| 815 | 828 | ||
| 816 | To illustrate the effect of @code{window-combination-resize}, | 829 | @node Deleting Windows |
| 817 | consider the following window configuration: | 830 | @section Deleting Windows |
| 831 | @cindex deleting windows | ||
| 832 | |||
| 833 | @dfn{Deleting} a window removes it from the frame's window tree. If | ||
| 834 | the window is a live window, it disappears from the screen. If the | ||
| 835 | window is an internal window, its child windows are deleted too. | ||
| 836 | |||
| 837 | Even after a window is deleted, it continues to exist as a Lisp | ||
| 838 | object, until there are no more references to it. Window deletion can | ||
| 839 | be reversed, by restoring a saved window configuration (@pxref{Window | ||
| 840 | Configurations}). | ||
| 841 | |||
| 842 | @deffn Command delete-window &optional window | ||
| 843 | This function removes @var{window} from display and returns | ||
| 844 | @code{nil}. If @var{window} is omitted or @code{nil}, it defaults to | ||
| 845 | the selected window. If deleting the window would leave no more | ||
| 846 | windows in the window tree (e.g. if it is the only live window in the | ||
| 847 | frame), an error is signaled. | ||
| 848 | |||
| 849 | By default, the space taken up by @var{window} is given to one of its | ||
| 850 | adjacent sibling windows, if any. However, if the variable | ||
| 851 | @code{window-combination-resize} is non-@code{nil}, the space is | ||
| 852 | proportionally distributed among any remaining windows in the window | ||
| 853 | combination. @xref{Recombining Windows}. | ||
| 854 | |||
| 855 | The behavior of this function may be altered by the window parameters | ||
| 856 | of @var{window}, so long as the variable | ||
| 857 | @code{ignore-window-parameters} is @code{nil}. If the value of | ||
| 858 | the @code{delete-window} window parameter is @code{t}, this function | ||
| 859 | ignores all other window parameters. Otherwise, if the value of the | ||
| 860 | @code{delete-window} window parameter is a function, that function is | ||
| 861 | called with the argument @var{window}, in lieu of the usual action of | ||
| 862 | @code{delete-window}. Otherwise, this function obeys the | ||
| 863 | @code{window-atom} or @code{window-side} window parameter, if any. | ||
| 864 | @xref{Window Parameters}. | ||
| 865 | @end deffn | ||
| 866 | |||
| 867 | @deffn Command delete-other-windows &optional window | ||
| 868 | This function makes @var{window} fill its frame, by deleting other | ||
| 869 | windows as necessary. If @var{window} is omitted or @code{nil}, it | ||
| 870 | defaults to the selected window. The return value is @code{nil}. | ||
| 871 | |||
| 872 | The behavior of this function may be altered by the window parameters | ||
| 873 | of @var{window}, so long as the variable | ||
| 874 | @code{ignore-window-parameters} is @code{nil}. If the value of | ||
| 875 | the @code{delete-other-windows} window parameter is @code{t}, this | ||
| 876 | function ignores all other window parameters. Otherwise, if the value | ||
| 877 | of the @code{delete-other-windows} window parameter is a function, | ||
| 878 | that function is called with the argument @var{window}, in lieu of the | ||
| 879 | usual action of @code{delete-other-windows}. Otherwise, this function | ||
| 880 | obeys the @code{window-atom} or @code{window-side} window parameter, | ||
| 881 | if any. @xref{Window Parameters}. | ||
| 882 | @end deffn | ||
| 883 | |||
| 884 | @deffn Command delete-windows-on &optional buffer-or-name frame | ||
| 885 | This function deletes all windows showing @var{buffer-or-name}, by | ||
| 886 | calling @code{delete-window} on those windows. @var{buffer-or-name} | ||
| 887 | should be a buffer, or the name of a buffer; if omitted or @code{nil}, | ||
| 888 | it defaults to the current buffer. If there are no windows showing | ||
| 889 | the specified buffer, this function does nothing. If the specified | ||
| 890 | buffer is a minibuffer, an error is signaled. | ||
| 891 | |||
| 892 | If there is a dedicated window showing the buffer, and that window is | ||
| 893 | the only one on its frame, this function also deletes that frame if it | ||
| 894 | is not the only frame on the terminal. | ||
| 895 | |||
| 896 | The optional argument @var{frame} specifies which frames to operate | ||
| 897 | on: | ||
| 898 | |||
| 899 | @itemize @bullet | ||
| 900 | @item @code{nil} | ||
| 901 | means operate on all frames. | ||
| 902 | @item @code{t} | ||
| 903 | means operate on the selected frame. | ||
| 904 | @item @code{visible} | ||
| 905 | means operate on all visible frames. | ||
| 906 | @item @code{0} | ||
| 907 | means operate on all visible or iconified frames. | ||
| 908 | @item A frame | ||
| 909 | means operate on that frame. | ||
| 910 | @end itemize | ||
| 911 | |||
| 912 | Note that this argument does not have the same meaning as in other | ||
| 913 | functions which scan all live windows (@pxref{Cyclic Window | ||
| 914 | Ordering}). Specifically, the meanings of @code{t} and @code{nil} here | ||
| 915 | are the opposite of what they are in those other functions. | ||
| 916 | @end deffn | ||
| 917 | |||
| 918 | |||
| 919 | @node Recombining Windows | ||
| 920 | @section Recombining Windows | ||
| 921 | |||
| 922 | When deleting the last sibling of a window @code{W}, its parent window | ||
| 923 | is deleted too, with @code{W} replacing it in the window tree. This | ||
| 924 | means that @code{W} must be recombined with its parent's siblings to | ||
| 925 | form a new window combination (@pxref{Windows and Frames}). In some | ||
| 926 | occasions, deleting a live window may even entail the deletion of two | ||
| 927 | internal windows. | ||
| 928 | |||
| 929 | @smallexample | ||
| 930 | @group | ||
| 931 | ______________________________________ | ||
| 932 | | ______ ____________________________ | | ||
| 933 | || || __________________________ || | ||
| 934 | || ||| ___________ ___________ ||| | ||
| 935 | || |||| || |||| | ||
| 936 | || ||||____W6_____||_____W7____|||| | ||
| 937 | || |||____________W4____________||| | ||
| 938 | || || __________________________ || | ||
| 939 | || ||| ||| | ||
| 940 | || ||| ||| | ||
| 941 | || |||____________W5____________||| | ||
| 942 | ||__W2__||_____________W3_____________ | | ||
| 943 | |__________________W1__________________| | ||
| 944 | |||
| 945 | @end group | ||
| 946 | @end smallexample | ||
| 947 | |||
| 948 | @noindent | ||
| 949 | Deleting @code{W5} in this configuration normally causes the deletion of | ||
| 950 | @code{W3} and @code{W4}. The remaining live windows @code{W2}, | ||
| 951 | @code{W6} and @code{W7} are recombined to form a new horizontal | ||
| 952 | combination with parent @code{W1}. | ||
| 953 | |||
| 954 | Sometimes, however, it makes sense to not delete a parent window like | ||
| 955 | @code{W4}. In particular, a parent window should not be removed when it | ||
| 956 | was used to preserve a combination embedded in a combination of the same | ||
| 957 | type. Such embeddings make sense to assure that when you split a window | ||
| 958 | and subsequently delete the new window, Emacs reestablishes the layout | ||
| 959 | of the associated frame as it existed before the splitting. | ||
| 960 | |||
| 961 | Consider a scenario starting with two live windows @code{W2} and | ||
| 962 | @code{W3} and their parent @code{W1}. | ||
| 818 | 963 | ||
| 819 | @smallexample | 964 | @smallexample |
| 820 | @group | 965 | @group |
| @@ -824,10 +969,10 @@ consider the following window configuration: | |||
| 824 | || || | 969 | || || |
| 825 | || || | 970 | || || |
| 826 | || || | 971 | || || |
| 827 | ||_________________W2_________________|| | ||
| 828 | | ____________________________________ | | ||
| 829 | || || | 972 | || || |
| 830 | || || | 973 | || || |
| 974 | ||_________________W2_________________|| | ||
| 975 | | ____________________________________ | | ||
| 831 | || || | 976 | || || |
| 832 | || || | 977 | || || |
| 833 | ||_________________W3_________________|| | 978 | ||_________________W3_________________|| |
| @@ -837,8 +982,7 @@ consider the following window configuration: | |||
| 837 | @end smallexample | 982 | @end smallexample |
| 838 | 983 | ||
| 839 | @noindent | 984 | @noindent |
| 840 | If @code{window-combination-resize} is @code{nil}, splitting window | 985 | Split @code{W2} to make a new window @code{W4} as follows. |
| 841 | @code{W3} leaves the size of @code{W2} unchanged: | ||
| 842 | 986 | ||
| 843 | @smallexample | 987 | @smallexample |
| 844 | @group | 988 | @group |
| @@ -846,24 +990,25 @@ If @code{window-combination-resize} is @code{nil}, splitting window | |||
| 846 | | ____________________________________ | | 990 | | ____________________________________ | |
| 847 | || || | 991 | || || |
| 848 | || || | 992 | || || |
| 849 | || || | ||
| 850 | || || | ||
| 851 | ||_________________W2_________________|| | 993 | ||_________________W2_________________|| |
| 852 | | ____________________________________ | | 994 | | ____________________________________ | |
| 853 | || || | 995 | || || |
| 854 | ||_________________W3_________________|| | ||
| 855 | | ____________________________________ | | ||
| 856 | || || | 996 | || || |
| 857 | ||_________________W4_________________|| | 997 | ||_________________W4_________________|| |
| 998 | | ____________________________________ | | ||
| 999 | || || | ||
| 1000 | || || | ||
| 1001 | ||_________________W3_________________|| | ||
| 858 | |__________________W1__________________| | 1002 | |__________________W1__________________| |
| 859 | 1003 | ||
| 860 | @end group | 1004 | @end group |
| 861 | @end smallexample | 1005 | @end smallexample |
| 862 | 1006 | ||
| 863 | @noindent | 1007 | @noindent |
| 864 | If @code{window-combination-resize} is @code{t}, splitting @code{W3} | 1008 | Now, when enlarging a window vertically, Emacs tries to obtain the |
| 865 | instead leaves all three live windows with approximately the same | 1009 | corresponding space from its lower sibling, provided such a window |
| 866 | height: | 1010 | exists. In our scenario, enlarging @code{W4} will steal space from |
| 1011 | @code{W3}. | ||
| 867 | 1012 | ||
| 868 | @smallexample | 1013 | @smallexample |
| 869 | @group | 1014 | @group |
| @@ -875,36 +1020,119 @@ height: | |||
| 875 | | ____________________________________ | | 1020 | | ____________________________________ | |
| 876 | || || | 1021 | || || |
| 877 | || || | 1022 | || || |
| 1023 | || || | ||
| 1024 | || || | ||
| 1025 | ||_________________W4_________________|| | ||
| 1026 | | ____________________________________ | | ||
| 878 | ||_________________W3_________________|| | 1027 | ||_________________W3_________________|| |
| 1028 | |__________________W1__________________| | ||
| 1029 | |||
| 1030 | @end group | ||
| 1031 | @end smallexample | ||
| 1032 | |||
| 1033 | @noindent | ||
| 1034 | Deleting @code{W4} will now give its entire space to @code{W2}, | ||
| 1035 | including the space earlier stolen from @code{W3}. | ||
| 1036 | |||
| 1037 | @smallexample | ||
| 1038 | @group | ||
| 1039 | ______________________________________ | ||
| 879 | | ____________________________________ | | 1040 | | ____________________________________ | |
| 880 | || || | 1041 | || || |
| 881 | || || | 1042 | || || |
| 882 | ||_________________W4_________________|| | 1043 | || || |
| 1044 | || || | ||
| 1045 | || || | ||
| 1046 | || || | ||
| 1047 | || || | ||
| 1048 | || || | ||
| 1049 | ||_________________W2_________________|| | ||
| 1050 | | ____________________________________ | | ||
| 1051 | ||_________________W3_________________|| | ||
| 883 | |__________________W1__________________| | 1052 | |__________________W1__________________| |
| 884 | 1053 | ||
| 885 | @end group | 1054 | @end group |
| 886 | @end smallexample | 1055 | @end smallexample |
| 887 | 1056 | ||
| 1057 | @noindent | ||
| 1058 | This can be counterintutive, in particular if @code{W4} were used for | ||
| 1059 | displaying a buffer only temporarily (@pxref{Temporary Displays}), and | ||
| 1060 | you want to continue working with the initial layout. | ||
| 1061 | |||
| 1062 | The behavior can be fixed by making a new parent window when splitting | ||
| 1063 | @code{W2}. The variable described next allows to do that. | ||
| 1064 | |||
| 888 | @defopt window-combination-limit | 1065 | @defopt window-combination-limit |
| 889 | If the value of this variable is @code{t}, the @code{split-window} | 1066 | This variable controls whether splitting a window shall make a new |
| 890 | function always creates a new internal window. If the value is | 1067 | parent window. The following values are recognized: |
| 891 | @code{nil}, the new live window is allowed to share the existing | 1068 | |
| 1069 | @table @code | ||
| 1070 | @item nil | ||
| 1071 | This means that the new live window is allowed to share the existing | ||
| 892 | parent window, if one exists, provided the split occurs in the same | 1072 | parent window, if one exists, provided the split occurs in the same |
| 893 | direction as the existing window combination (otherwise, a new | 1073 | direction as the existing window combination (otherwise, a new internal |
| 894 | internal window is created anyway). The default is @code{nil}. Other | 1074 | window is created anyway). |
| 895 | values are reserved for future use. | 1075 | |
| 896 | 1076 | @item window-size | |
| 897 | Thus, if the value of this variable is at all times @code{t}, then at | 1077 | In this case @code{display-buffer} makes a new parent window if it is |
| 898 | all times every window tree is a binary tree (a tree where each window | 1078 | passed a @code{window-height} or @code{window-width} entry in the |
| 899 | except the root window has exactly one sibling). | 1079 | @var{alist} argument (@pxref{Display Action Functions}). |
| 900 | 1080 | ||
| 901 | Furthermore, @code{split-window} calls | 1081 | @item temp-buffer |
| 902 | @code{set-window-combination-limit} on the newly-created internal | 1082 | This value causes the creation of a new parent window when a window is |
| 903 | window, recording the current value of this variable. This affects | 1083 | split for showing a temporary buffer (@pxref{Temporary Displays}) only. |
| 904 | how the window tree is rearranged when the child windows are deleted | 1084 | |
| 905 | (see below). | 1085 | @item display-buffer |
| 1086 | This means that when @code{display-buffer} (@pxref{Choosing Window}) | ||
| 1087 | splits a window it always makes a new parent window. | ||
| 1088 | |||
| 1089 | @item t | ||
| 1090 | In this case a new parent window is always created when splitting a | ||
| 1091 | window. Thus, if the value of this variable is at all times @code{t}, | ||
| 1092 | then at all times every window tree is a binary tree (a tree where each | ||
| 1093 | window except the root window has exactly one sibling). | ||
| 1094 | @end table | ||
| 1095 | |||
| 1096 | The default is @code{nil}. Other values are reserved for future use. | ||
| 1097 | |||
| 1098 | If, as a consequence of this variable's setting, @code{split-window} | ||
| 1099 | makes a new parent window, it also calls | ||
| 1100 | @code{set-window-combination-limit} (see below) on the newly-created | ||
| 1101 | internal window. This affects how the window tree is rearranged when | ||
| 1102 | the child windows are deleted (see below). | ||
| 906 | @end defopt | 1103 | @end defopt |
| 907 | 1104 | ||
| 1105 | If @code{window-combination-limit} is @code{t}, splitting @code{W2} in | ||
| 1106 | the initial configuration of our scenario would have produced this: | ||
| 1107 | |||
| 1108 | @smallexample | ||
| 1109 | @group | ||
| 1110 | ______________________________________ | ||
| 1111 | | ____________________________________ | | ||
| 1112 | || __________________________________ || | ||
| 1113 | ||| ||| | ||
| 1114 | |||________________W2________________||| | ||
| 1115 | || __________________________________ || | ||
| 1116 | ||| ||| | ||
| 1117 | |||________________W4________________||| | ||
| 1118 | ||_________________W5_________________|| | ||
| 1119 | | ____________________________________ | | ||
| 1120 | || || | ||
| 1121 | || || | ||
| 1122 | ||_________________W3_________________|| | ||
| 1123 | |__________________W1__________________| | ||
| 1124 | |||
| 1125 | @end group | ||
| 1126 | @end smallexample | ||
| 1127 | |||
| 1128 | @noindent | ||
| 1129 | A new internal window @code{W5} has been created; its children are | ||
| 1130 | @code{W2} and the new live window @code{W4}. Now, @code{W2} is the only | ||
| 1131 | sibling of @code{W4}, so enlarging @code{W4} will try to shrink | ||
| 1132 | @code{W2}, leaving @code{W3} unaffected. Observe that @code{W5} | ||
| 1133 | represents a vertical combination of two windows embedded in the | ||
| 1134 | vertical combination @code{W1}. | ||
| 1135 | |||
| 908 | @cindex window combination limit | 1136 | @cindex window combination limit |
| 909 | @defun set-window-combination-limit window limit | 1137 | @defun set-window-combination-limit window limit |
| 910 | This functions sets the @dfn{combination limit} of the window | 1138 | This functions sets the @dfn{combination limit} of the window |
| @@ -912,25 +1140,52 @@ This functions sets the @dfn{combination limit} of the window | |||
| 912 | function @code{window-combination-limit}. See below for its effects; | 1140 | function @code{window-combination-limit}. See below for its effects; |
| 913 | note that it is only meaningful for internal windows. The | 1141 | note that it is only meaningful for internal windows. The |
| 914 | @code{split-window} function automatically calls this function, passing | 1142 | @code{split-window} function automatically calls this function, passing |
| 915 | the value of the variable @code{window-combination-limit} as | 1143 | it @code{t} as @var{limit}, provided the value of the variable |
| 916 | @var{limit}. | 1144 | @code{window-combination-limit} is @code{t} when it is called. |
| 917 | @end defun | 1145 | @end defun |
| 918 | 1146 | ||
| 919 | @defun window-combination-limit window | 1147 | @defun window-combination-limit window |
| 920 | This function returns the combination limit for @var{window}. | 1148 | This function returns the combination limit for @var{window}. |
| 921 | 1149 | ||
| 922 | The combination limit is meaningful only for an internal window. If | 1150 | The combination limit is meaningful only for an internal window. If it |
| 923 | it is @code{nil}, then Emacs is allowed to automatically delete | 1151 | is @code{nil}, then Emacs is allowed to automatically delete |
| 924 | @var{window}, in response to a window deletion, in order to group the | 1152 | @var{window}, in response to a window deletion, in order to group the |
| 925 | child windows of @var{window} with its sibling windows to form a new | 1153 | child windows of @var{window} with its sibling windows to form a new |
| 926 | window combination. If the combination limit is @code{t}, the child | 1154 | window combination. If the combination limit is @code{t}, the child |
| 927 | windows of @var{window} are never automatically re-combined with its | 1155 | windows of @var{window} are never automatically recombined with its |
| 928 | siblings. | 1156 | siblings. |
| 1157 | |||
| 1158 | If, in the configuration shown at the beginning of this section, the | ||
| 1159 | combination limit of @code{W4} (the parent window of @code{W6} and | ||
| 1160 | @code{W7}) is @code{t}, deleting @code{W5} will not implicitly delete | ||
| 1161 | @code{W4} too. | ||
| 929 | @end defun | 1162 | @end defun |
| 930 | 1163 | ||
| 931 | To illustrate the effect of @code{window-combination-limit}, | 1164 | Alternatively, the problems sketched above can be avoided by always |
| 932 | consider the following configuration (throughout this example, we will | 1165 | resizing all windows in the same combination whenever one of its windows |
| 933 | assume that @code{window-combination-resize} is @code{nil}): | 1166 | is split or deleted. This also permits to split windows that would be |
| 1167 | otherwise too small for such an operation. | ||
| 1168 | |||
| 1169 | @defopt window-combination-resize | ||
| 1170 | If this variable is @code{nil}, @code{split-window} can only split a | ||
| 1171 | window (denoted by @var{window}) if @var{window}'s screen area is large | ||
| 1172 | enough to accommodate both itself and the new window. | ||
| 1173 | |||
| 1174 | If this variable is @code{t}, @code{split-window} tries to resize all | ||
| 1175 | windows that are part of the same combination as @var{window}, in order | ||
| 1176 | to accommodate the new window. In particular, this may allow | ||
| 1177 | @code{split-window} to succeed even if @var{window} is a fixed-size | ||
| 1178 | window or too small to ordinarily split. Furthermore, subsequently | ||
| 1179 | resizing or deleting @var{window} may resize all other windows in its | ||
| 1180 | combination. | ||
| 1181 | |||
| 1182 | The default is @code{nil}. Other values are reserved for future use. | ||
| 1183 | The value of this variable is ignored when | ||
| 1184 | @code{window-combination-limit} is non-@code{nil}. | ||
| 1185 | @end defopt | ||
| 1186 | |||
| 1187 | To illustrate the effect of @code{window-combination-resize}, consider | ||
| 1188 | the following frame layout. | ||
| 934 | 1189 | ||
| 935 | @smallexample | 1190 | @smallexample |
| 936 | @group | 1191 | @group |
| @@ -940,12 +1195,12 @@ assume that @code{window-combination-resize} is @code{nil}): | |||
| 940 | || || | 1195 | || || |
| 941 | || || | 1196 | || || |
| 942 | || || | 1197 | || || |
| 943 | || || | ||
| 944 | || || | ||
| 945 | ||_________________W2_________________|| | 1198 | ||_________________W2_________________|| |
| 946 | | ____________________________________ | | 1199 | | ____________________________________ | |
| 947 | || || | 1200 | || || |
| 948 | || || | 1201 | || || |
| 1202 | || || | ||
| 1203 | || || | ||
| 949 | ||_________________W3_________________|| | 1204 | ||_________________W3_________________|| |
| 950 | |__________________W1__________________| | 1205 | |__________________W1__________________| |
| 951 | 1206 | ||
| @@ -953,8 +1208,8 @@ assume that @code{window-combination-resize} is @code{nil}): | |||
| 953 | @end smallexample | 1208 | @end smallexample |
| 954 | 1209 | ||
| 955 | @noindent | 1210 | @noindent |
| 956 | If @code{window-combination-limit} is @code{nil}, splitting @code{W2} | 1211 | If @code{window-combination-resize} is @code{nil}, splitting window |
| 957 | into two windows, one above the other, yields | 1212 | @code{W3} leaves the size of @code{W2} unchanged: |
| 958 | 1213 | ||
| 959 | @smallexample | 1214 | @smallexample |
| 960 | @group | 1215 | @group |
| @@ -962,171 +1217,50 @@ into two windows, one above the other, yields | |||
| 962 | | ____________________________________ | | 1217 | | ____________________________________ | |
| 963 | || || | 1218 | || || |
| 964 | || || | 1219 | || || |
| 965 | ||_________________W2_________________|| | ||
| 966 | | ____________________________________ | | ||
| 967 | || || | 1220 | || || |
| 968 | || || | 1221 | || || |
| 969 | ||_________________W4_________________|| | 1222 | ||_________________W2_________________|| |
| 970 | | ____________________________________ | | 1223 | | ____________________________________ | |
| 971 | || || | 1224 | || || |
| 972 | || || | ||
| 973 | ||_________________W3_________________|| | 1225 | ||_________________W3_________________|| |
| 1226 | | ____________________________________ | | ||
| 1227 | || || | ||
| 1228 | ||_________________W4_________________|| | ||
| 974 | |__________________W1__________________| | 1229 | |__________________W1__________________| |
| 975 | 1230 | ||
| 976 | @end group | 1231 | @end group |
| 977 | @end smallexample | 1232 | @end smallexample |
| 978 | 1233 | ||
| 979 | @noindent | 1234 | @noindent |
| 980 | The newly-created window, @code{W4}, shares the same internal window | 1235 | If @code{window-combination-resize} is @code{t}, splitting @code{W3} |
| 981 | @code{W1}. If @code{W4} is resized, it is allowed to resize the other | 1236 | instead leaves all three live windows with approximately the same |
| 982 | live window, @code{W3}. | 1237 | height: |
| 983 | |||
| 984 | If @code{window-combination-limit} is @code{t}, splitting @code{W2} | ||
| 985 | in the initial configuration would instead have produced this: | ||
| 986 | 1238 | ||
| 987 | @smallexample | 1239 | @smallexample |
| 988 | @group | 1240 | @group |
| 989 | ______________________________________ | 1241 | ______________________________________ |
| 990 | | ____________________________________ | | 1242 | | ____________________________________ | |
| 991 | || __________________________________ || | 1243 | || || |
| 992 | ||| ||| | 1244 | || || |
| 993 | |||________________W2________________||| | 1245 | ||_________________W2_________________|| |
| 994 | || __________________________________ || | ||
| 995 | ||| ||| | ||
| 996 | |||________________W4________________||| | ||
| 997 | ||_________________W5_________________|| | ||
| 998 | | ____________________________________ | | 1246 | | ____________________________________ | |
| 999 | || || | 1247 | || || |
| 1000 | || || | 1248 | || || |
| 1001 | ||_________________W3_________________|| | 1249 | ||_________________W3_________________|| |
| 1250 | | ____________________________________ | | ||
| 1251 | || || | ||
| 1252 | || || | ||
| 1253 | ||_________________W4_________________|| | ||
| 1002 | |__________________W1__________________| | 1254 | |__________________W1__________________| |
| 1003 | 1255 | ||
| 1004 | @end group | 1256 | @end group |
| 1005 | @end smallexample | 1257 | @end smallexample |
| 1006 | 1258 | ||
| 1007 | @noindent | 1259 | @noindent |
| 1008 | A new internal window @code{W5} has been created; its children are | 1260 | Deleting any of the live windows @code{W2}, @code{W3} or @code{W4} will |
| 1009 | @code{W2} and the new live window @code{W4}. Now, @code{W2} is the | 1261 | distribute its space proportionally among the two remaining live |
| 1010 | only sibling of @code{W4}, so resizing @code{W4} will resize | 1262 | windows. |
| 1011 | @code{W2}, leaving @code{W3} unaffected. | ||
| 1012 | |||
| 1013 | For interactive use, Emacs provides two commands which always split | ||
| 1014 | the selected window. These call @code{split-window} internally. | ||
| 1015 | |||
| 1016 | @deffn Command split-window-right &optional size | ||
| 1017 | This function splits the selected window into two side-by-side | ||
| 1018 | windows, putting the selected window on the left. If @var{size} is | ||
| 1019 | positive, the left window gets @var{size} columns; if @var{size} is | ||
| 1020 | negative, the right window gets @minus{}@var{size} columns. | ||
| 1021 | @end deffn | ||
| 1022 | |||
| 1023 | @deffn Command split-window-below &optional size | ||
| 1024 | This function splits the selected window into two windows, one above | ||
| 1025 | the other, leaving the upper window selected. If @var{size} is | ||
| 1026 | positive, the upper window gets @var{size} lines; if @var{size} is | ||
| 1027 | negative, the lower window gets @minus{}@var{size} lines. | ||
| 1028 | @end deffn | ||
| 1029 | |||
| 1030 | @defopt split-window-keep-point | ||
| 1031 | If the value of this variable is non-@code{nil} (the default), | ||
| 1032 | @code{split-window-below} behaves as described above. | ||
| 1033 | 1263 | ||
| 1034 | If it is @code{nil}, @code{split-window-below} adjusts point in each | ||
| 1035 | of the two windows to minimize redisplay. (This is useful on slow | ||
| 1036 | terminals.) It selects whichever window contains the screen line that | ||
| 1037 | point was previously on. Note that this only affects | ||
| 1038 | @code{split-window-below}, not the lower-level @code{split-window} | ||
| 1039 | function. | ||
| 1040 | @end defopt | ||
| 1041 | |||
| 1042 | @node Deleting Windows | ||
| 1043 | @section Deleting Windows | ||
| 1044 | @cindex deleting windows | ||
| 1045 | |||
| 1046 | @dfn{Deleting} a window removes it from the frame's window tree. If | ||
| 1047 | the window is a live window, it disappears from the screen. If the | ||
| 1048 | window is an internal window, its child windows are deleted too. | ||
| 1049 | |||
| 1050 | Even after a window is deleted, it continues to exist as a Lisp | ||
| 1051 | object, until there are no more references to it. Window deletion can | ||
| 1052 | be reversed, by restoring a saved window configuration (@pxref{Window | ||
| 1053 | Configurations}). | ||
| 1054 | |||
| 1055 | @deffn Command delete-window &optional window | ||
| 1056 | This function removes @var{window} from display and returns | ||
| 1057 | @code{nil}. If @var{window} is omitted or @code{nil}, it defaults to | ||
| 1058 | the selected window. If deleting the window would leave no more | ||
| 1059 | windows in the window tree (e.g. if it is the only live window in the | ||
| 1060 | frame), an error is signaled. | ||
| 1061 | |||
| 1062 | By default, the space taken up by @var{window} is given to one of its | ||
| 1063 | adjacent sibling windows, if any. However, if the variable | ||
| 1064 | @code{window-combination-resize} is non-@code{nil}, the space is | ||
| 1065 | proportionally distributed among any remaining windows in the window | ||
| 1066 | combination. @xref{Splitting Windows}. | ||
| 1067 | |||
| 1068 | The behavior of this function may be altered by the window parameters | ||
| 1069 | of @var{window}, so long as the variable | ||
| 1070 | @code{ignore-window-parameters} is @code{nil}. If the value of | ||
| 1071 | the @code{delete-window} window parameter is @code{t}, this function | ||
| 1072 | ignores all other window parameters. Otherwise, if the value of the | ||
| 1073 | @code{delete-window} window parameter is a function, that function is | ||
| 1074 | called with the argument @var{window}, in lieu of the usual action of | ||
| 1075 | @code{delete-window}. Otherwise, this function obeys the | ||
| 1076 | @code{window-atom} or @code{window-side} window parameter, if any. | ||
| 1077 | @xref{Window Parameters}. | ||
| 1078 | @end deffn | ||
| 1079 | |||
| 1080 | @deffn Command delete-other-windows &optional window | ||
| 1081 | This function makes @var{window} fill its frame, by deleting other | ||
| 1082 | windows as necessary. If @var{window} is omitted or @code{nil}, it | ||
| 1083 | defaults to the selected window. The return value is @code{nil}. | ||
| 1084 | |||
| 1085 | The behavior of this function may be altered by the window parameters | ||
| 1086 | of @var{window}, so long as the variable | ||
| 1087 | @code{ignore-window-parameters} is @code{nil}. If the value of | ||
| 1088 | the @code{delete-other-windows} window parameter is @code{t}, this | ||
| 1089 | function ignores all other window parameters. Otherwise, if the value | ||
| 1090 | of the @code{delete-other-windows} window parameter is a function, | ||
| 1091 | that function is called with the argument @var{window}, in lieu of the | ||
| 1092 | usual action of @code{delete-other-windows}. Otherwise, this function | ||
| 1093 | obeys the @code{window-atom} or @code{window-side} window parameter, | ||
| 1094 | if any. @xref{Window Parameters}. | ||
| 1095 | @end deffn | ||
| 1096 | |||
| 1097 | @deffn Command delete-windows-on &optional buffer-or-name frame | ||
| 1098 | This function deletes all windows showing @var{buffer-or-name}, by | ||
| 1099 | calling @code{delete-window} on those windows. @var{buffer-or-name} | ||
| 1100 | should be a buffer, or the name of a buffer; if omitted or @code{nil}, | ||
| 1101 | it defaults to the current buffer. If there are no windows showing | ||
| 1102 | the specified buffer, this function does nothing. If the specified | ||
| 1103 | buffer is a minibuffer, an error is signaled. | ||
| 1104 | |||
| 1105 | If there is a dedicated window showing the buffer, and that window is | ||
| 1106 | the only one on its frame, this function also deletes that frame if it | ||
| 1107 | is not the only frame on the terminal. | ||
| 1108 | |||
| 1109 | The optional argument @var{frame} specifies which frames to operate | ||
| 1110 | on: | ||
| 1111 | |||
| 1112 | @itemize @bullet | ||
| 1113 | @item @code{nil} | ||
| 1114 | means operate on all frames. | ||
| 1115 | @item @code{t} | ||
| 1116 | means operate on the selected frame. | ||
| 1117 | @item @code{visible} | ||
| 1118 | means operate on all visible frames. | ||
| 1119 | @item @code{0} | ||
| 1120 | means operate on all visible or iconified frames. | ||
| 1121 | @item A frame | ||
| 1122 | means operate on that frame. | ||
| 1123 | @end itemize | ||
| 1124 | |||
| 1125 | Note that this argument does not have the same meaning as in other | ||
| 1126 | functions which scan all live windows (@pxref{Cyclic Window | ||
| 1127 | Ordering}). Specifically, the meanings of @code{t} and @code{nil} here | ||
| 1128 | are the opposite of what they are in those other functions. | ||
| 1129 | @end deffn | ||
| 1130 | 1264 | ||
| 1131 | @node Selecting Windows | 1265 | @node Selecting Windows |
| 1132 | @section Selecting Windows | 1266 | @section Selecting Windows |
diff --git a/doc/misc/ChangeLog b/doc/misc/ChangeLog index 0a32fd82044..2518e72ef1e 100644 --- a/doc/misc/ChangeLog +++ b/doc/misc/ChangeLog | |||
| @@ -1,3 +1,32 @@ | |||
| 1 | 2012-11-10 Chong Yidong <cyd@gnu.org> | ||
| 2 | |||
| 3 | * url.texi (Introduction): Move url-configuration-directory to | ||
| 4 | Customization node. | ||
| 5 | (Parsed URIs): Split into its own node. | ||
| 6 | (URI Encoding): New node. | ||
| 7 | (Defining New URLs): Remove empty chapter. | ||
| 8 | (Retrieving URLs): Add an introduction. Doc fix for url-retrieve. | ||
| 9 | Improve docs for url-queue-*. | ||
| 10 | (Supported URL Types): Copyedits. Delete empty subnodes. | ||
| 11 | |||
| 12 | * url.texi (Introduction): Rename from Getting Started. Rewrite | ||
| 13 | the introduction. | ||
| 14 | (URI Parsing): Rewrite. Omit the obsolete attributes slot. | ||
| 15 | |||
| 16 | 2012-11-10 Glenn Morris <rgm@gnu.org> | ||
| 17 | |||
| 18 | * cl.texi (Obsolete Setf Customization): | ||
| 19 | Revert defsetf example to the more correct let rather than prog1. | ||
| 20 | Give define-modify-macro, defsetf, and define-setf-method | ||
| 21 | gv.el replacements. | ||
| 22 | |||
| 23 | * cl.texi (Overview): Mention EIEIO here, as well as the appendix. | ||
| 24 | (Setf Extensions): Remove obsolete reference. | ||
| 25 | (Obsolete Setf Customization): | ||
| 26 | Move note on lack of setf functions to lispref/variables.texi. | ||
| 27 | Undocument get-setf-method, since it no longer exists. | ||
| 28 | Mention simple defsetf replaced by gv-define-simple-setter. | ||
| 29 | |||
| 1 | 2012-11-03 Glenn Morris <rgm@gnu.org> | 30 | 2012-11-03 Glenn Morris <rgm@gnu.org> |
| 2 | 31 | ||
| 3 | * cl.texi: Further general copyedits. | 32 | * cl.texi: Further general copyedits. |
diff --git a/doc/misc/cl.texi b/doc/misc/cl.texi index e182c2600f9..a50be1027f3 100644 --- a/doc/misc/cl.texi +++ b/doc/misc/cl.texi | |||
| @@ -107,7 +107,8 @@ for various reasons: | |||
| 107 | @item | 107 | @item |
| 108 | Some features are too complex or bulky relative to their benefit | 108 | Some features are too complex or bulky relative to their benefit |
| 109 | to Emacs Lisp programmers. CLOS and Common Lisp streams are fine | 109 | to Emacs Lisp programmers. CLOS and Common Lisp streams are fine |
| 110 | examples of this group. | 110 | examples of this group. (The separate package EIEIO implements |
| 111 | a subset of CLOS functionality. @xref{Top, , Introduction, eieio, EIEIO}.) | ||
| 111 | 112 | ||
| 112 | @item | 113 | @item |
| 113 | Other features cannot be implemented without modification to the | 114 | Other features cannot be implemented without modification to the |
| @@ -974,7 +975,7 @@ a | |||
| 974 | The generalized variable @code{buffer-substring}, listed above, | 975 | The generalized variable @code{buffer-substring}, listed above, |
| 975 | also works in this way by replacing a portion of the current buffer. | 976 | also works in this way by replacing a portion of the current buffer. |
| 976 | 977 | ||
| 977 | @c FIXME? Also `eq'? (see cl-lib.el) | 978 | @c FIXME? Also `eq'? (see cl-lib.el) |
| 978 | 979 | ||
| 979 | @c Currently commented out in cl.el. | 980 | @c Currently commented out in cl.el. |
| 980 | @ignore | 981 | @ignore |
| @@ -989,13 +990,10 @@ only interesting when used with places you define yourself with | |||
| 989 | @xref{Obsolete Setf Customization}. | 990 | @xref{Obsolete Setf Customization}. |
| 990 | @end ignore | 991 | @end ignore |
| 991 | 992 | ||
| 993 | @c FIXME? Is this still true? | ||
| 992 | @item | 994 | @item |
| 993 | A macro call, in which case the macro is expanded and @code{setf} | 995 | A macro call, in which case the macro is expanded and @code{setf} |
| 994 | is applied to the resulting form. | 996 | is applied to the resulting form. |
| 995 | |||
| 996 | @item | ||
| 997 | Any form for which a @code{defsetf} or @code{define-setf-method} | ||
| 998 | has been made. @xref{Obsolete Setf Customization}. | ||
| 999 | @end itemize | 997 | @end itemize |
| 1000 | 998 | ||
| 1001 | @c FIXME should this be in lispref? It seems self-evident. | 999 | @c FIXME should this be in lispref? It seems self-evident. |
| @@ -2867,7 +2865,6 @@ temporary variables. | |||
| 2867 | This function creates a new, uninterned symbol (using @code{make-symbol}) | 2865 | This function creates a new, uninterned symbol (using @code{make-symbol}) |
| 2868 | with a unique name. (The name of an uninterned symbol is relevant | 2866 | with a unique name. (The name of an uninterned symbol is relevant |
| 2869 | only if the symbol is printed.) By default, the name is generated | 2867 | only if the symbol is printed.) By default, the name is generated |
| 2870 | @c FIXME no longer true? | ||
| 2871 | from an increasing sequence of numbers, @samp{G1000}, @samp{G1001}, | 2868 | from an increasing sequence of numbers, @samp{G1000}, @samp{G1001}, |
| 2872 | @samp{G1002}, etc. If the optional argument @var{x} is a string, that | 2869 | @samp{G1002}, etc. If the optional argument @var{x} is a string, that |
| 2873 | string is used as a prefix instead of @samp{G}. Uninterned symbols | 2870 | string is used as a prefix instead of @samp{G}. Uninterned symbols |
| @@ -4481,14 +4478,6 @@ The @code{equal} predicate does not distinguish | |||
| 4481 | between IEEE floating-point plus and minus zero. The @code{cl-equalp} | 4478 | between IEEE floating-point plus and minus zero. The @code{cl-equalp} |
| 4482 | predicate has several differences with Common Lisp; @pxref{Predicates}. | 4479 | predicate has several differences with Common Lisp; @pxref{Predicates}. |
| 4483 | 4480 | ||
| 4484 | @c FIXME consider moving to lispref | ||
| 4485 | @ignore | ||
| 4486 | The @code{setf} mechanism is entirely compatible, except that | ||
| 4487 | setf-methods return a list of five values rather than five | ||
| 4488 | values directly. Also, the new ``@code{setf} function'' concept | ||
| 4489 | (typified by @code{(defun (setf foo) @dots{})}) is not implemented. | ||
| 4490 | @end ignore | ||
| 4491 | |||
| 4492 | The @code{cl-do-all-symbols} form is the same as @code{cl-do-symbols} | 4481 | The @code{cl-do-all-symbols} form is the same as @code{cl-do-symbols} |
| 4493 | with no @var{obarray} argument. In Common Lisp, this form would | 4482 | with no @var{obarray} argument. In Common Lisp, this form would |
| 4494 | iterate over all symbols in all packages. Since Emacs obarrays | 4483 | iterate over all symbols in all packages. Since Emacs obarrays |
| @@ -4907,15 +4896,17 @@ Common Lisp defines three macros, @code{define-modify-macro}, | |||
| 4907 | @code{defsetf}, and @code{define-setf-method}, that allow the | 4896 | @code{defsetf}, and @code{define-setf-method}, that allow the |
| 4908 | user to extend generalized variables in various ways. | 4897 | user to extend generalized variables in various ways. |
| 4909 | In Emacs, these are obsolete, replaced by various features of | 4898 | In Emacs, these are obsolete, replaced by various features of |
| 4910 | @file{gv.el} in Emacs 24.3. Many of the implementation | 4899 | @file{gv.el} in Emacs 24.3. |
| 4911 | details in the following are out-of-date. | 4900 | @xref{Adding Generalized Variables,,,elisp,GNU Emacs Lisp Reference Manual}. |
| 4912 | @c FIXME this whole section needs updating. | 4901 | |
| 4913 | 4902 | ||
| 4914 | @defmac define-modify-macro name arglist function [doc-string] | 4903 | @defmac define-modify-macro name arglist function [doc-string] |
| 4915 | This macro defines a ``read-modify-write'' macro similar to | 4904 | This macro defines a ``read-modify-write'' macro similar to |
| 4916 | @code{cl-incf} and @code{cl-decf}. The macro @var{name} is defined | 4905 | @code{cl-incf} and @code{cl-decf}. You can replace this macro |
| 4917 | to take a @var{place} argument followed by additional arguments | 4906 | with @code{gv-letplace}. |
| 4918 | described by @var{arglist}. The call | 4907 | |
| 4908 | The macro @var{name} is defined to take a @var{place} argument | ||
| 4909 | followed by additional arguments described by @var{arglist}. The call | ||
| 4919 | 4910 | ||
| 4920 | @example | 4911 | @example |
| 4921 | (@var{name} @var{place} @var{args}@dots{}) | 4912 | (@var{name} @var{place} @var{args}@dots{}) |
| @@ -4938,8 +4929,8 @@ which in turn is roughly equivalent to | |||
| 4938 | For example: | 4929 | For example: |
| 4939 | 4930 | ||
| 4940 | @example | 4931 | @example |
| 4941 | (define-modify-macro cl-incf (&optional (n 1)) +) | 4932 | (define-modify-macro incf (&optional (n 1)) +) |
| 4942 | (define-modify-macro cl-concatf (&rest args) concat) | 4933 | (define-modify-macro concatf (&rest args) concat) |
| 4943 | @end example | 4934 | @end example |
| 4944 | 4935 | ||
| 4945 | Note that @code{&key} is not allowed in @var{arglist}, but | 4936 | Note that @code{&key} is not allowed in @var{arglist}, but |
| @@ -4948,16 +4939,31 @@ Note that @code{&key} is not allowed in @var{arglist}, but | |||
| 4948 | Most of the modify macros defined by Common Lisp do not exactly | 4939 | Most of the modify macros defined by Common Lisp do not exactly |
| 4949 | follow the pattern of @code{define-modify-macro}. For example, | 4940 | follow the pattern of @code{define-modify-macro}. For example, |
| 4950 | @code{push} takes its arguments in the wrong order, and @code{pop} | 4941 | @code{push} takes its arguments in the wrong order, and @code{pop} |
| 4951 | is completely irregular. You can define these macros ``by hand'' | 4942 | is completely irregular. |
| 4952 | using @code{get-setf-method}, or consult the source | 4943 | |
| 4953 | to see how to use the internal @code{setf} building blocks. | 4944 | The above @code{incf} example could be written using |
| 4945 | @code{gv-letplace} as: | ||
| 4946 | @example | ||
| 4947 | (defmacro incf (place &optional n) | ||
| 4948 | (gv-letplace (getter setter) place | ||
| 4949 | (macroexp-let2 nil v (or n 1) | ||
| 4950 | (funcall setter `(+ ,v ,getter))))) | ||
| 4951 | @end example | ||
| 4952 | @ignore | ||
| 4953 | (defmacro concatf (place &rest args) | ||
| 4954 | (gv-letplace (getter setter) place | ||
| 4955 | (macroexp-let2 nil v (mapconcat 'identity args "") | ||
| 4956 | (funcall setter `(concat ,getter ,v))))) | ||
| 4957 | @end ignore | ||
| 4954 | @end defmac | 4958 | @end defmac |
| 4955 | 4959 | ||
| 4956 | @defmac defsetf access-fn update-fn | 4960 | @defmac defsetf access-fn update-fn |
| 4957 | This is the simpler of two @code{defsetf} forms. Where | 4961 | This is the simpler of two @code{defsetf} forms, and is |
| 4958 | @var{access-fn} is the name of a function which accesses a place, | 4962 | replaced by @code{gv-define-simple-setter}. |
| 4959 | this declares @var{update-fn} to be the corresponding store | 4963 | |
| 4960 | function. From now on, | 4964 | With @var{access-fn} the name of a function that accesses a place, |
| 4965 | this declares @var{update-fn} to be the corresponding store function. | ||
| 4966 | From now on, | ||
| 4961 | 4967 | ||
| 4962 | @example | 4968 | @example |
| 4963 | (setf (@var{access-fn} @var{arg1} @var{arg2} @var{arg3}) @var{value}) | 4969 | (setf (@var{access-fn} @var{arg1} @var{arg2} @var{arg3}) @var{value}) |
| @@ -4972,7 +4978,7 @@ will be expanded to | |||
| 4972 | 4978 | ||
| 4973 | @noindent | 4979 | @noindent |
| 4974 | The @var{update-fn} is required to be either a true function, or | 4980 | The @var{update-fn} is required to be either a true function, or |
| 4975 | a macro which evaluates its arguments in a function-like way. Also, | 4981 | a macro that evaluates its arguments in a function-like way. Also, |
| 4976 | the @var{update-fn} is expected to return @var{value} as its result. | 4982 | the @var{update-fn} is expected to return @var{value} as its result. |
| 4977 | Otherwise, the above expansion would not obey the rules for the way | 4983 | Otherwise, the above expansion would not obey the rules for the way |
| 4978 | @code{setf} is supposed to behave. | 4984 | @code{setf} is supposed to behave. |
| @@ -4988,25 +4994,32 @@ something more like | |||
| 4988 | temp) | 4994 | temp) |
| 4989 | @end example | 4995 | @end example |
| 4990 | 4996 | ||
| 4991 | Some examples of the use of @code{defsetf}, drawn from the standard | 4997 | Some examples are: |
| 4992 | suite of setf methods, are: | ||
| 4993 | 4998 | ||
| 4994 | @example | 4999 | @example |
| 4995 | (defsetf car setcar) | 5000 | (defsetf car setcar) |
| 4996 | (defsetf symbol-value set) | ||
| 4997 | (defsetf buffer-name rename-buffer t) | 5001 | (defsetf buffer-name rename-buffer t) |
| 4998 | @end example | 5002 | @end example |
| 5003 | |||
| 5004 | These translate directly to @code{gv-define-simple-setter}: | ||
| 5005 | |||
| 5006 | @example | ||
| 5007 | (gv-define-simple-setter car setcar) | ||
| 5008 | (gv-define-simple-setter buffer-name rename-buffer t) | ||
| 5009 | @end example | ||
| 4999 | @end defmac | 5010 | @end defmac |
| 5000 | 5011 | ||
| 5001 | @defmac defsetf access-fn arglist (store-var) forms@dots{} | 5012 | @defmac defsetf access-fn arglist (store-var) forms@dots{} |
| 5002 | This is the second, more complex, form of @code{defsetf}. It is | 5013 | This is the second, more complex, form of @code{defsetf}. |
| 5003 | rather like @code{defmacro} except for the additional @var{store-var} | 5014 | It can be replaced by @code{gv-define-setter}. |
| 5004 | argument. The @var{forms} should return a Lisp form that stores | 5015 | |
| 5005 | the value of @var{store-var} into the generalized variable formed | 5016 | This form of @code{defsetf} is rather like @code{defmacro} except for |
| 5006 | by a call to @var{access-fn} with arguments described by @var{arglist}. | 5017 | the additional @var{store-var} argument. The @var{forms} should |
| 5007 | The @var{forms} may begin with a string which documents the @code{setf} | 5018 | return a Lisp form that stores the value of @var{store-var} into the |
| 5008 | method (analogous to the doc string that appears at the front of a | 5019 | generalized variable formed by a call to @var{access-fn} with |
| 5009 | function). | 5020 | arguments described by @var{arglist}. The @var{forms} may begin with |
| 5021 | a string which documents the @code{setf} method (analogous to the doc | ||
| 5022 | string that appears at the front of a function). | ||
| 5010 | 5023 | ||
| 5011 | For example, the simple form of @code{defsetf} is shorthand for | 5024 | For example, the simple form of @code{defsetf} is shorthand for |
| 5012 | 5025 | ||
| @@ -5021,20 +5034,28 @@ macros like @code{cl-incf} that invoke this | |||
| 5021 | setf-method will insert temporary variables as needed to make | 5034 | setf-method will insert temporary variables as needed to make |
| 5022 | sure the apparent order of evaluation is preserved. | 5035 | sure the apparent order of evaluation is preserved. |
| 5023 | 5036 | ||
| 5024 | Another example drawn from the standard package: | 5037 | Another standard example: |
| 5025 | 5038 | ||
| 5026 | @example | 5039 | @example |
| 5027 | (defsetf nth (n x) (store) | 5040 | (defsetf nth (n x) (store) |
| 5028 | (list 'setcar (list 'nthcdr n x) store)) | 5041 | `(setcar (nthcdr ,n ,x) ,store)) |
| 5042 | @end example | ||
| 5043 | |||
| 5044 | You could write this using @code{gv-define-setter} as: | ||
| 5045 | |||
| 5046 | @example | ||
| 5047 | (gv-define-setter nth (store n x) | ||
| 5048 | `(setcar (nthcdr ,n ,x) ,store)) | ||
| 5029 | @end example | 5049 | @end example |
| 5030 | @end defmac | 5050 | @end defmac |
| 5031 | 5051 | ||
| 5032 | @defmac define-setf-method access-fn arglist forms@dots{} | 5052 | @defmac define-setf-method access-fn arglist forms@dots{} |
| 5033 | This is the most general way to create new place forms. When | 5053 | This is the most general way to create new place forms. You can |
| 5034 | a @code{setf} to @var{access-fn} with arguments described by | 5054 | replace this by @code{gv-define-setter} or @code{gv-define-expander}. |
| 5035 | @var{arglist} is expanded, the @var{forms} are evaluated and | 5055 | |
| 5036 | must return a list of five items: | 5056 | When a @code{setf} to @var{access-fn} with arguments described by |
| 5037 | @c FIXME Is this still true? | 5057 | @var{arglist} is expanded, the @var{forms} are evaluated and must |
| 5058 | return a list of five items: | ||
| 5038 | 5059 | ||
| 5039 | @enumerate | 5060 | @enumerate |
| 5040 | @item | 5061 | @item |
| @@ -5063,6 +5084,9 @@ This is exactly like the Common Lisp macro of the same name, | |||
| 5063 | except that the method returns a list of five values rather | 5084 | except that the method returns a list of five values rather |
| 5064 | than the five values themselves, since Emacs Lisp does not | 5085 | than the five values themselves, since Emacs Lisp does not |
| 5065 | support Common Lisp's notion of multiple return values. | 5086 | support Common Lisp's notion of multiple return values. |
| 5087 | (Note that the @code{setf} implementation provided by @file{gv.el} | ||
| 5088 | does not use this five item format. Its use here is only for | ||
| 5089 | backwards compatibility.) | ||
| 5066 | 5090 | ||
| 5067 | Once again, the @var{forms} may begin with a documentation string. | 5091 | Once again, the @var{forms} may begin with a documentation string. |
| 5068 | 5092 | ||
| @@ -5078,45 +5102,22 @@ turn out to be unnecessary, so there is little reason for the | |||
| 5078 | setf-method itself to optimize. | 5102 | setf-method itself to optimize. |
| 5079 | @end defmac | 5103 | @end defmac |
| 5080 | 5104 | ||
| 5105 | @c Removed in Emacs 24.3, not possible to make a compatible replacement. | ||
| 5106 | @ignore | ||
| 5081 | @defun get-setf-method place &optional env | 5107 | @defun get-setf-method place &optional env |
| 5082 | This function returns the setf-method for @var{place}, by | 5108 | This function returns the setf-method for @var{place}, by |
| 5083 | invoking the definition previously recorded by @code{defsetf} | 5109 | invoking the definition previously recorded by @code{defsetf} |
| 5084 | or @code{define-setf-method}. The result is a list of five | 5110 | or @code{define-setf-method}. The result is a list of five |
| 5085 | values as described above. You can use this function to build | 5111 | values as described above. You can use this function to build |
| 5086 | your own @code{cl-incf}-like modify macros. | 5112 | your own @code{cl-incf}-like modify macros. |
| 5087 | @c These no longer exist. | ||
| 5088 | @ignore | ||
| 5089 | (Actually, it is better to use the internal functions | ||
| 5090 | @code{cl-setf-do-modify} and @code{cl-setf-do-store}, which are a bit | ||
| 5091 | easier to use and which also do a number of optimizations; consult the | ||
| 5092 | source code for the @code{cl-incf} function for a simple example.) | ||
| 5093 | @end ignore | ||
| 5094 | 5113 | ||
| 5095 | The argument @var{env} specifies the ``environment'' to be | 5114 | The argument @var{env} specifies the ``environment'' to be |
| 5096 | passed on to @code{macroexpand} if @code{get-setf-method} should | 5115 | passed on to @code{macroexpand} if @code{get-setf-method} should |
| 5097 | need to expand a macro in @var{place}. It should come from | 5116 | need to expand a macro in @var{place}. It should come from |
| 5098 | an @code{&environment} argument to the macro or setf-method | 5117 | an @code{&environment} argument to the macro or setf-method |
| 5099 | that called @code{get-setf-method}. | 5118 | that called @code{get-setf-method}. |
| 5100 | |||
| 5101 | @c FIXME No longer true. | ||
| 5102 | See also the source code for the setf-method for | ||
| 5103 | @c Also @code{apply}, but that is commented out. | ||
| 5104 | @code{substring}, which works by calling @code{get-setf-method} on a | ||
| 5105 | simpler case, then massaging the result. | ||
| 5106 | @end defun | 5119 | @end defun |
| 5107 | 5120 | @end ignore | |
| 5108 | @c FIXME does not belong here any more, maybe in lispref? | ||
| 5109 | Modern Common Lisp defines a second, independent way to specify | ||
| 5110 | the @code{setf} behavior of a function, namely ``@code{setf} | ||
| 5111 | functions'' whose names are lists @code{(setf @var{name})} | ||
| 5112 | rather than symbols. For example, @code{(defun (setf foo) @dots{})} | ||
| 5113 | defines the function that is used when @code{setf} is applied to | ||
| 5114 | @code{foo}. This package does not currently support @code{setf} | ||
| 5115 | functions. In particular, it is a compile-time error to use | ||
| 5116 | @code{setf} on a form which has not already been @code{defsetf}'d | ||
| 5117 | or otherwise declared; in newer Common Lisps, this would not be | ||
| 5118 | an error since the function @code{(setf @var{func})} might be | ||
| 5119 | defined later. | ||
| 5120 | 5121 | ||
| 5121 | 5122 | ||
| 5122 | @node GNU Free Documentation License | 5123 | @node GNU Free Documentation License |
diff --git a/doc/misc/url.texi b/doc/misc/url.texi index 898a9994a86..fdb3ab452f2 100644 --- a/doc/misc/url.texi +++ b/doc/misc/url.texi | |||
| @@ -18,7 +18,7 @@ | |||
| 18 | @end direntry | 18 | @end direntry |
| 19 | 19 | ||
| 20 | @copying | 20 | @copying |
| 21 | This file documents the Emacs Lisp URL loading package. | 21 | This is the manual for the @code{url} Emacs Lisp library. |
| 22 | 22 | ||
| 23 | Copyright @copyright{} 1993-1999, 2002, 2004-2012 Free Software Foundation, Inc. | 23 | Copyright @copyright{} 1993-1999, 2002, 2004-2012 Free Software Foundation, Inc. |
| 24 | 24 | ||
| @@ -57,10 +57,10 @@ developing GNU and promoting software freedom.'' | |||
| 57 | @end ifnottex | 57 | @end ifnottex |
| 58 | 58 | ||
| 59 | @menu | 59 | @menu |
| 60 | * Getting Started:: Preparing your program to use URLs. | 60 | * Introduction:: About the @code{url} library. |
| 61 | * URI Parsing:: Parsing (and unparsing) URIs. | ||
| 61 | * Retrieving URLs:: How to use this package to retrieve a URL. | 62 | * Retrieving URLs:: How to use this package to retrieve a URL. |
| 62 | * Supported URL Types:: Descriptions of URL types currently supported. | 63 | * Supported URL Types:: Descriptions of URL types currently supported. |
| 63 | * Defining New URLs:: How to define a URL loader for a new protocol. | ||
| 64 | * General Facilities:: URLs can be cached, accessed via a gateway | 64 | * General Facilities:: URLs can be cached, accessed via a gateway |
| 65 | and tracked in a history list. | 65 | and tracked in a history list. |
| 66 | * Customization:: Variables you can alter. | 66 | * Customization:: Variables you can alter. |
| @@ -70,93 +70,129 @@ developing GNU and promoting software freedom.'' | |||
| 70 | * Concept Index:: | 70 | * Concept Index:: |
| 71 | @end menu | 71 | @end menu |
| 72 | 72 | ||
| 73 | @node Getting Started | 73 | @node Introduction |
| 74 | @chapter Getting Started | 74 | @chapter Introduction |
| 75 | @cindex URLs, definition | 75 | @cindex URL |
| 76 | @cindex URIs | 76 | @cindex URI |
| 77 | @cindex uniform resource identifier | ||
| 78 | @cindex uniform resource locator | ||
| 77 | 79 | ||
| 78 | @dfn{Uniform Resource Locators} (URLs) are a specific form of | 80 | A @dfn{Uniform Resource Identifier} (URI) is a specially-formatted |
| 79 | @dfn{Uniform Resource Identifiers} (URI) described in RFC 2396 which | 81 | name, such as an Internet address, that identifies some name or |
| 80 | updates RFC 1738 and RFC 1808. RFC 2016 defines uniform resource | 82 | resource. The format of URIs is described in RFC 3986, which updates |
| 81 | agents. | 83 | and replaces the earlier RFCs 2732, 2396, 1808, and 1738. A |
| 84 | @dfn{Uniform Resource Locator} (URL) is an older but still-common | ||
| 85 | term, which basically refers to a URI corresponding to a resource that | ||
| 86 | can be accessed (usually over a network) in a specific way. | ||
| 82 | 87 | ||
| 83 | URIs have the form @var{scheme}:@var{scheme-specific-part}, where the | 88 | Here are some examples of URIs (taken from RFC 3986): |
| 84 | @var{scheme}s supported by this library are described below. | ||
| 85 | @xref{Supported URL Types}. | ||
| 86 | 89 | ||
| 87 | FTP, NFS, HTTP, HTTPS, @code{rlogin}, @code{telnet}, tn3270, | 90 | @example |
| 88 | IRC and gopher URLs all have the form | 91 | ftp://ftp.is.co.za/rfc/rfc1808.txt |
| 92 | http://www.ietf.org/rfc/rfc2396.txt | ||
| 93 | ldap://[2001:db8::7]/c=GB?objectClass?one | ||
| 94 | mailto:John.Doe@@example.com | ||
| 95 | news:comp.infosystems.www.servers.unix | ||
| 96 | tel:+1-816-555-1212 | ||
| 97 | telnet://192.0.2.16:80/ | ||
| 98 | urn:oasis:names:specification:docbook:dtd:xml:4.1.2 | ||
| 99 | @end example | ||
| 100 | |||
| 101 | This manual describes the @code{url} library, an Emacs Lisp library | ||
| 102 | for parsing URIs and retrieving the resources to which they refer. | ||
| 103 | (The library is so-named for historical reasons; nowadays, the ``URI'' | ||
| 104 | terminology is regarded as the more general one, and ``URL'' is | ||
| 105 | technically obsolete despite its widespread vernacular usage.) | ||
| 106 | |||
| 107 | @node URI Parsing | ||
| 108 | @chapter URI Parsing | ||
| 109 | |||
| 110 | A URI consists of several @dfn{components}, each having a different | ||
| 111 | meaning. For example, the URI | ||
| 89 | 112 | ||
| 90 | @example | 113 | @example |
| 91 | @var{scheme}://@r{[}@var{userinfo}@@@r{]}@var{hostname}@r{[}:@var{port}@r{]}@r{[}/@var{path}@r{]} | 114 | http://www.gnu.org/software/emacs/ |
| 92 | @end example | 115 | @end example |
| 116 | |||
| 93 | @noindent | 117 | @noindent |
| 94 | where @samp{@r{[}} and @samp{@r{]}} delimit optional parts. | 118 | specifies the scheme component @samp{http}, the hostname component |
| 95 | @var{userinfo} sometimes takes the form @var{username}:@var{password} | 119 | @samp{www.gnu.org}, and the path component @samp{/software/emacs/}. |
| 96 | but you should beware of the security risks of sending cleartext | 120 | |
| 97 | passwords. @var{hostname} may be a domain name or a dotted decimal | 121 | @cindex parsed URIs |
| 98 | address. If the @samp{:@var{port}} is omitted then the library will | 122 | The format of URIs is specified by RFC 3986. The @code{url} library |
| 99 | use the ``well known'' port for that service when accessing URLs. With | 123 | provides the Lisp function @code{url-generic-parse-url}, a (mostly) |
| 100 | the possible exception of @code{telnet}, it is rare for ports to be | 124 | standard-compliant URI parser, as well as function |
| 101 | specified, and it is possible using a non-standard port may have | 125 | @code{url-recreate-url}, which converts a parsed URI back into a URI |
| 102 | undesired consequences if a different service is listening on that | 126 | string. |
| 103 | port (e.g., an HTTP URL specifying the SMTP port can cause mail to be | 127 | |
| 104 | sent). @c , but @xref{Other Variables, url-bad-port-list}. | 128 | @defun url-generic-parse-url uri-string |
| 105 | The meaning of the @var{path} component depends on the service. | 129 | This function returns a parsed version of the string @var{uri-string}. |
| 130 | @end defun | ||
| 106 | 131 | ||
| 107 | @menu | 132 | @defun url-recreate-url uri-obj |
| 108 | * Configuration:: | 133 | @cindex unparsing URLs |
| 109 | * Parsed URLs:: URLs are parsed into vector structures. | 134 | Given a parsed URI, this function returns the corresponding URI string. |
| 110 | @end menu | 135 | @end defun |
| 111 | 136 | ||
| 112 | @node Configuration | 137 | @cindex parsed URI |
| 113 | @section Configuration | 138 | The return value of @code{url-generic-parse-url}, and the argument |
| 139 | expected by @code{url-recreate-url}, is a @dfn{parsed URI}: a CL | ||
| 140 | structure whose slots hold the various components of the URI. | ||
| 141 | @xref{top,the CL Manual,,cl,GNU Emacs Common Lisp Emulation}, for | ||
| 142 | details about CL structures. Most of the other functions in the | ||
| 143 | @code{url} library act on parsed URIs. | ||
| 114 | 144 | ||
| 115 | @defvar url-configuration-directory | 145 | @menu |
| 116 | @cindex @file{~/.url} | 146 | * Parsed URIs:: Format of parsed URI structures. |
| 117 | @cindex configuration files | 147 | * URI Encoding:: Non-@acronym{ASCII} characters in URIs. |
| 118 | The directory in which URL configuration files, the cache etc., | 148 | @end menu |
| 119 | reside. The old default was @file{~/.url}, and this directory | ||
| 120 | is still used if it exists. The new default is a @file{url/} | ||
| 121 | directory in @code{user-emacs-directory}, which is normally | ||
| 122 | @file{~/.emacs.d}. | ||
| 123 | @end defvar | ||
| 124 | 149 | ||
| 125 | @node Parsed URLs | 150 | @node Parsed URIs |
| 126 | @section Parsed URLs | 151 | @section Parsed URI structures |
| 127 | @cindex parsed URLs | ||
| 128 | The library functions typically operate on @dfn{parsed} versions of | ||
| 129 | URLs. These are actually CL structures (vectors) of the form: | ||
| 130 | 152 | ||
| 131 | @example | 153 | Each parsed URI structure contains the following slots: |
| 132 | [cl-struct-url @var{type} @var{user} @var{password} @var{host} @var{port} @var{filename} @var{target} @var{attributes} @var{fullness} @var{use-cookies}] | ||
| 133 | @end example | ||
| 134 | 154 | ||
| 135 | @noindent where | 155 | @table @code |
| 136 | @table @var | ||
| 137 | @item type | 156 | @item type |
| 138 | is the type of the URL scheme, e.g., @code{http} | 157 | The URI scheme (a string, e.g.@: @code{http}). @xref{Supported URL |
| 158 | Types}, for a list of schemes that the @code{url} library knows how to | ||
| 159 | process. This slot can also be @code{nil}, if the URI is not fully | ||
| 160 | specified. | ||
| 161 | |||
| 139 | @item user | 162 | @item user |
| 140 | is the username associated with it, or @code{nil}; | 163 | The user name (a string), or @code{nil}. |
| 164 | |||
| 141 | @item password | 165 | @item password |
| 142 | is the user password associated with it, or @code{nil}; | 166 | The user password (a string), or @code{nil}. The use of this URI |
| 167 | component is strongly discouraged; nowadays, passwords are transmitted | ||
| 168 | by other means, not as part of a URI. | ||
| 169 | |||
| 143 | @item host | 170 | @item host |
| 144 | is the host name associated with it, or @code{nil}; | 171 | The host name (a string), or @code{nil}. If present, this is |
| 172 | typically a domain name or IP address. | ||
| 173 | |||
| 145 | @item port | 174 | @item port |
| 146 | is the port number associated with it, or @code{nil}; | 175 | The port number (an integer), or @code{nil}. Omitting this component |
| 176 | usually means to use the ``standard'' port associated with the URI | ||
| 177 | scheme. | ||
| 178 | |||
| 147 | @item filename | 179 | @item filename |
| 148 | is the ``file'' part of it, or @code{nil}. This doesn't necessarily | 180 | The combination of the ``path'' and ``query'' components of the URI (a |
| 149 | actually refer to a file; | 181 | string), or @code{nil}. If the query component is present, it is the |
| 182 | substring following the first @samp{?} character, and the path | ||
| 183 | component is the substring before the @samp{?}. The meaning of these | ||
| 184 | components is scheme-dependent; they do not necessarily refer to a | ||
| 185 | file on a disk. | ||
| 186 | |||
| 150 | @item target | 187 | @item target |
| 151 | is the target part, or @code{nil}; | 188 | The fragment component (a string), or @code{nil}. The fragment |
| 152 | @item attributes | 189 | component specifies a ``secondary resource'', such as a section of a |
| 153 | is the attributes associated with it, or @code{nil}; | 190 | webpage. |
| 191 | |||
| 154 | @item fullness | 192 | @item fullness |
| 155 | is @code{t} for a fully-specified URL, with a host part indicated by | 193 | This is @code{t} if the URI is fully specified, i.e.@: the |
| 156 | @samp{//} after the scheme part. | 194 | hierarchical components of the URI (the hostname and/or username |
| 157 | @item use-cookies | 195 | and/or password) are preceded by @samp{//}. |
| 158 | is @code{nil} to neither send or store cookies to the server, @code{t} | ||
| 159 | otherwise. | ||
| 160 | @end table | 196 | @end table |
| 161 | 197 | ||
| 162 | @findex url-type | 198 | @findex url-type |
| @@ -168,64 +204,165 @@ otherwise. | |||
| 168 | @findex url-target | 204 | @findex url-target |
| 169 | @findex url-attributes | 205 | @findex url-attributes |
| 170 | @findex url-fullness | 206 | @findex url-fullness |
| 171 | These attributes have accessors named @code{url-@var{part}}, where | 207 | These slots have accessors named @code{url-@var{part}}, where |
| 172 | @var{part} is the name of one of the elements above, e.g., | 208 | @var{part} is the slot name. For example, the accessor for the |
| 173 | @code{url-host}. These attributes can be set with the same accessors | 209 | @code{host} slot is the function @code{url-host}. The @code{url-port} |
| 174 | using @code{setf}: | 210 | accessor returns the default port for the URI scheme if the parsed |
| 211 | URI's @var{port} slot is @code{nil}. | ||
| 212 | |||
| 213 | The slots can be set using @code{setf}. For example: | ||
| 175 | 214 | ||
| 176 | @example | 215 | @example |
| 177 | (setf (url-port url) 80) | 216 | (setf (url-port url) 80) |
| 178 | @end example | 217 | @end example |
| 179 | 218 | ||
| 180 | If @var{port} is @var{nil}, @code{url-port} returns the default port | 219 | @node URI Encoding |
| 181 | of the protocol. | 220 | @section URI Encoding |
| 182 | 221 | ||
| 183 | There are functions for parsing and unparsing between the string and | 222 | @cindex percent encoding |
| 184 | vector forms. | 223 | The @code{url-generic-parse-url} parser does not obey RFC 3986 in |
| 224 | one respect: it allows non-@acronym{ASCII} characters in URI strings. | ||
| 225 | |||
| 226 | Strictly speaking, RFC 3986 compatible URIs may only consist of | ||
| 227 | @acronym{ASCII} characters; non-@acronym{ASCII} characters are | ||
| 228 | represented by converting them to UTF-8 byte sequences, and performing | ||
| 229 | @dfn{percent encoding} on the bytes. For example, the o-umlaut | ||
| 230 | character is converted to the UTF-8 byte sequence @samp{\xD3\xA7}, | ||
| 231 | then percent encoded to @samp{%D3%A7}. (Certain ``reserved'' | ||
| 232 | @acronym{ASCII} characters must also be percent encoded when they | ||
| 233 | appear in URI components.) | ||
| 234 | |||
| 235 | The function @code{url-encode-url} can be used to convert a URI | ||
| 236 | string containing arbitrary characters to one that is properly | ||
| 237 | percent-encoded in accordance with RFC 3986. | ||
| 238 | |||
| 239 | @defun url-encode-url url-string | ||
| 240 | This function return a properly URI-encoded version of | ||
| 241 | @var{url-string}. It also performs @dfn{URI normalization}, | ||
| 242 | e.g.@: converting the scheme component to lowercase if it was | ||
| 243 | previously uppercase. | ||
| 244 | @end defun | ||
| 185 | 245 | ||
| 186 | @defun url-generic-parse-url url | 246 | To convert between a string containing arbitrary characters and a |
| 187 | Return a parsed version of the string @var{url}. | 247 | percent-encoded all-@acronym{ASCII} string, use the functions |
| 248 | @code{url-hexify-string} and @code{url-unhex-string}: | ||
| 249 | |||
| 250 | @defun url-hexify-string string &optional allowed-chars | ||
| 251 | This function performs percent-encoding on @var{string}, and returns | ||
| 252 | the result. | ||
| 253 | |||
| 254 | If @var{string} is multibyte, it is first converted to a UTF-8 byte | ||
| 255 | string. Each byte corresponding to an allowed character is left | ||
| 256 | as-is, while all other bytes are converted to a three-character | ||
| 257 | sequence: @samp{%} followed by two upper-case hex digits. | ||
| 258 | |||
| 259 | @vindex url-unreserved-chars | ||
| 260 | @cindex unreserved characters | ||
| 261 | The allowed characters are specified by @var{allowed-chars}. If this | ||
| 262 | argument is @code{nil}, the allowed characters are those specified as | ||
| 263 | @dfn{unreserved characters} by RFC 3986 (see the variable | ||
| 264 | @code{url-unreserved-chars}). Otherwise, @var{allowed-chars} should | ||
| 265 | be a vector whose @var{n}-th element is non-@code{nil} if character | ||
| 266 | @var{n} is allowed. | ||
| 188 | @end defun | 267 | @end defun |
| 189 | 268 | ||
| 190 | @defun url-recreate-url url | 269 | @defun url-unhex-string string &optional allow-newlines |
| 191 | @cindex unparsing URLs | 270 | This function replaces percent-encoding sequences in @var{string} with |
| 192 | Recreates a URL string from the parsed @var{url}. | 271 | their character equivalents, and returns the resulting string. |
| 272 | |||
| 273 | If @var{allow-newlines} is non-@code{nil}, it allows the decoding of | ||
| 274 | carriage returns and line feeds, which are normally forbidden in URIs. | ||
| 193 | @end defun | 275 | @end defun |
| 194 | 276 | ||
| 195 | @node Retrieving URLs | 277 | @node Retrieving URLs |
| 196 | @chapter Retrieving URLs | 278 | @chapter Retrieving URLs |
| 197 | 279 | ||
| 280 | The @code{url} library defines the following three functions for | ||
| 281 | retrieving the data specified by a URL. The actual retrieval protocol | ||
| 282 | depends on the URL's URI scheme, and is performed by lower-level | ||
| 283 | scheme-specific functions. (Those lower-level functions are not | ||
| 284 | documented here, and generally should not be called directly.) | ||
| 285 | |||
| 286 | In each of these functions, the @var{url} argument can be either a | ||
| 287 | string or a parsed URL structure. If it is a string, that string is | ||
| 288 | passed through @code{url-encode-url} before using it, to ensure that | ||
| 289 | it is properly URI-encoded (@pxref{URI Encoding}). | ||
| 290 | |||
| 198 | @defun url-retrieve-synchronously url | 291 | @defun url-retrieve-synchronously url |
| 199 | Retrieve @var{url} synchronously and return a buffer containing the | 292 | This function synchronously retrieves the data specified by @var{url}, |
| 200 | data. @var{url} is either a string or a parsed URL structure. Return | 293 | and returns a buffer containing the data. The return value is |
| 201 | @code{nil} if there are no data associated with it (the case for dired, | 294 | @code{nil} if there is no data associated with the URL (as is the case |
| 202 | info, or mailto URLs that need no further processing). | 295 | for @code{dired}, @code{info}, and @code{mailto} URLs). |
| 203 | @end defun | 296 | @end defun |
| 204 | 297 | ||
| 205 | @defun url-retrieve url callback &optional cbargs silent no-cookies | 298 | @defun url-retrieve url callback &optional cbargs silent no-cookies |
| 206 | Retrieve @var{url} asynchronously and call @var{callback} with args | 299 | This function retrieves @var{url} asynchronously, calling the function |
| 207 | @var{cbargs} when finished. The callback is called when the object | 300 | @var{callback} when the object has been completely retrieved. The |
| 208 | has been completely retrieved, with the current buffer containing the | 301 | return value is the buffer into which the data will be inserted, or |
| 209 | object and any MIME headers associated with it. @var{url} is either a | 302 | @code{nil} if the process has already completed. |
| 210 | string or a parsed URL structure. Returns the buffer @var{url} will | 303 | |
| 211 | load into, or @code{nil} if the process has already completed. | 304 | The callback function is called this way: |
| 212 | If the optional argument @var{silent} is non-@code{nil}, suppress | 305 | |
| 213 | progress messages. If the optional argument @var{no-cookies} is | 306 | @example |
| 214 | non-@code{nil}, do not store or send cookies. | 307 | (apply @var{callback} @var{status} @var{cbargs}) |
| 308 | @end example | ||
| 309 | |||
| 310 | @noindent | ||
| 311 | where @var{status} is a plist representing what happened during the | ||
| 312 | retrieval, with most recent events first, or an empty list if no | ||
| 313 | events have occurred. Each pair in the plist is one of: | ||
| 314 | |||
| 315 | @table @code | ||
| 316 | @item (:redirect @var{redirected-to}) | ||
| 317 | This means that the request was redirected to the URL | ||
| 318 | @var{redirected-to}. | ||
| 319 | |||
| 320 | @item (:error (@var{error-symbol} . @var{data})) | ||
| 321 | This means that an error occurred. If so desired, the error can be | ||
| 322 | signaled with @code{(signal @var{error-symbol} @var{data})}. | ||
| 323 | @end table | ||
| 324 | |||
| 325 | When the callback function is called, the current buffer is the one | ||
| 326 | containing the retrieved data (if any). The buffer also contains any | ||
| 327 | MIME headers associated with the data retrieval. | ||
| 328 | |||
| 329 | If the optional argument @var{silent} is non-@code{nil}, progress | ||
| 330 | messages are suppressed. If the optional argument @var{no-cookies} is | ||
| 331 | non-@code{nil}, cookies are not stored or sent. | ||
| 215 | @end defun | 332 | @end defun |
| 216 | 333 | ||
| 217 | @vindex url-queue-parallel-processes | ||
| 218 | @vindex url-queue-timeout | ||
| 219 | @defun url-queue-retrieve url callback &optional cbargs silent no-cookies | 334 | @defun url-queue-retrieve url callback &optional cbargs silent no-cookies |
| 220 | This acts like the @code{url-retrieve} function, but with limits on | 335 | This function acts like @code{url-retrieve}, but with limits on the |
| 221 | the degree of parallelism. The option @code{url-queue-parallel-processes} | 336 | number of concurrently-running network processes. The option |
| 222 | controls the number of concurrent processes, and the option | 337 | @code{url-queue-parallel-processes} controls the number of concurrent |
| 223 | @code{url-queue-timeout} sets a timeout in seconds. | 338 | processes, and the option @code{url-queue-timeout} sets a timeout in |
| 339 | seconds. | ||
| 340 | |||
| 341 | To use this function, you must @code{(require 'url-queue)}. | ||
| 224 | @end defun | 342 | @end defun |
| 225 | 343 | ||
| 344 | @vindex url-queue-parallel-processes | ||
| 345 | @defopt url-queue-parallel-processes | ||
| 346 | The value of this option is an integer specifying the maximum number | ||
| 347 | of concurrent @code{url-queue-retrieve} network processes. If the | ||
| 348 | number of @code{url-queue-retrieve} calls is larger than this number, | ||
| 349 | later ones are queued until ealier ones are finished. | ||
| 350 | @end defopt | ||
| 351 | |||
| 352 | @vindex url-queue-timeout | ||
| 353 | @defopt url-queue-timeout | ||
| 354 | The value of this option is a number specifying the maximum lifetime | ||
| 355 | of a @code{url-queue-retrieve} network process, once it is started. | ||
| 356 | If a process is not finished by then, it is killed and removed from | ||
| 357 | the queue. | ||
| 358 | @end defopt | ||
| 359 | |||
| 226 | @node Supported URL Types | 360 | @node Supported URL Types |
| 227 | @chapter Supported URL Types | 361 | @chapter Supported URL Types |
| 228 | 362 | ||
| 363 | This chapter describes functions and variables affecting URL retrieval | ||
| 364 | for specific schemes. | ||
| 365 | |||
| 229 | @menu | 366 | @menu |
| 230 | * http/https:: Hypertext Transfer Protocol. | 367 | * http/https:: Hypertext Transfer Protocol. |
| 231 | * file/ftp:: Local files and FTP archives. | 368 | * file/ftp:: Local files and FTP archives. |
| @@ -236,48 +373,31 @@ controls the number of concurrent processes, and the option | |||
| 236 | * irc:: Internet Relay Chat. | 373 | * irc:: Internet Relay Chat. |
| 237 | * data:: Embedded data URLs. | 374 | * data:: Embedded data URLs. |
| 238 | * nfs:: Networked File System | 375 | * nfs:: Networked File System |
| 239 | @c * finger:: | ||
| 240 | @c * gopher:: | ||
| 241 | @c * netrek:: | ||
| 242 | @c * prospero:: | ||
| 243 | * cid:: Content-ID. | ||
| 244 | * about:: | ||
| 245 | * ldap:: Lightweight Directory Access Protocol | 376 | * ldap:: Lightweight Directory Access Protocol |
| 246 | * imap:: IMAP mailboxes. | ||
| 247 | * man:: Unix man pages. | 377 | * man:: Unix man pages. |
| 248 | @end menu | 378 | @end menu |
| 249 | 379 | ||
| 250 | @node http/https | 380 | @node http/https |
| 251 | @section @code{http} and @code{https} | 381 | @section @code{http} and @code{https} |
| 252 | 382 | ||
| 253 | The scheme @code{http} is Hypertext Transfer Protocol. The library | 383 | The @code{http} scheme refers to the Hypertext Transfer Protocol. The |
| 254 | supports version 1.1, specified in RFC 2616. (This supersedes 1.0, | 384 | @code{url} library supports HTTP version 1.1, specified in RFC 2616. |
| 255 | defined in RFC 1945) HTTP URLs have the following form, where most of | 385 | Its default port is 80. |
| 256 | the parts are optional: | 386 | |
| 257 | @example | 387 | The @code{https} scheme is a secure version of @code{http}, with |
| 258 | http://@var{user}:@var{password}@@@var{host}:@var{port}/@var{path}?@var{searchpart}#@var{fragment} | 388 | transmission via SSL. It is defined in RFC 2069, and its default port |
| 259 | @end example | 389 | is 443. When using @code{https}, the @code{url} library performs SSL |
| 260 | @c The @code{:@var{port}} part is optional, and @var{port} defaults to | 390 | encryption via the @code{ssl} library, by forcing the @code{ssl} |
| 261 | @c 80. The @code{/@var{path}} part, if present, is a slash-separated | 391 | gateway method to be used. @xref{Gateways in general}. |
| 262 | @c series elements. The @code{?@var{searchpart}}, if present, is the | ||
| 263 | @c query for a search or the content of a form submission. The | ||
| 264 | @c @code{#fragment} part, if present, is a location in the document. | ||
| 265 | |||
| 266 | The scheme @code{https} is a secure version of @code{http}, with | ||
| 267 | transmission via SSL. It is defined in RFC 2069. Its default port is | ||
| 268 | 443. This scheme depends on SSL support in Emacs via the | ||
| 269 | @file{ssl.el} library and is actually implemented by forcing the | ||
| 270 | @code{ssl} gateway method to be used. @xref{Gateways in general}. | ||
| 271 | 392 | ||
| 272 | @defopt url-honor-refresh-requests | 393 | @defopt url-honor-refresh-requests |
| 273 | This controls honoring of HTTP @samp{Refresh} headers by which | 394 | If this option is non-@code{nil} (the default), the @code{url} library |
| 274 | servers can direct clients to reload documents from the same URL or a | 395 | honors the HTTP @samp{Refresh} header, which is used by servers to |
| 275 | or different one. @code{nil} means they will not be honored, | 396 | direct clients to reload documents from the same URL or a or different |
| 276 | @code{t} (the default) means they will always be honored, and | 397 | one. If the value is @code{nil}, the @samp{Refresh} header is |
| 277 | otherwise the user will be asked on each request. | 398 | ignored; any other value means to ask the user on each request. |
| 278 | @end defopt | 399 | @end defopt |
| 279 | 400 | ||
| 280 | |||
| 281 | @menu | 401 | @menu |
| 282 | * Cookies:: | 402 | * Cookies:: |
| 283 | * HTTP language/coding:: | 403 | * HTTP language/coding:: |
| @@ -409,26 +529,32 @@ emacs-mime, The Emacs MIME Manual}. | |||
| 409 | @cindex compressed files | 529 | @cindex compressed files |
| 410 | @cindex dired | 530 | @cindex dired |
| 411 | 531 | ||
| 532 | The @code{ftp} and @code{file} schemes are defined in RFC 1808. The | ||
| 533 | @code{url} library treats @samp{ftp:} and @samp{file:} as synonymous. | ||
| 534 | Such URLs have the form | ||
| 535 | |||
| 412 | @example | 536 | @example |
| 413 | ftp://@var{user}:@var{password}@@@var{host}:@var{port}/@var{file} | 537 | ftp://@var{user}:@var{password}@@@var{host}:@var{port}/@var{file} |
| 414 | file://@var{user}:@var{password}@@@var{host}:@var{port}/@var{file} | 538 | file://@var{user}:@var{password}@@@var{host}:@var{port}/@var{file} |
| 415 | @end example | 539 | @end example |
| 416 | 540 | ||
| 417 | These schemes are defined in RFC 1808. | 541 | @noindent |
| 418 | @samp{ftp:} and @samp{file:} are synonymous in this library. They | 542 | If the URL specifies a local file, it is retrieved by reading the file |
| 419 | allow reading arbitrary files from hosts. Either @samp{ange-ftp} | 543 | contents in the usual way. If it specifies a remote file, it is |
| 420 | (Emacs) or @samp{efs} (XEmacs) is used to retrieve them from remote | 544 | retrieved using the Ange-FTP package. @xref{Remote Files,,, emacs, |
| 421 | hosts. Local files are accessed directly. | 545 | The GNU Emacs Manual}. |
| 422 | 546 | ||
| 423 | Compressed files are handled, but support is hard-coded so that | 547 | When retrieving a compressed file, it is automatically uncompressed |
| 424 | @code{jka-compr-compression-info-list} and so on have no affect. | 548 | if it has the file suffix @file{.z}, @file{.gz}, @file{.Z}, |
| 425 | Suffixes recognized are @samp{.z}, @samp{.gz}, @samp{.Z} and | 549 | @file{.bz2}, or @file{.xz}. (The list of supported suffixes is |
| 426 | @samp{.bz2}. | 550 | hard-coded, and cannot be altered by customizing |
| 551 | @code{jka-compr-compression-info-list}.) | ||
| 427 | 552 | ||
| 428 | @defopt url-directory-index-file | 553 | @defopt url-directory-index-file |
| 429 | The filename to look for when indexing a directory, default | 554 | This option specifies the filename to look for when a @code{file} or |
| 430 | @samp{"index.html"}. If this file exists, and is readable, then it | 555 | @code{ftp} URL specifies a directory. The default is |
| 431 | will be viewed instead of using @code{dired} to view the directory. | 556 | @file{index.html}. If this file exists and is readable, it is viewed. |
| 557 | Otherwise, Emacs visits the directory using Dired. | ||
| 432 | @end defopt | 558 | @end defopt |
| 433 | 559 | ||
| 434 | @node info | 560 | @node info |
| @@ -437,47 +563,53 @@ will be viewed instead of using @code{dired} to view the directory. | |||
| 437 | @cindex Texinfo | 563 | @cindex Texinfo |
| 438 | @findex Info-goto-node | 564 | @findex Info-goto-node |
| 439 | 565 | ||
| 566 | The @code{info} scheme is non-standard. Such URLs have the form | ||
| 567 | |||
| 440 | @example | 568 | @example |
| 441 | info:@var{file}#@var{node} | 569 | info:@var{file}#@var{node} |
| 442 | @end example | 570 | @end example |
| 443 | 571 | ||
| 444 | Info URLs are not officially defined. They invoke | 572 | @noindent |
| 445 | @code{Info-goto-node} with argument @samp{(@var{file})@var{node}}. | 573 | and are retrieved by invoking @code{Info-goto-node} with argument |
| 446 | @samp{#@var{node}} is optional, defaulting to @samp{Top}. | 574 | @samp{(@var{file})@var{node}}. If @samp{#@var{node}} is omitted, the |
| 575 | @samp{Top} node is opened. | ||
| 447 | 576 | ||
| 448 | @node mailto | 577 | @node mailto |
| 449 | @section mailto | 578 | @section mailto |
| 450 | 579 | ||
| 451 | @cindex mailto | 580 | @cindex mailto |
| 452 | @cindex email | 581 | @cindex email |
| 453 | A mailto URL will send an email message to the address in the | 582 | A @code{mailto} URL specifies an email message to be sent to a given |
| 454 | URL, for example @samp{mailto:foo@@bar.com} would compose a | 583 | email address. For example, @samp{mailto:foo@@bar.com} specifies |
| 455 | message to @samp{foo@@bar.com}. | 584 | sending a message to @samp{foo@@bar.com}. The ``retrieval method'' |
| 456 | 585 | for such URLs is to open a mail composition buffer in which the | |
| 457 | @defopt url-mail-command | 586 | appropriate content (e.g.@: the recipient address) has been filled in. |
| 458 | @vindex mail-user-agent | ||
| 459 | The function called whenever url needs to send mail. This should | ||
| 460 | normally be left to default from @var{mail-user-agent}. @xref{Mail | ||
| 461 | Methods, , Mail-Composition Methods, emacs, The GNU Emacs Manual}. | ||
| 462 | @end defopt | ||
| 463 | 587 | ||
| 464 | An @samp{X-Url-From} header field containing the URL of the document | 588 | As defined in RFC 2368, a @code{mailto} URL has the form |
| 465 | that contained the mailto URL is added if that URL is known. | ||
| 466 | 589 | ||
| 467 | RFC 2368 extends the definition of mailto URLs in RFC 1738. | ||
| 468 | The form of a mailto URL is | ||
| 469 | @example | 590 | @example |
| 470 | @samp{mailto:@var{mailbox}[?@var{header}=@var{contents}[&@var{header}=@var{contents}]]} | 591 | @samp{mailto:@var{mailbox}[?@var{header}=@var{contents}[&@var{header}=@var{contents}]]} |
| 471 | @end example | 592 | @end example |
| 472 | @noindent where an arbitrary number of @var{header}s can be added. If the | ||
| 473 | @var{header} is @samp{body}, then @var{contents} is put in the body | ||
| 474 | otherwise a @var{header} header field is created with @var{contents} | ||
| 475 | as its contents. Note that the URL library does not consider any | ||
| 476 | headers ``dangerous'' so you should check them before sending the | ||
| 477 | message. | ||
| 478 | 593 | ||
| 479 | @c Fixme: update | 594 | @noindent |
| 480 | Email messages are defined in @sc{rfc}822. | 595 | where an arbitrary number of @var{header}s can be added. If the |
| 596 | @var{header} is @samp{body}, then @var{contents} is put in the message | ||
| 597 | body; otherwise, a @var{header} header field is created with | ||
| 598 | @var{contents} as its contents. Note that the @code{url} library does | ||
| 599 | not perform any checking of @var{header} or @var{contents}, so you | ||
| 600 | should check them before sending the message. | ||
| 601 | |||
| 602 | @defopt url-mail-command | ||
| 603 | @vindex mail-user-agent | ||
| 604 | The value of this variable is the function called whenever url needs | ||
| 605 | to send mail. This should normally be left its default, which is the | ||
| 606 | standard mail-composition command @code{compose-mail}. @xref{Sending | ||
| 607 | Mail,,, emacs, The GNU Emacs Manual}. | ||
| 608 | @end defopt | ||
| 609 | |||
| 610 | If the document containing the @code{mailto} URL itself possessed a | ||
| 611 | known URL, Emacs automatically inserts an @samp{X-Url-From} header | ||
| 612 | field into the mail buffer, specifying that URL. | ||
| 481 | 613 | ||
| 482 | @node news/nntp/snews | 614 | @node news/nntp/snews |
| 483 | @section @code{news}, @code{nntp} and @code{snews} | 615 | @section @code{news}, @code{nntp} and @code{snews} |
| @@ -487,11 +619,13 @@ Email messages are defined in @sc{rfc}822. | |||
| 487 | @cindex NNTP | 619 | @cindex NNTP |
| 488 | @cindex snews | 620 | @cindex snews |
| 489 | 621 | ||
| 490 | @c draft-gilman-news-url-01 | 622 | The @code{news}, @code{nntp}, and @code{snews} schemes, defined in RFC |
| 491 | The network news URL scheme take the following forms following RFC | 623 | 1738, are used for reading Usenet newsgroups. For compatibility with |
| 492 | 1738 except that for compatibility with other clients, host and port | 624 | non-standard-compliant news clients, the @code{url} library allows |
| 493 | fields may be included in news URLs though they are properly only | 625 | host and port fields to be included in @code{news} URLs, even though |
| 494 | allowed for nntp an snews. | 626 | they are properly only allowed for @code{nntp} and @code{snews}. |
| 627 | |||
| 628 | @code{news} and @code{nntp} URLs have the following form: | ||
| 495 | 629 | ||
| 496 | @table @samp | 630 | @table @samp |
| 497 | @item news:@var{newsgroup} | 631 | @item news:@var{newsgroup} |
| @@ -506,24 +640,22 @@ Retrieves a list of all available newsgroups; | |||
| 506 | Similar to the @samp{news} versions. | 640 | Similar to the @samp{news} versions. |
| 507 | @end table | 641 | @end table |
| 508 | 642 | ||
| 509 | @samp{:@var{port}} is optional and defaults to :119. | 643 | The default port for @code{nntp} (and @code{news}) is 119. The |
| 510 | 644 | difference between an @code{nntp} URL and a @code{news} URL is that an | |
| 511 | @samp{snews} is the same as @samp{nntp} except that the default port | 645 | @code{nttp} URL may specify an article by its number. The |
| 512 | is :563. | 646 | @samp{snews} scheme is the same as @samp{nntp}, except that it is |
| 513 | @cindex SSL | 647 | tunneled through SSL and has default port 563. |
| 514 | (It is tunneled through SSL.) | ||
| 515 | 648 | ||
| 516 | An @samp{nntp} URL is the same as a news URL, except that the URL may | 649 | These URLs are retrieved via the Gnus package. |
| 517 | specify an article by its number. | ||
| 518 | 650 | ||
| 519 | @defopt url-news-server | ||
| 520 | This variable can be used to override the default news server. | ||
| 521 | Usually this will be set by the Gnus package, which is used to fetch | ||
| 522 | news. | ||
| 523 | @cindex environment variable | 651 | @cindex environment variable |
| 524 | @vindex NNTPSERVER | 652 | @vindex NNTPSERVER |
| 525 | It may be set from the conventional environment variable | 653 | @defopt url-news-server |
| 526 | @code{NNTPSERVER}. | 654 | This variable specifies the default news server from which to fetch |
| 655 | news, if no server was specified in the URL. The default value, | ||
| 656 | @code{nil}, means to use the server specified by the standard | ||
| 657 | environment variable @samp{NNTPSERVER}, or @samp{news} if that | ||
| 658 | environment variable is unset. | ||
| 527 | @end defopt | 659 | @end defopt |
| 528 | 660 | ||
| 529 | @node rlogin/telnet/tn3270 | 661 | @node rlogin/telnet/tn3270 |
| @@ -534,12 +666,15 @@ It may be set from the conventional environment variable | |||
| 534 | @cindex terminal emulation | 666 | @cindex terminal emulation |
| 535 | @findex terminal-emulator | 667 | @findex terminal-emulator |
| 536 | 668 | ||
| 537 | These URL schemes from RFC 1738 for logon via a terminal emulator have | 669 | These URL schemes are defined in RFC 1738, and are used for logging in |
| 538 | the form | 670 | via a terminal emulator. They have the form |
| 671 | |||
| 539 | @example | 672 | @example |
| 540 | telnet://@var{user}:@var{password}@@@var{host}:@var{port} | 673 | telnet://@var{user}:@var{password}@@@var{host}:@var{port} |
| 541 | @end example | 674 | @end example |
| 542 | but the @code{:@var{password}} component is ignored. | 675 | |
| 676 | @noindent | ||
| 677 | but the @var{password} component is ignored. | ||
| 543 | 678 | ||
| 544 | To handle rlogin, telnet and tn3270 URLs, a @code{rlogin}, | 679 | To handle rlogin, telnet and tn3270 URLs, a @code{rlogin}, |
| 545 | @code{telnet} or @code{tn3270} (the program names and arguments are | 680 | @code{telnet} or @code{tn3270} (the program names and arguments are |
| @@ -553,39 +688,43 @@ Well-known ports are used if the URL does not specify a port. | |||
| 553 | @cindex ZEN IRC | 688 | @cindex ZEN IRC |
| 554 | @cindex ERC | 689 | @cindex ERC |
| 555 | @cindex rcirc | 690 | @cindex rcirc |
| 556 | @c Fixme: reference (was http://www.w3.org/Addressing/draft-mirashi-url-irc-01.txt) | 691 | |
| 557 | @dfn{Internet Relay Chat} (IRC) is handled by handing off the @sc{irc} | 692 | The @code{irc} scheme is defined in the Internet Draft at |
| 558 | session to a function named in @code{url-irc-function}. | 693 | @url{http://www.w3.org/Addressing/draft-mirashi-url-irc-01.txt} (which |
| 694 | was never approved as an RFC). Such URLs have the form | ||
| 695 | |||
| 696 | @example | ||
| 697 | irc://@var{host}:@var{port}/@var{target},@var{needpass} | ||
| 698 | @end example | ||
| 699 | |||
| 700 | @noindent | ||
| 701 | and are retrieved by opening an @acronym{IRC} session using the | ||
| 702 | function specified by @code{url-irc-function}. | ||
| 559 | 703 | ||
| 560 | @defopt url-irc-function | 704 | @defopt url-irc-function |
| 561 | A function to actually open an IRC connection. | 705 | The value of this option is a function, which is called to open an IRC |
| 562 | This function | 706 | connection for @code{irc} URLs. This function must take five |
| 563 | must take five arguments, @var{host}, @var{port}, @var{channel}, | 707 | arguments, @var{host}, @var{port}, @var{channel}, @var{user} and |
| 564 | @var{user} and @var{password}. The @var{channel} argument specifies the | 708 | @var{password}. The @var{channel} argument specifies the channel to |
| 565 | channel to join immediately, this can be @code{nil}. By default this is | 709 | join immediately, and may be @code{nil}. |
| 566 | @code{url-irc-rcirc}. | 710 | |
| 711 | The default is @code{url-irc-rcirc}, which uses the Rcirc package. | ||
| 712 | Other options are @code{url-irc-erc} (which uses ERC) and | ||
| 713 | @code{url-irc-zenirc} (which uses ZenIRC). | ||
| 567 | @end defopt | 714 | @end defopt |
| 568 | @defun url-irc-rcirc host port channel user password | ||
| 569 | Processes the arguments and lets @code{rcirc} handle the session. | ||
| 570 | @end defun | ||
| 571 | @defun url-irc-erc host port channel user password | ||
| 572 | Processes the arguments and lets @code{ERC} handle the session. | ||
| 573 | @end defun | ||
| 574 | @defun url-irc-zenirc host port channel user password | ||
| 575 | Processes the arguments and lets @code{zenirc} handle the session. | ||
| 576 | @end defun | ||
| 577 | 715 | ||
| 578 | @node data | 716 | @node data |
| 579 | @section data | 717 | @section data |
| 580 | @cindex data URLs | 718 | @cindex data URLs |
| 581 | 719 | ||
| 720 | The @code{data} scheme, defined in RFC 2397, contains MIME data in | ||
| 721 | the URL itself. Such URLs have the form | ||
| 722 | |||
| 582 | @example | 723 | @example |
| 583 | data:@r{[}@var{media-type}@r{]}@r{[};@var{base64}@r{]},@var{data} | 724 | data:@r{[}@var{media-type}@r{]}@r{[};@var{base64}@r{]},@var{data} |
| 584 | @end example | 725 | @end example |
| 585 | 726 | ||
| 586 | Data URLs contain MIME data in the URL itself. They are defined in | 727 | @noindent |
| 587 | RFC 2397. | ||
| 588 | |||
| 589 | @var{media-type} is a MIME @samp{Content-Type} string, possibly | 728 | @var{media-type} is a MIME @samp{Content-Type} string, possibly |
| 590 | including parameters. It defaults to | 729 | including parameters. It defaults to |
| 591 | @samp{text/plain;charset=US-ASCII}. The @samp{text/plain} can be | 730 | @samp{text/plain;charset=US-ASCII}. The @samp{text/plain} can be |
| @@ -598,14 +737,14 @@ present, the @var{data} are base64-encoded. | |||
| 598 | @cindex Network File System | 737 | @cindex Network File System |
| 599 | @cindex automounter | 738 | @cindex automounter |
| 600 | 739 | ||
| 740 | The @code{nfs} scheme, defined in RFC 2224, is similar to @code{ftp} | ||
| 741 | except that it points to a file on a remote host that is handled by an | ||
| 742 | NFS automounter on the local host. Such URLs have the form | ||
| 743 | |||
| 601 | @example | 744 | @example |
| 602 | nfs://@var{user}:@var{password}@@@var{host}:@var{port}/@var{file} | 745 | nfs://@var{user}:@var{password}@@@var{host}:@var{port}/@var{file} |
| 603 | @end example | 746 | @end example |
| 604 | 747 | ||
| 605 | The @samp{nfs:} scheme is defined in RFC 2224. It is similar to | ||
| 606 | @samp{ftp:} except that it points to a file on a remote host that is | ||
| 607 | handled by the automounter on the local host. | ||
| 608 | |||
| 609 | @defvar url-nfs-automounter-directory-spec | 748 | @defvar url-nfs-automounter-directory-spec |
| 610 | @end defvar | 749 | @end defvar |
| 611 | A string saying how to invoke the NFS automounter. Certain @samp{%} | 750 | A string saying how to invoke the NFS automounter. Certain @samp{%} |
| @@ -628,15 +767,6 @@ A literal @samp{%}. | |||
| 628 | 767 | ||
| 629 | Each can be used any number of times. | 768 | Each can be used any number of times. |
| 630 | 769 | ||
| 631 | @node cid | ||
| 632 | @section cid | ||
| 633 | @cindex Content-ID | ||
| 634 | |||
| 635 | RFC 2111 | ||
| 636 | |||
| 637 | @node about | ||
| 638 | @section about | ||
| 639 | |||
| 640 | @node ldap | 770 | @node ldap |
| 641 | @section ldap | 771 | @section ldap |
| 642 | @cindex LDAP | 772 | @cindex LDAP |
| @@ -644,50 +774,21 @@ RFC 2111 | |||
| 644 | 774 | ||
| 645 | The LDAP scheme is defined in RFC 2255. | 775 | The LDAP scheme is defined in RFC 2255. |
| 646 | 776 | ||
| 647 | @node imap | ||
| 648 | @section imap | ||
| 649 | @cindex IMAP | ||
| 650 | |||
| 651 | RFC 2192 | ||
| 652 | |||
| 653 | @node man | 777 | @node man |
| 654 | @section man | 778 | @section man |
| 655 | @cindex @command{man} | 779 | @cindex @command{man} |
| 656 | @cindex Unix man pages | 780 | @cindex Unix man pages |
| 657 | @findex man | 781 | @findex man |
| 658 | 782 | ||
| 783 | The @code{man} scheme is a non-standard one. Such URLs have the form | ||
| 784 | |||
| 659 | @example | 785 | @example |
| 660 | @samp{man:@var{page-spec}} | 786 | @samp{man:@var{page-spec}} |
| 661 | @end example | 787 | @end example |
| 662 | 788 | ||
| 663 | This is a non-standard scheme. @var{page-spec} is passed directly to | 789 | @noindent |
| 664 | the Lisp @code{man} function. | 790 | and are retrieved by passing @var{page-spec} to the Lisp function |
| 665 | 791 | @code{man}. | |
| 666 | @node Defining New URLs | ||
| 667 | @chapter Defining New URLs | ||
| 668 | |||
| 669 | @menu | ||
| 670 | * Naming conventions:: | ||
| 671 | * Required functions:: | ||
| 672 | * Optional functions:: | ||
| 673 | * Asynchronous fetching:: | ||
| 674 | * Supporting file-name-handlers:: | ||
| 675 | @end menu | ||
| 676 | |||
| 677 | @node Naming conventions | ||
| 678 | @section Naming conventions | ||
| 679 | |||
| 680 | @node Required functions | ||
| 681 | @section Required functions | ||
| 682 | |||
| 683 | @node Optional functions | ||
| 684 | @section Optional functions | ||
| 685 | |||
| 686 | @node Asynchronous fetching | ||
| 687 | @section Asynchronous fetching | ||
| 688 | |||
| 689 | @node Supporting file-name-handlers | ||
| 690 | @section Supporting file-name-handlers | ||
| 691 | 792 | ||
| 692 | @node General Facilities | 793 | @node General Facilities |
| 693 | @chapter General Facilities | 794 | @chapter General Facilities |
| @@ -1108,11 +1209,9 @@ You can use this function to do completion of URLs from the history. | |||
| 1108 | @node Customization | 1209 | @node Customization |
| 1109 | @chapter Customization | 1210 | @chapter Customization |
| 1110 | 1211 | ||
| 1111 | @section Environment Variables | ||
| 1112 | |||
| 1113 | @cindex environment variables | 1212 | @cindex environment variables |
| 1114 | The following environment variables affect the library's operation at | 1213 | The following environment variables affect the @code{url} library's |
| 1115 | startup. | 1214 | operation at startup. |
| 1116 | 1215 | ||
| 1117 | @table @code | 1216 | @table @code |
| 1118 | @item TMPDIR | 1217 | @item TMPDIR |
| @@ -1122,10 +1221,21 @@ If this is defined, @var{url-temporary-directory} is initialized from | |||
| 1122 | it. | 1221 | it. |
| 1123 | @end table | 1222 | @end table |
| 1124 | 1223 | ||
| 1125 | @section General User Options | 1224 | The following user options affect the general operation of |
| 1225 | @code{url} library. | ||
| 1126 | 1226 | ||
| 1127 | The following user options, settable with Customize, affect the | 1227 | @defopt url-configuration-directory |
| 1128 | general operation of the package. | 1228 | @cindex configuration files |
| 1229 | The value of this variable specifies the name of the directory where | ||
| 1230 | the @code{url} library stores its various configuration files, cache | ||
| 1231 | files, etc. | ||
| 1232 | |||
| 1233 | The default value specifies a subdirectory named @file{url/} in the | ||
| 1234 | standard Emacs user data directory specified by the variable | ||
| 1235 | @code{user-emacs-directory} (normally @file{~/.emacs.d}). However, | ||
| 1236 | the old default was @file{~/.url}, and this directory is used instead | ||
| 1237 | if it exists. | ||
| 1238 | @end defopt | ||
| 1129 | 1239 | ||
| 1130 | @defopt url-debug | 1240 | @defopt url-debug |
| 1131 | @cindex debugging | 1241 | @cindex debugging |