aboutsummaryrefslogtreecommitdiffstats
path: root/doc
diff options
context:
space:
mode:
Diffstat (limited to 'doc')
-rw-r--r--doc/emacs/ChangeLog52
-rw-r--r--doc/emacs/ack.texi8
-rw-r--r--doc/emacs/buffers.texi186
-rw-r--r--doc/emacs/building.texi4
-rw-r--r--doc/emacs/dired.texi20
-rw-r--r--doc/emacs/display.texi28
-rw-r--r--doc/emacs/emacs.texi3
-rw-r--r--doc/emacs/files.texi23
-rw-r--r--doc/emacs/mini.texi54
-rw-r--r--doc/emacs/misc.texi58
-rw-r--r--doc/emacs/trouble.texi59
-rw-r--r--doc/lispref/ChangeLog82
-rw-r--r--doc/lispref/control.texi13
-rw-r--r--doc/lispref/debugging.texi29
-rw-r--r--doc/lispref/edebug.texi4
-rw-r--r--doc/lispref/elisp.texi7
-rw-r--r--doc/lispref/errors.texi3
-rw-r--r--doc/lispref/frames.texi14
-rw-r--r--doc/lispref/lists.texi44
-rw-r--r--doc/lispref/objects.texi146
-rw-r--r--doc/lispref/os.texi49
-rw-r--r--doc/lispref/searching.texi27
-rw-r--r--doc/lispref/variables.texi123
-rw-r--r--doc/lispref/windows.texi755
-rw-r--r--doc/misc/ChangeLog65
-rw-r--r--doc/misc/cl.texi471
-rw-r--r--doc/misc/flymake.texi20
-rw-r--r--doc/misc/gnus.texi41
-rw-r--r--doc/misc/ses.texi123
-rw-r--r--doc/misc/texinfo.tex37
-rw-r--r--doc/misc/url.texi644
31 files changed, 2105 insertions, 1087 deletions
diff --git a/doc/emacs/ChangeLog b/doc/emacs/ChangeLog
index c7cbc78f910..fbdb6363b34 100644
--- a/doc/emacs/ChangeLog
+++ b/doc/emacs/ChangeLog
@@ -1,3 +1,55 @@
12012-11-13 Chong Yidong <cyd@gnu.org>
2
3 * building.texi (Multithreaded Debugging): gdb-stopped-hooks is
4 actually named gdb-stopped-functions.
5
62012-11-13 Glenn Morris <rgm@gnu.org>
7
8 * misc.texi (Single Shell): Mention async-shell-command-buffer.
9
102012-11-10 Glenn Morris <rgm@gnu.org>
11
12 * misc.texi (Terminal emulator): Rename `term-face' to `term'.
13
14 * emacs.texi (Acknowledgments): Add profiler author.
15 * ack.texi (Acknowledgments): Add some recent contributions.
16
172012-11-10 Chong Yidong <cyd@gnu.org>
18
19 * files.texi (Diff Mode): Doc fixes for
20 diff-delete-trailing-whitespace (Bug#12831).
21
22 * trouble.texi (Crashing): Copyedits.
23
242012-11-10 Glenn Morris <rgm@gnu.org>
25
26 * files.texi (Diff Mode): Trailing whitespace updates.
27
282012-11-10 Chong Yidong <cyd@gnu.org>
29
30 * misc.texi (Terminal emulator): Document Term mode faces.
31
32 * mini.texi (Basic Minibuffer): New node. Document
33 minibuffer-electric-default-mode.
34
35 * display.texi (Visual Line Mode): Fix index entry.
36
37 * buffers.texi (Several Buffers): List Buffer Menu command anmes,
38 and index the keybindings. Document tabulated-list-sort.
39 (Kill Buffer): Capitalize Buffer Menu.
40
41 * trouble.texi (Memory Full): Capitalize Buffer Menu.
42
432012-11-10 Eli Zaretskii <eliz@gnu.org>
44
45 * display.texi (Auto Scrolling): Clarify that scroll-step is
46 ignored when scroll-conservatively is set to a non-zero value.
47 (Bug#12801)
48
492012-11-10 Chong Yidong <cyd@gnu.org>
50
51 * dired.texi (Dired Updating): Doc fix (Bug#11744).
52
12012-10-30 Michael Albinus <michael.albinus@gmx.de> 532012-10-30 Michael Albinus <michael.albinus@gmx.de>
2 54
3 * trouble.texi (Known Problems): Mention command `debbugs-gnu-usertags'. 55 * 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
246Julien Danjou wrote an implementation of ``Desktop Notifications'' 246Julien 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);
248color manipulation. He also made various contributions to Gnus. 248and @file{color.el}, a library for general color manipulation.
249He also made various contributions to Gnus.
249 250
250@item 251@item
251Vivek Dasmohapatra wrote @file{htmlfontify.el}, to convert a buffer or 252Vivek Dasmohapatra wrote @file{htmlfontify.el}, to convert a buffer or
@@ -790,6 +791,9 @@ mode-sensitive insertion of text into new files.
790Yukihiro Matsumoto and Nobuyoshi Nakada wrote Ruby-mode. 791Yukihiro Matsumoto and Nobuyoshi Nakada wrote Ruby-mode.
791 792
792@item 793@item
794Tomohiro Matsuyama wrote the native Elisp profiler.
795
796@item
793Thomas May wrote @file{blackbox.el}, a version of the traditional 797Thomas May wrote @file{blackbox.el}, a version of the traditional
794blackbox game. 798blackbox 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.
309To kill internal buffers as well, call @code{kill-matching-buffers} 309To kill internal buffers as well, call @code{kill-matching-buffers}
310with a prefix argument. 310with 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
313buffers. @xref{Several Buffers}. 313buffers. @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.
348Similar, but do it in another window. 348Similar, 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})
352does not merely list buffers. It also allows you to perform various 352does not merely list buffers. It also allows you to perform various
353operations on buffers, through an interface similar to Dired 353operations 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
360displaying the @file{*Buffer List*} buffer. You can also type 360displaying 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.
362Alternatively, the command @kbd{M-x buffer-menu-other-window} opens 362Alternatively, the command @kbd{M-x buffer-menu-other-window} opens
363the buffer menu in another window, and selects that window. 363the 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
366through the special commands described in this section. The usual 366through the special commands described in this section. The usual
367cursor motion commands can be used in this buffer. The 367cursor motion commands can be used in this buffer. The following
368following commands apply to the buffer described on the current line: 368commands apply to the buffer described on the current line:
369 369
370@table @kbd 370@table @kbd
371@item d 371@item d
372Request to delete (kill) the buffer, then move down. The request 372@findex Buffer-menu-delete
373shows as a @samp{D} on the line, before the buffer name. Requested 373@kindex d @r{(Buffer Menu)}
374deletions take place when you type the @kbd{x} command. 374Flag the buffer for deletion (killing), then move point to the next
375line (@code{Buffer-menu-delete}). The deletion flag is indicated by
376the character @samp{D} on the line, before the buffer name. The
377deletion occurs only when you type the @kbd{x} command (see below).
378
375@item C-d 379@item C-d
376Like @kbd{d} but move up afterwards instead of down. 380@findex Buffer-menu-delete-backwards
381@kindex C-d @r{(Buffer Menu)}
382Like @kbd{d}, but move point up instead of down
383(@code{Buffer-menu-delete-backwards}).
384
377@item s 385@item s
378Request to save the buffer. The request shows as an @samp{S} on the 386@findex Buffer-menu-save
379line. Requested saves take place when you type the @kbd{x} command. 387@kindex s @r{(Buffer Menu)}
380You may request both saving and deletion for the same buffer. 388Flag the buffer for saving (@code{Buffer-menu-save}). The save flag
389is indicated by the character @samp{S} on the line, before the buffer
390name. The saving occurs only when you type @kbd{x}. You may request
391both saving and deletion for the same buffer.
392
381@item x 393@item x
382Perform previously requested deletions and saves. 394@findex Buffer-menu-execute
395@kindex x @r{(Buffer Menu)}
396Perform all flagged deletions and saves (@code{Buffer-menu-execute}).
397
383@item u 398@item u
384Remove any request made for the current line, and move down. 399@findex Buffer-menu-unmark
400@kindex u @r{(Buffer Menu)}
401Remove all flags from the current line, and move down
402(@code{Buffer-menu-unmark}).
403
385@item @key{DEL} 404@item @key{DEL}
386Move to previous line and remove any request made for that line. 405@findex Buffer-menu-backup-unmark
406@kindex DEL @r{(Buffer Menu)}
407Move 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
390flags also move down (or up) one line. They accept a numeric argument 412The commands for adding or removing flags, @kbd{d}, @kbd{C-d}, @kbd{s}
391as a repeat count. 413and @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
394line: 416the current line. They also accept a numeric argument as a repeat
417count.
395 418
396@table @kbd 419@table @kbd
397@item ~ 420@item ~
398Mark the buffer ``unmodified''. The command @kbd{~} does this 421@findex Buffer-menu-not-modified
399immediately when you type it. 422@kindex ~ @r{(Buffer Menu)}
423Mark the buffer as unmodified (@code{Buffer-menu-not-modified}).
424@xref{Save Commands}.
425
400@item % 426@item %
401Toggle the buffer's read-only flag. The command @kbd{%} does 427@findex Buffer-menu-toggle-read-only
402this immediately when you type it. 428@kindex % @r{(Buffer Menu)}
429Toggle the buffer's read-only status
430(@code{Buffer-menu-toggle-read-only}). @xref{Misc Buffer}.
431
403@item t 432@item t
404Visit the buffer as a tags table. @xref{Select Tags Table}. 433@findex Buffer-menu-visit-tags-table
434@kindex % @r{(Buffer Menu)}
435Visit 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
411Quit the buffer menu---immediately display the most recent formerly 443@findex quit-window
412visible buffer in its place. 444@kindex q @r{(Buffer Menu)}
445Quit the Buffer Menu (@code{quit-window}). The most recent formerly
446visible buffer is displayed in its place.
447
413@item @key{RET} 448@item @key{RET}
414@itemx f 449@itemx f
415Immediately select this line's buffer in place of the @file{*Buffer 450@findex Buffer-menu-this-window
416List*} buffer. 451@kindex f @r{(Buffer Menu)}
452@kindex RET @r{(Buffer Menu)}
453Select this line's buffer, replacing the @file{*Buffer List*} buffer
454in its window (@code{Buffer-menu-this-window}).
455
417@item o 456@item o
418Immediately 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)}
459Select this line's buffer in another window, as if by @kbd{C-x 4 b},
460leaving @file{*Buffer List*} visible
461(@code{Buffer-menu-other-window}).
462
420@item C-o 463@item C-o
421Immediately display this line's buffer in another window, but don't 464@findex Buffer-menu-switch-other-window
422select the window. 465@kindex C-o @r{(Buffer Menu)}
466Display this line's buffer in another window, without selecting it
467(@code{Buffer-menu-switch-other-window}).
468
423@item 1 469@item 1
424Immediately select this line's buffer in a full-screen window. 470@findex Buffer-menu-1-window
471@kindex 1 @r{(Buffer Menu)}
472Select this line's buffer in a full-frame window
473(@code{Buffer-menu-1-window}).
474
425@item 2 475@item 2
426Immediately set up two windows, with this line's buffer selected in 476@findex Buffer-menu-2-window
427one, and the previously current buffer (aside from the buffer 477@kindex 2 @r{(Buffer Menu)}
428@file{*Buffer List*}) displayed in the other. 478Set up two windows on the current frame, with this line's buffer
479selected 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
430Bury the buffer listed on this line. 483@findex Buffer-menu-bury
484@kindex b @r{(Buffer Menu)}
485Bury 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)}
432Mark this line's buffer to be displayed in another window if you exit 490Mark this line's buffer to be displayed in another window if you exit
433with the @kbd{v} command. The request shows as a @samp{>} at the 491with the @kbd{v} command (@code{Buffer-menu-mark}). The display flag
434beginning of the line. (A single buffer may not have both a delete 492is indicated by the character @samp{>} at the beginning of the line.
435request and a display request.) 493(A single buffer may not have both deletion and display flags.)
494
436@item v 495@item v
437Immediately select this line's buffer, and also display in other windows 496@findex Buffer-menu-select
438any buffers previously marked with the @kbd{m} command. If you have not 497@kindex v @r{(Buffer Menu)}
439marked any buffers, this command is equivalent to @kbd{1}. 498Select this line's buffer, and also display in other windows any
499buffers flagged with the @kbd{m} command (@code{Buffer-menu-select}).
500If 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)}
510Sort the Buffer Menu entries according to their values in the column
511at point. With a numeric prefix argument @var{n}, sort according to
512the @var{n}-th column (@code{tabulated-list-sort}).
513
445@item T 514@item T
446Delete, or reinsert, lines for non-file buffers. This command toggles 515@findex Buffer-menu-toggle-files-only
447the inclusion of such buffers in the buffer list. 516@kindex T @r{(Buffer Menu)}
517Delete, or reinsert, lines for non-file buffers
518@code{Buffer-menu-toggle-files-only}). This command toggles the
519inclusion 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
451suitable buffer, and turn on Buffer Menu mode in it. Everything else
452described above is implemented by the special commands provided in
453Buffer Menu mode. One consequence of this is that you can switch from
454the @file{*Buffer List*} buffer to another Emacs buffer, and edit
455there. You can reselect the @file{*Buffer List*} buffer later, to
456perform the operations already requested, or you can kill it, or pay
457no 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
460automatically when buffers are created and killed; its contents are 523automatically when buffers are created and killed; its contents are
461just text. If you have created, deleted or renamed buffers, the way 524just 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/building.texi b/doc/emacs/building.texi
index 3a3630138de..e0ea72902fb 100644
--- a/doc/emacs/building.texi
+++ b/doc/emacs/building.texi
@@ -1244,8 +1244,8 @@ depending on the reason which caused the stop. Customize the variable
1244@code{gdb-switch-reasons} to select the stop reasons which will cause 1244@code{gdb-switch-reasons} to select the stop reasons which will cause
1245a thread switch. 1245a thread switch.
1246 1246
1247@vindex gdb-stopped-hooks 1247@vindex gdb-stopped-functions
1248 The variable @code{gdb-stopped-hooks} allows you to execute your 1248 The variable @code{gdb-stopped-functions} allows you to execute your
1249functions whenever some thread stops. 1249functions whenever some thread stops.
1250 1250
1251 In non-stop mode, you can switch between different modes for GUD 1251 In non-stop mode, you can switch between different modes for GUD
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
1174delete the files---type @kbd{k} (@code{dired-do-kill-lines}). Like 1174deleting the files---type @kbd{k} (@code{dired-do-kill-lines}). Like
1175the file-operating commands, this command operates on the next @var{n} 1175the file-operating commands, this command operates on the next @var{n}
1176files, or on the marked files if any; but it does not operate on the 1176files, or on the marked files if any. However, it does not operate on
1177current file as a last resort. 1177the 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
1180for a file that is a directory, which you have inserted in the Dired 1180had inserted in the Dired buffer as a subdirectory
1181buffer as a subdirectory, it removed that subdirectory line from the 1181(@pxref{Subdirectories in Dired}), it removes the subdirectory listing
1182buffer as well. Typing @kbd{C-u k} on the header line for a 1182as well. Typing @kbd{C-u k} on the header line for a subdirectory
1183subdirectory also removes the subdirectory line from the Dired buffer. 1183also 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
1186killed in this way, but not subdirectories---you must use @kbd{i} to 1186killed 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.
221if you set @code{scroll-conservatively} to a small number @var{n}, 221if you set @code{scroll-conservatively} to a small number @var{n},
222then if you move point just a little off the screen (less than @var{n} 222then if you move point just a little off the screen (less than @var{n}
223lines), Emacs scrolls the text just far enough to bring point back on 223lines), Emacs scrolls the text just far enough to bring point back on
224screen. By default, @code{scroll-conservatively} is@tie{}0. If you 224screen. If doing so fails to make point visible, Emacs centers point
225set @code{scroll-conservatively} to a large number (larger than 100), 225in the window. By default, @code{scroll-conservatively} is@tie{}0.
226Emacs will never center point as result of scrolling, even if point 226If you set @code{scroll-conservatively} to a large number (larger than
227moves far away from the text previously displayed in the window. With 227100), Emacs will never center point as result of scrolling, even if
228such a large value, Emacs will always scroll text just enough for 228point moves far away from the text previously displayed in the window.
229With such a large value, Emacs will always scroll text just enough for
229bringing point into view, so point will end up at the top or bottom of 230bringing point into view, so point will end up at the top or bottom of
230the window, depending on the scroll direction. 231the 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
234the window when point moves off the screen. If moving by that number 235customizing the variable @code{scroll-step}. Its value determines how
235of lines fails to bring point back into view, point is centered 236many lines to scroll the window when point moves off the screen. If
236instead. The default value is zero, which causes point to always be 237moving by that number of lines fails to bring point back into view,
237centered after scrolling. 238point is centered instead. The default value is zero, which causes
239point to always be centered after scrolling.
240
241 Since both @code{scroll-conservatively} and @code{scroll-step}
242control automatic scrolling in contradicting ways, you should set only
243one 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
1493edge. This makes the text easier to read, as wrapping does not occur 1500edge. This makes the text easier to read, as wrapping does not occur
1494in the middle of words. 1501in 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
262The Minibuffer 262The 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
1402Lüdecke, Greg McGary, Roland McGrath, Michael McNamara, Alan Mackenzie, 1403Lüdecke, Greg McGary, Roland McGrath, Michael McNamara, Alan Mackenzie,
1403Christopher J.@: Madsen, Neil M.@: Mager, Ken Manheimer, Bill Mann, 1404Christopher J.@: Madsen, Neil M.@: Mager, Ken Manheimer, Bill Mann,
1404Brian Marick, Simon Marshall, Bengt Martensson, Charlie Martin, 1405Brian Marick, Simon Marshall, Bengt Martensson, Charlie Martin,
1405Yukihiro Matsumoto, David Maus, Thomas May, Will Mengarini, David 1406Yukihiro Matsumoto, Tomohiro Matsuyama, David Maus, Thomas May, Will Mengarini, David
1406Megginson, Stefan Merten, Ben A.@: Mesander, Wayne Mesard, Brad 1407Megginson, Stefan Merten, Ben A.@: Mesander, Wayne Mesard, Brad
1407Miller, Lawrence Mitchell, Richard Mlynarik, Gerd Moellmann, Stefan 1408Miller, Lawrence Mitchell, Richard Mlynarik, Gerd Moellmann, Stefan
1408Monnier, Keith Moore, Jan Moringen, Morioka Tomohiko, Glenn Morris, 1409Monnier, 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
1342read-only, you need to make it writable first. @xref{Misc Buffer}.) 1342read-only, you need to make it writable first. @xref{Misc Buffer}.)
1343Whenever you change a hunk, Diff mode attempts to automatically 1343Whenever you change a hunk, Diff mode attempts to automatically
1344correct the line numbers in the hunk headers, to ensure that the diff 1344correct the line numbers in the hunk headers, to ensure that the patch
1345remains ``correct''. To disable automatic line number correction, 1345remains ``correct''. To disable automatic line number correction,
1346change the variable @code{diff-update-on-the-fly} to @code{nil}. 1346change 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
1470functions that are deleted by the patch. 1470functions 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.
1474lines, so that they are more obvious. This is done by enabling 1474@c Emacs's dir-locals file enables this (for some reason).
1475Whitespace mode in the Diff buffer (@pxref{Useless Whitespace}). Diff 1475@cindex trailing whitespace, in patches
1476mode buffers are set up so that Whitespace mode avoids highlighting 1476@findex diff-delete-trailing-whitespace
1477trailing whitespace occurring in the diff context. 1477 Patches sometimes include trailing whitespace on modified lines, as
1478an unintentional and undesired change. There are two ways to deal
1479with this problem. Firstly, if you enable Whitespace mode in a Diff
1480buffer (@pxref{Useless Whitespace}), it automatically highlights
1481trailing whitespace in modified lines. Secondly, you can use the
1482command @kbd{M-x diff-delete-trailing-whitespace}, which searches for
1483trailing whitespace in the lines modified by the patch, and removes
1484that whitespace in both the patch and the patched source file(s).
1485This command does not save the modifications that it makes, so you can
1486decide whether to save the changes (the list of modified files is
1487displayed in the echo area). With a prefix argument, it tries to
1488modify 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
13use the usual Emacs editing commands in the minibuffer to edit the 13use the usual Emacs editing commands in the minibuffer to edit the
14argument text. 14argument 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
18cursor. The minibuffer starts with a @dfn{prompt} in a distinct 32cursor. The minibuffer starts with a @dfn{prompt}, usually ending
19color, usually ending with a colon. The prompt states what kind of 33with a colon. The prompt states what kind of input is expected, and
20input is expected, and how it will be used. 34how 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,
23then @key{RET} to submit the argument and exit the minibuffer. You 38then @key{RET} to submit the argument and exit the minibuffer.
24can cancel the minibuffer, and the command that wants the argument, by 39Alternatively, you can type @kbd{C-g} to exit the minibuffer by
25typing @kbd{C-g}. 40cancelling 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
29parentheses before the colon. This default will be used as the 44parentheses before the colon. This default will be used as the
30argument if you just type @key{RET}. For example, commands that read 45argument if you just type @key{RET}. For example, commands that read
31buffer names usually show a buffer name as the default; you can type 46buffer 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,
54Emacs hides the default argument as soon as you modify the contents of
55the minibuffer (since typing @key{RET} would no longer submit that
56default). If you ever bring back the original minibuffer text, the
57prompt again shows the default. Furthermore, if you change the
58variable @code{minibuffer-eldef-shorten-default} to a non-@code{nil}
59value, the default argument is displayed as @samp{[@var{default}]}
60instead of @samp{(default @var{default})}, saving some screen space.
61To enable this minor mode, type @kbd{M-x
62minibuffer-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
35other uses of the echo area. If an error message or an informative 65other uses of the echo area. If an error message or an informative
36message is emitted while the minibuffer is active, the message hides 66message 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
38the minibuffer comes back. While the minibuffer is in use, keystrokes 68the minibuffer comes back. While the minibuffer is in use, keystrokes
39do not echo. 69do 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..1836c1982e6 100644
--- a/doc/emacs/misc.texi
+++ b/doc/emacs/misc.texi
@@ -542,11 +542,19 @@ which is impossible to ignore.
542You can also type @kbd{M-&} (@code{async-shell-command}) to execute a 542You can also type @kbd{M-&} (@code{async-shell-command}) to execute a
543shell command asynchronously; this is exactly like calling @kbd{M-!} 543shell command asynchronously; this is exactly like calling @kbd{M-!}
544with a trailing @samp{&}, except that you do not need the @samp{&}. 544with a trailing @samp{&}, except that you do not need the @samp{&}.
545The output buffer for asynchronous shell commands is named 545The default output buffer for asynchronous shell commands is named
546@samp{*Async Shell Command*}. Emacs inserts the output into this 546@samp{*Async Shell Command*}. Emacs inserts the output into this
547buffer as it comes in, whether or not the buffer is visible in a 547buffer as it comes in, whether or not the buffer is visible in a
548window. 548window.
549 549
550@vindex async-shell-command-buffer
551 If you want to run more than one asynchronous shell command at the
552same time, they could end up competing for the output buffer. The
553option @code{async-shell-command-buffer} specifies what to do about
554this; e.g., whether to rename the pre-existing output buffer, or to
555use a different buffer for the new command. Consult the variable's
556documentation for more possibilities.
557
550@kindex M-| 558@kindex M-|
551@findex shell-command-on-region 559@findex shell-command-on-region
552 @kbd{M-|} (@code{shell-command-on-region}) is like @kbd{M-!}, but 560 @kbd{M-|} (@code{shell-command-on-region}) is like @kbd{M-!}, but
@@ -1186,30 +1194,39 @@ underlying shell, of course.
1186@subsection Emacs Terminal Emulator 1194@subsection Emacs Terminal Emulator
1187@findex term 1195@findex term
1188 1196
1189 To run a subshell in a terminal emulator, use @kbd{M-x term}. This 1197 To run a subshell in a text terminal emulator, use @kbd{M-x term}.
1190creates (or reuses) a buffer named @file{*terminal*}, and runs a 1198This creates (or reuses) a buffer named @file{*terminal*}, and runs a
1191subshell with input coming from your keyboard, and output going to 1199subshell with input coming from your keyboard, and output going to
1192that buffer. 1200that buffer.
1193 1201
1202@cindex line mode @r{(terminal emulator)}
1203@cindex char mode @r{(terminal emulator)}
1194 The terminal emulator uses Term mode, which has two input modes. In 1204 The terminal emulator uses Term mode, which has two input modes. In
1195line mode, Term basically acts like Shell mode (@pxref{Shell Mode}). 1205@dfn{line mode}, Term basically acts like Shell mode (@pxref{Shell
1196 1206Mode}). In @dfn{char mode}, each character is sent directly to the
1197 In char mode, each character is sent directly to the subshell, as 1207subshell, as terminal input; the sole exception is the terminal escape
1198``terminal input''. Any ``echoing'' of your input is the 1208character, which by default is @kbd{C-c} (@pxref{Term Mode}). Any
1199responsibility of the subshell. The sole exception is the terminal 1209echoing of your input is the responsibility of the subshell; any
1200escape character, which by default is @kbd{C-c} (@pxref{Term Mode}). 1210terminal output from the subshell goes into the buffer, advancing
1201Any ``terminal output'' from the subshell goes into the buffer, 1211point.
1202advancing point.
1203 1212
1204 Some programs (such as Emacs itself) need to control the appearance 1213 Some programs (such as Emacs itself) need to control the appearance
1205on the terminal screen in detail. They do this by sending special 1214of the terminal screen in detail. They do this by emitting special
1206control codes. The exact control codes needed vary from terminal to 1215control codes. Term mode recognizes and handles ANSI-standard
1207terminal, but nowadays most terminals and terminal emulators 1216VT100-style escape sequences, which are accepted by most modern
1208(including @code{xterm}) understand the ANSI-standard (VT100-style) 1217terminals, including @command{xterm}. (Hence, you can actually run
1209escape sequences. Term mode recognizes these escape sequences, and 1218Emacs inside an Emacs Term window.)
1210handles each one appropriately, changing the buffer so that the 1219
1211appearance of the window matches what it would be on a real terminal. 1220 The @code{term} face specifies the default appearance of text
1212You can actually run Emacs inside an Emacs Term window. 1221in the terminal emulator (the default is the same appearance as the
1222@code{default} face). When terminal control codes are used to change
1223the appearance of text, these are represented in the terminal emulator
1224by the faces @code{term-color-black}, @code{term-color-red},
1225@code{term-color-green}, @code{term-color-yellow}
1226@code{term-color-blue}, @code{term-color-magenta},
1227@code{term-color-cyan}, @code{term-color-white},
1228@code{term-color-underline}, and @code{term-color-bold}.
1229@xref{Faces}.
1213 1230
1214 You can also Term mode to communicate with a device connected to a 1231 You can also Term mode to communicate with a device connected to a
1215serial port. @xref{Serial Terminal}. 1232serial port. @xref{Serial Terminal}.
@@ -1224,6 +1241,9 @@ examining your input. But some shells can tell Term what the current
1224directory is. This is done automatically by @code{bash} version 1.15 1241directory is. This is done automatically by @code{bash} version 1.15
1225and later. 1242and later.
1226 1243
1244
1245
1246
1227@node Term Mode 1247@node Term Mode
1228@subsection Term Mode 1248@subsection Term Mode
1229@cindex Term mode 1249@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
275editing in the same Emacs session. 275editing 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
278out of memory, because the buffer menu needs a fair amount of memory 278out of memory, because the Buffer Menu needs a fair amount of memory
279itself, and the reserve supply may not be enough. 279itself, 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
285reports 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
287containing voluminous data about the crash. On many platforms you can 287the standard error stream. If Emacs was started from a graphical
288enable core dumps by putting the shell command @samp{ulimit -c unlimited} 288desktop, the standard error stream is commonly redirected to a file
289into your shell startup script. The crash report and core dump can be 289such as @file{~/.xsession-errors}, so you can look for the crash
290used when debugging the same version of Emacs on the same platform. 290report there.
291 291
292The format of the crash report depends on the platform, and some 292 The format of the crash report depends on the platform. On some
293platforms support backtraces. 293platforms, such as those using the GNU C Library, the crash report
294Here is an example, generated on x86-64 GNU/Linux with version 2.15 of 294includes a @dfn{backtrace} describing the execution state prior to
295the GNU C Library: 295crashing, which can be used to help debug the crash. Here is an
296example:
296 297
297@example 298@example
298Fatal error 11: Segmentation fault 299Fatal 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]
305emacs[0x509af6] 306emacs[0x509af6]
306emacs[0x5acc26] 307emacs[0x5acc26]
307emacs[0x5adbfb] 308@dots{}
308emacs[0x56566b]
309emacs[0x59bac3]
310emacs[0x565151]
311...
312@end example 309@end example
313 310
314@noindent 311@noindent
315The number @samp{11} is the system signal number that corresponds to 312The number @samp{11} is the system signal number corresponding to the
316the problem, a segmentation fault here. The three dots at the end 313crash---in this case a segmentation fault. The hexadecimal numbers
317indicate that Emacs suppressed further backtrace entries, in the 314are program addresses, which can be associated with source code lines
318interest of brevity. 315using a debugging tool. For example, the GDB command
319 316@samp{list *0x509af6} prints the source-code lines corresponding to
320The hexadecimal program addresses can be useful in debugging sessions. 317the @samp{emacs[0x509af6]} entry. If your system has the
321For example, the GDB command @samp{list *0x509af6} prints the 318@command{addr2line} utility, the following shell command outputs a
322source-code lines corresponding to the @samp{emacs[0x509af6]} entry in 319backtrace with source-code line numbers:
323the backtrace. Or, if your system has @command{addr2line}, the
324following shell command outputs a backtrace with source-code line
325numbers:
326 320
327@example 321@example
328sed -n 's/.*\[\(.*\)]$/\1/p' @var{backtrace} | 322sed -n 's/.*\[\(.*\)]$/\1/p' @var{backtrace} |
@@ -334,6 +328,15 @@ Here, @var{backtrace} is the name of a text file containing a copy of
334the backtrace, and @var{bindir} is the name of the directory that 328the backtrace, and @var{bindir} is the name of the directory that
335contains the Emacs executable. 329contains the Emacs executable.
336 330
331@cindex core dump
332 Optionally, Emacs can generate a @dfn{core dump} when it crashes. A
333core dump is a file containing voluminous data about the state of the
334program prior to the crash, usually examined by loading it into a
335debugger such as GDB. On many platforms, core dumps are disabled by
336default, and you must explicitly enable them by running the shell
337command @samp{ulimit -c unlimited} (e.g.@: in your shell startup
338script).
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 da3cc91a675..6d6ddf4da9a 100644
--- a/doc/lispref/ChangeLog
+++ b/doc/lispref/ChangeLog
@@ -1,3 +1,85 @@
12012-11-13 Glenn Morris <rgm@gnu.org>
2
3 * variables.texi (Adding Generalized Variables):
4 At least mention gv-define-expander and gv-letplace.
5
6 * debugging.texi (Error Debugging): Mention debug-on-message.
7 (Using Debugger): Mention debugger-bury-or-kill.
8
9 * control.texi (Signaling Errors):
10 * debugging.texi (Error Debugging):
11 * errors.texi (Standard Errors): Add user-error.
12
13 * variables.texi (Adding Generalized Variables):
14 Use standard formatting for common lisp note about setf functions.
15
162012-11-10 Martin Rudalics <rudalics@gmx.at>
17
18 * elisp.texi (Top): Add Recombining Windows to menu.
19 * windows.texi (Recombining Windows): New subsection.
20 (Splitting Windows): Rewrite text on handling of window
21 combinations and move it to new subsection.
22
232012-11-10 Chong Yidong <cyd@gnu.org>
24
25 * searching.texi (Replacing Match): Document \? in replace-match.
26
27 * variables.texi (Creating Buffer-Local): Document setq-local and
28 defvar-local.
29 (Setting Generalized Variables): Arrange table alphabetically.
30
31 * lists.texi (List Elements, List Variables): Clarify descriptions
32 of push and pop for generalized variables.
33
34 * edebug.texi (Specification List): setf is no longer CL-only.
35
362012-11-10 Glenn Morris <rgm@gnu.org>
37
38 * variables.texi (Adding Generalized Variables):
39 Update description of FIX-RETURN expansion.
40
41 * variables.texi (Setting Generalized Variables):
42 Split most of previous contents into this subsection.
43 (Adding Generalized Variables): New subsection.
44 Move note on lack of setf functions here from misc/cl.texi.
45
46 * elisp.texi: Add Generalized Variables subsections to detailed menu.
47
482012-11-10 Chong Yidong <cyd@gnu.org>
49
50 * frames.texi (Initial Parameters): Doc fix (Bug#12144).
51
522012-11-08 Michael Albinus <michael.albinus@gmx.de>
53
54 * os.texi (Notifications): Update descriptions of
55 notifications-notify, notifications-close-notification and
56 notifications-get-capabilities according to latest code changes.
57 Add notifications-get-server-information.
58
592012-11-03 Chong Yidong <cyd@gnu.org>
60
61 * objects.texi (General Escape Syntax): Clarify the explanation of
62 escape sequences.
63 (Non-ASCII in Strings): Clarify when a string is unibyte vs
64 multibyte. Hex escapes do not automatically make a string
65 multibyte.
66
672012-11-03 Martin Rudalics <rudalics@gmx.at>
68
69 * windows.texi (Switching Buffers): Document option
70 switch-to-buffer-preserve-window-point.
71 (Display Action Functions): Document window-height and
72 window-width alist entries.
73 (Display Action Functions): Document
74 display-buffer-below-selected and
75 display-buffer-in-previous-window.
76 (Quitting Windows): Document quit-restore-window. Rewrite
77 section.
78 (Window Configurations): In window-state-get mention that
79 argument window must be valid.
80 (Window Parameters): Document quit-restore window parameter
81 (Bug#12158).
82
12012-10-31 Glenn Morris <rgm@gnu.org> 832012-10-31 Glenn Morris <rgm@gnu.org>
2 84
3 * control.texi (Catch and Throw): Add xref to cl.texi. 85 * control.texi (Catch and Throw): Add xref to cl.texi.
diff --git a/doc/lispref/control.texi b/doc/lispref/control.texi
index cf393b59c49..489e5cc5b22 100644
--- a/doc/lispref/control.texi
+++ b/doc/lispref/control.texi
@@ -824,6 +824,19 @@ The function @code{signal} never returns.
824@end example 824@end example
825@end defun 825@end defun
826 826
827@cindex user errors, signaling
828@defun user-error format-string &rest args
829This function behaves exactly like @code{error}, except that it uses
830the error symbol @code{user-error} rather than @code{error}. As the
831name suggests, this is intended to report errors on the part of the
832user, rather than errors in the code itself. For example,
833if you try to use the command @code{Info-history-back} (@kbd{l}) to
834move back beyond the start of your Info browsing history, Emacs
835signals a @code{user-error}. Such errors do not cause entry to the
836debugger, even when @code{debug-on-error} is non-@code{nil}.
837@xref{Error Debugging}.
838@end defun
839
827@cindex CL note---no continuable errors 840@cindex CL note---no continuable errors
828@quotation 841@quotation
829@b{Common Lisp note:} Emacs Lisp has nothing like the Common Lisp 842@b{Common Lisp note:} Emacs Lisp has nothing like the Common Lisp
diff --git a/doc/lispref/debugging.texi b/doc/lispref/debugging.texi
index 2226db942d1..11532b19781 100644
--- a/doc/lispref/debugging.texi
+++ b/doc/lispref/debugging.texi
@@ -117,12 +117,12 @@ has any of those condition symbols, or if the error message matches
117any of the regular expressions, then that error does not enter the 117any of the regular expressions, then that error does not enter the
118debugger. 118debugger.
119 119
120The normal value of this variable lists several errors that happen 120The normal value of this variable includes @code{user-error}, as well
121often during editing but rarely result from bugs in Lisp programs. 121as several errors that happen often during editing but rarely result
122However, ``rarely'' is not ``never''; if your program fails with an 122from bugs in Lisp programs. However, ``rarely'' is not ``never''; if
123error that matches this list, you may try changing this list to debug 123your program fails with an error that matches this list, you may try
124the error. The easiest way is usually to set 124changing this list to debug the error. The easiest way is usually to
125@code{debug-ignored-errors} to @code{nil}. 125set @code{debug-ignored-errors} to @code{nil}.
126@end defopt 126@end defopt
127 127
128@defopt eval-expression-debug-on-error 128@defopt eval-expression-debug-on-error
@@ -163,6 +163,14 @@ supported values correspond to the signals @code{SIGUSR1} and
163@code{inhibit-quit} is set and Emacs is not otherwise responding. 163@code{inhibit-quit} is set and Emacs is not otherwise responding.
164@end defopt 164@end defopt
165 165
166@cindex message, finding what causes a particular message
167@defvar debug-on-message
168If you set @code{debug-on-message} to a regular expression,
169Emacs will enter the debugger if it displays a matching message in the
170echo area. For example, this can be useful when trying to find the
171cause of a particular message.
172@end defvar
173
166 To debug an error that happens during loading of the init 174 To debug an error that happens during loading of the init
167file, use the option @samp{--debug-init}. This binds 175file, use the option @samp{--debug-init}. This binds
168@code{debug-on-error} to @code{t} while loading the init file, and 176@code{debug-on-error} to @code{t} while loading the init file, and
@@ -314,6 +322,7 @@ is a message describing the reason that the debugger was invoked (such
314as the error message and associated data, if it was invoked due to an 322as the error message and associated data, if it was invoked due to an
315error). 323error).
316 324
325@vindex debugger-bury-or-kill
317 The backtrace buffer is read-only and uses a special major mode, 326 The backtrace buffer is read-only and uses a special major mode,
318Debugger mode, in which letters are defined as debugger commands. The 327Debugger mode, in which letters are defined as debugger commands. The
319usual Emacs editing commands are available; thus, you can switch windows 328usual Emacs editing commands are available; thus, you can switch windows
@@ -322,8 +331,12 @@ switch buffers, visit files, or do any other sort of editing. However,
322the debugger is a recursive editing level (@pxref{Recursive Editing}) 331the debugger is a recursive editing level (@pxref{Recursive Editing})
323and it is wise to go back to the backtrace buffer and exit the debugger 332and it is wise to go back to the backtrace buffer and exit the debugger
324(with the @kbd{q} command) when you are finished with it. Exiting 333(with the @kbd{q} command) when you are finished with it. Exiting
325the debugger gets out of the recursive edit and kills the backtrace 334the debugger gets out of the recursive edit and buries the backtrace
326buffer. 335buffer. (You can customize what the @kbd{q} command does with the
336backtrace buffer by setting the variable @code{debugger-bury-or-kill}.
337For example, set it to @code{kill} if you prefer to kill the buffer
338rather than bury it. Consult the variable's documentation for more
339possibilities.)
327 340
328 When the debugger has been entered, the @code{debug-on-error} 341 When the debugger has been entered, the @code{debug-on-error}
329variable is temporarily set according to 342variable is temporarily set according to
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.
1211A single evaluated expression, which is instrumented. 1211A 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. 1214A generalized variable. @xref{Generalized Variables}.
1215@c @findex edebug-unwrap
1216A place to store a value, as in the Common Lisp @code{setf} construct.
1217 1215
1218@item body 1216@item body
1219Short for @code{&rest form}. See @code{&rest} below. 1217Short 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
505Generalized Variables
506
507* Setting Generalized Variables:: The @code{setf} macro.
508* Adding Generalized Variables:: Defining new @code{setf} forms.
509
505Functions 510Functions
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/errors.texi b/doc/lispref/errors.texi
index a57f74d6c86..b92fd9ed665 100644
--- a/doc/lispref/errors.texi
+++ b/doc/lispref/errors.texi
@@ -172,6 +172,9 @@ The message is @samp{Text is read-only}. This is a subcategory of
172@item undefined-color 172@item undefined-color
173The message is @samp{Undefined color}. @xref{Color Names}. 173The message is @samp{Undefined color}. @xref{Color Names}.
174 174
175@item user-error
176The message is the empty string. @xref{Signaling Errors}.
177
175@item void-function 178@item void-function
176The message is @samp{Symbol's function definition is void}. 179The message is @samp{Symbol's function definition is void}.
177@xref{Function Cells}. 180@xref{Function Cells}.
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
422If these parameters specify a separate @dfn{minibuffer-only frame} with
423@code{(minibuffer . nil)}, and you have not created one, Emacs creates
424one for you.
425
426@cindex minibuffer-only frame 422@cindex minibuffer-only frame
423If these parameters include @code{(minibuffer . nil)}, that indicates
424that the initial frame should have no minibuffer. In this case, Emacs
425creates a separate @dfn{minibuffer-only frame} as well.
426
427@defopt minibuffer-frame-alist 427@defopt minibuffer-frame-alist
428This variable's value is an alist of parameter values used when 428This variable's value is an alist of parameter values used when
429creating an initial minibuffer-only frame. This is the 429creating an initial minibuffer-only frame (i.e.@: the minibuffer-only
430minibuffer-only frame that Emacs creates if @code{initial-frame-alist} 430frame that Emacs creates if @code{initial-frame-alist} specifies a
431specifies a frame with no minibuffer. 431frame 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
237This macro is a way of examining the @sc{car} of a list, 237This macro provides a convenient way to examine the @sc{car} of a
238and taking it off the list, all at once. 238list, 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, 239stored in @var{listname}. It removes the first element from the list,
240@c but generalized variables have not been introduced yet. 240saves the @sc{cdr} into @var{listname}, then returns the removed
241(In fact, this macro can act on generalized variables, not just lists. 241element.
242@xref{Generalized Variables}.) 242
243 243In the simplest case, @var{listname} is an unquoted symbol naming a
244It operates on the list which is stored in the symbol @var{listname}. 244list; in that case, this macro is equivalent to @w{@code{(prog1
245It removes this element from the list by setting @var{listname} 245(car listname) (setq listname (cdr listname)))}}.
246to the @sc{cdr} of its old value---but it also returns the @sc{car}
247of that list, which is the element being removed.
248 246
249@example 247@example
250x 248x
@@ -255,7 +253,10 @@ x
255 @result{} (b c) 253 @result{} (b c)
256@end example 254@end example
257 255
258@noindent 256More generally, @var{listname} can be a generalized variable. In that
257case, this macro saves into @var{listname} using @code{setf}.
258@xref{Generalized Variables}.
259
259For the @code{push} macro, which adds an element to a list, 260For 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
684to modify a list which is stored in a variable. 685to modify a list which is stored in a variable.
685 686
686@defmac push newelt listname 687@defmac push element listname
687This macro provides an alternative way to write 688This macro creates a new list whose @sc{car} is @var{element} and
688@code{(setq @var{listname} (cons @var{newelt} @var{listname}))}. 689whose @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, 690list in @var{listname}. In the simplest case, @var{listname} is an
690@c but generalized variables have not been introduced yet. 691unquoted symbol naming a list, and this macro is equivalent
691(In fact, this macro can act on generalized variables, not just lists. 692to @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 703More generally, @code{listname} can be a generalized variable. In
704that case, this macro does the equivalent of @w{@code{(setf
705@var{listname} (cons @var{element} @var{listname}))}}.
706@xref{Generalized Variables}.
707
704For the @code{pop} macro, which removes the first element from a list, 708For 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/objects.texi b/doc/lispref/objects.texi
index 7d40f0ff934..6933ffe492a 100644
--- a/doc/lispref/objects.texi
+++ b/doc/lispref/objects.texi
@@ -351,51 +351,48 @@ following text.)
351control characters, Emacs provides several types of escape syntax that 351control characters, Emacs provides several types of escape syntax that
352you can use to specify non-@acronym{ASCII} text characters. 352you can use to specify non-@acronym{ASCII} text characters.
353 353
354@cindex unicode character escape
355 You can specify characters by their Unicode values.
356@code{?\u@var{nnnn}} represents a character that maps to the Unicode
357code point @samp{U+@var{nnnn}} (by convention, Unicode code points are
358given in hexadecimal). There is a slightly different syntax for
359specifying characters with code points higher than
360@code{U+@var{ffff}}: @code{\U00@var{nnnnnn}} represents the character
361whose code point is @samp{U+@var{nnnnnn}}. The Unicode Standard only
362defines code points up to @samp{U+@var{10ffff}}, so if you specify a
363code point higher than that, Emacs signals an error.
364
365 This peculiar and inconvenient syntax was adopted for compatibility
366with other programming languages. Unlike some other languages, Emacs
367Lisp supports this syntax only in character literals and strings.
368
369@cindex @samp{\} in character constant 354@cindex @samp{\} in character constant
370@cindex backslash in character constants 355@cindex backslash in character constants
371@cindex octal character code 356@cindex unicode character escape
372 The most general read syntax for a character represents the 357 Firstly, you can specify characters by their Unicode values.
373character code in either octal or hex. To use octal, write a question 358@code{?\u@var{nnnn}} represents a character with Unicode code point
374mark followed by a backslash and the octal character code (up to three 359@samp{U+@var{nnnn}}, where @var{nnnn} is (by convention) a hexadecimal
375octal digits); thus, @samp{?\101} for the character @kbd{A}, 360number with exactly four digits. The backslash indicates that the
376@samp{?\001} for the character @kbd{C-a}, and @code{?\002} for the 361subsequent characters form an escape sequence, and the @samp{u}
377character @kbd{C-b}. Although this syntax can represent any 362specifies a Unicode escape sequence.
378@acronym{ASCII} character, it is preferred only when the precise octal 363
379value is more important than the @acronym{ASCII} representation. 364 There is a slightly different syntax for specifying Unicode
380 365characters with code points higher than @code{U+@var{ffff}}:
381@example 366@code{?\U00@var{nnnnnn}} represents the character with code point
382@group 367@samp{U+@var{nnnnnn}}, where @var{nnnnnn} is a six-digit hexadecimal
383?\012 @result{} 10 ?\n @result{} 10 ?\C-j @result{} 10 368number. The Unicode Standard only defines code points up to
384?\101 @result{} 65 ?A @result{} 65 369@samp{U+@var{10ffff}}, so if you specify a code point higher than
385@end group 370that, Emacs signals an error.
386@end example 371
387 372 Secondly, you can specify characters by their hexadecimal character
388 To use hex, write a question mark followed by a backslash, @samp{x}, 373codes. A hexadecimal escape sequence consists of a backslash,
389and the hexadecimal character code. You can use any number of hex 374@samp{x}, and the hexadecimal character code. Thus, @samp{?\x41} is
390digits, so you can represent any character code in this way. 375the character @kbd{A}, @samp{?\x1} is the character @kbd{C-a}, and
391Thus, @samp{?\x41} for the character @kbd{A}, @samp{?\x1} for the 376@code{?\xe0} is the character
392character @kbd{C-a}, and @code{?\xe0} for the Latin-1 character
393@iftex 377@iftex
394@samp{@`a}. 378@samp{@`a}.
395@end iftex 379@end iftex
396@ifnottex 380@ifnottex
397@samp{a} with grave accent. 381@samp{a} with grave accent.
398@end ifnottex 382@end ifnottex
383You can use any number of hex digits, so you can represent any
384character code in this way.
385
386@cindex octal character code
387 Thirdly, you can specify characters by their character code in
388octal. An octal escape sequence consists of a backslash followed by
389up to three octal digits; thus, @samp{?\101} for the character
390@kbd{A}, @samp{?\001} for the character @kbd{C-a}, and @code{?\002}
391for the character @kbd{C-b}. Only characters up to octal code 777 can
392be specified this way.
393
394 These escape sequences may also be used in strings. @xref{Non-ASCII
395in Strings}.
399 396
400@node Ctl-Char Syntax 397@node Ctl-Char Syntax
401@subsubsection Control-Character Syntax 398@subsubsection Control-Character Syntax
@@ -1026,40 +1023,53 @@ but the newline is ignored if escaped."
1026@node Non-ASCII in Strings 1023@node Non-ASCII in Strings
1027@subsubsection Non-@acronym{ASCII} Characters in Strings 1024@subsubsection Non-@acronym{ASCII} Characters in Strings
1028 1025
1029 You can include a non-@acronym{ASCII} international character in a 1026 There are two text representations for non-@acronym{ASCII}
1030string constant by writing it literally. There are two text 1027characters in Emacs strings: multibyte and unibyte (@pxref{Text
1031representations for non-@acronym{ASCII} characters in Emacs strings 1028Representations}). Roughly speaking, unibyte strings store raw bytes,
1032(and in buffers): unibyte and multibyte (@pxref{Text 1029while multibyte strings store human-readable text. Each character in
1033Representations}). If the string constant is read from a multibyte 1030a unibyte string is a byte, i.e.@: its value is between 0 and 255. By
1034source, such as a multibyte buffer or string, or a file that would be 1031contrast, each character in a multibyte string may have a value
1035visited as multibyte, then Emacs reads the non-@acronym{ASCII} 1032between 0 to 4194303 (@pxref{Character Type}). In both cases,
1036character as a multibyte character and automatically makes the string 1033characters above 127 are non-@acronym{ASCII}.
1037a multibyte string. If the string constant is read from a unibyte 1034
1038source, then Emacs reads the non-@acronym{ASCII} character as unibyte, 1035 You can include a non-@acronym{ASCII} character in a string constant
1039and makes the string unibyte. 1036by writing it literally. If the string constant is read from a
1040 1037multibyte source, such as a multibyte buffer or string, or a file that
1041 Instead of writing a non-@acronym{ASCII} character literally into a 1038would be visited as multibyte, then Emacs reads each
1042multibyte string, you can write it as its character code using a hex 1039non-@acronym{ASCII} character as a multibyte character and
1043escape, @samp{\x@var{nnnnnnn}}, with as many digits as necessary. 1040automatically makes the string a multibyte string. If the string
1044(Multibyte non-@acronym{ASCII} character codes are all greater than 1041constant is read from a unibyte source, then Emacs reads the
1045256.) You can also specify a character in a multibyte string using 1042non-@acronym{ASCII} character as unibyte, and makes the string
1046the @samp{\u} or @samp{\U} Unicode escape syntax (@pxref{General 1043unibyte.
1047Escape Syntax}). In either case, any character which is not a valid 1044
1048hex digit terminates the construct. If the next character in the 1045 Instead of writing a character literally into a multibyte string,
1049string could be interpreted as a hex digit, write @w{@samp{\ }} 1046you can write it as its character code using an escape sequence.
1050(backslash and space) to terminate the hex escape---for example, 1047@xref{General Escape Syntax}, for details about escape sequences.
1048
1049 If you use any Unicode-style escape sequence @samp{\uNNNN} or
1050@samp{\U00NNNNNN} in a string constant (even for an @acronym{ASCII}
1051character), Emacs automatically assumes that it is multibyte.
1052
1053 You can also use hexadecimal escape sequences (@samp{\x@var{n}}) and
1054octal escape sequences (@samp{\@var{n}}) in string constants.
1055@strong{But beware:} If a string constant contains hexadecimal or
1056octal escape sequences, and these escape sequences all specify unibyte
1057characters (i.e.@: less than 256), and there are no other literal
1058non-@acronym{ASCII} characters or Unicode-style escape sequences in
1059the string, then Emacs automatically assumes that it is a unibyte
1060string. That is to say, it assumes that all non-@acronym{ASCII}
1061characters occurring in the string are 8-bit raw bytes.
1062
1063 In hexadecimal and octal escape sequences, the escaped character
1064code may contain a variable number of digits, so the first subsequent
1065character which is not a valid hexadecimal or octal digit terminates
1066the escape sequence. If the next character in a string could be
1067interpreted as a hexadecimal or octal digit, write @w{@samp{\ }}
1068(backslash and space) to terminate the escape sequence. For example,
1051@w{@samp{\xe0\ }} represents one character, @samp{a} with grave 1069@w{@samp{\xe0\ }} represents one character, @samp{a} with grave
1052accent. @w{@samp{\ }} in a string constant is just like 1070accent. @w{@samp{\ }} in a string constant is just like
1053backslash-newline; it does not contribute any character to the string, 1071backslash-newline; it does not contribute any character to the string,
1054but it does terminate the preceding hex escape. Using any hex escape 1072but it does terminate any preceding hex escape.
1055in a string (even for an @acronym{ASCII} character) automatically
1056forces the string to be multibyte.
1057
1058 You can represent a unibyte non-@acronym{ASCII} character with its
1059character code, which must be in the range from 128 (0200 octal) to
1060255 (0377 octal). If you write all such character codes in octal and
1061the string contains no other characters forcing it to be multibyte,
1062this produces a unibyte string.
1063 1073
1064@node Nonprinting Characters 1074@node Nonprinting Characters
1065@subsubsection Nonprinting Characters in Strings 1075@subsubsection Nonprinting Characters in Strings
diff --git a/doc/lispref/os.texi b/doc/lispref/os.texi
index 6c5f6e85683..2f06e207fc4 100644
--- a/doc/lispref/os.texi
+++ b/doc/lispref/os.texi
@@ -2276,13 +2276,19 @@ These arguments should consist of alternating keyword and value pairs.
2276The supported keywords and values are as follows: 2276The supported keywords and values are as follows:
2277 2277
2278@table @code 2278@table @code
2279@item :bus @var{bus}
2280The D-Bus bus. This argument is needed only if a bus other than
2281@code{:session} shall be used.
2282
2279@item :title @var{title} 2283@item :title @var{title}
2280The notification title. 2284The notification title.
2281 2285
2282@item :body @var{text} 2286@item :body @var{text}
2283The notification body text. Depending on the implementation of the 2287The notification body text. Depending on the implementation of the
2284notification server, the text could contain HTML markups, like 2288notification server, the text could contain HTML markups, like
2285@samp{"<b>bold text</b>"}, hyperlinks, or images. 2289@samp{"<b>bold text</b>"}, hyperlinks, or images. Special HTML
2290characters must be encoded, as @samp{"Contact
2291&lt;postmaster@@localhost&gt;!"}.
2286 2292
2287@item :app-name @var{name} 2293@item :app-name @var{name}
2288The name of the application sending the notification. The default is 2294The name of the application sending the notification. The default is
@@ -2317,7 +2323,10 @@ When this keyword is given, the @var{title} string of the actions is
2317interpreted as icon name. 2323interpreted as icon name.
2318 2324
2319@item :category @var{category} 2325@item :category @var{category}
2320The type of notification this is, a string. 2326The type of notification this is, a string. See the
2327@uref{http://developer.gnome.org/notification-spec/#categories,
2328Desktop Notifications Specification} for a list of standard
2329categories.
2321 2330
2322@item :desktop-entry @var{filename} 2331@item :desktop-entry @var{filename}
2323This specifies the name of the desktop filename representing the 2332This specifies the name of the desktop filename representing the
@@ -2420,13 +2429,17 @@ A message window opens on the desktop. Press "I agree"
2420@end example 2429@end example
2421@end defun 2430@end defun
2422 2431
2423@defun notifications-close-notification id 2432@defun notifications-close-notification id &optional bus
2424This function closes a notification with identifier @var{id}. 2433This function closes a notification with identifier @var{id}.
2434@var{bus} can be a string denoting a D-Bus connection, the default is
2435@code{:session}.
2425@end defun 2436@end defun
2426 2437
2427@defun notifications-get-capabilities 2438@defun notifications-get-capabilities &optional bus
2428Returns the capabilities of the notification server, a list of strings. 2439Returns the capabilities of the notification server, a list of
2429The following capabilities can be expected: 2440symbols. @var{bus} can be a string denoting a D-Bus connection, the
2441default is @code{:session}. The following capabilities can be
2442expected:
2430 2443
2431@table @code 2444@table @code
2432@item :actions 2445@item :actions
@@ -2463,6 +2476,30 @@ Further vendor-specific caps start with @code{:x-vendor}, like
2463@code{:x-gnome-foo-cap}. 2476@code{:x-gnome-foo-cap}.
2464@end defun 2477@end defun
2465 2478
2479@defun notifications-get-server-information &optional bus
2480Return information on the notification server, a list of strings.
2481@var{bus} can be a string denoting a D-Bus connection, the default is
2482@code{:session}. The returned list is @code{(@var{name} @var{vendor}
2483@var{version} @var{spec-version})}.
2484
2485@table @var
2486@item name
2487The product name of the server.
2488
2489@item vendor
2490The vendor name. For example, @samp{"KDE"}, @samp{"GNOME"}.
2491
2492@item version
2493The server's version number.
2494
2495@item spec-version
2496The specification version the server is compliant with.
2497@end table
2498
2499If @var{SPEC_VERSION} is @code{nil}, the server supports a
2500specification prior to @samp{"1.0"}.
2501@end defun
2502
2466 2503
2467@node Dynamic Libraries 2504@node Dynamic Libraries
2468@section Dynamically Loaded Libraries 2505@section Dynamically Loaded Libraries
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. 1313This 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 1317This stands for the text that matched the @var{n}th subexpression in
1318matched the @var{n}th subexpression in the original regexp. 1318the original regexp. Subexpressions are those expressions grouped
1319Subexpressions are those expressions grouped inside @samp{\(@dots{}\)}. 1319inside @samp{\(@dots{}\)}. If the @var{n}th subexpression never
1320If the @var{n}th subexpression never matched, an empty string is substituted. 1320matched, 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. 1324This stands for a single @samp{\} in the replacement text.
1325
1326@item @samp{\?}
1327This stands for itself (for compatibility with @code{replace-regexp}
1328and related commands; @pxref{Regexp Replacement,,, emacs, The GNU
1329Emacs Manual}).
1325@end table 1330@end table
1326 1331
1327These substitutions occur after case conversion, if any, 1332@noindent
1328so the strings they substitute are never case-converted. 1333Any other character following @samp{\} signals an error.
1334
1335The substitutions performed by @samp{\&} and @samp{\@var{n}} occur
1336after case conversion, if any. Therefore, the strings they substitute
1337are never case-converted.
1329 1338
1330If @var{subexp} is non-@code{nil}, that says to replace just 1339If @var{subexp} is non-@code{nil}, that says to replace just
1331subexpression number @var{subexp} of the regexp that was matched, not 1340subexpression number @var{subexp} of the regexp that was matched, not
diff --git a/doc/lispref/variables.texi b/doc/lispref/variables.texi
index 88b7909126e..dfde3c45c04 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
1266This macro creates a buffer-local binding in the current buffer for
1267@var{variable}, and gives it the buffer-local value @var{value}. It
1268is 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
1266This function marks @var{variable} (a symbol) automatically 1273This function marks @var{variable} (a symbol) automatically
1267buffer-local, so that any subsequent attempt to set it will make it 1274buffer-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
1308This macro defines @var{variable} as a variable with initial value
1309@var{value} and @var{docstring}, and marks it as automatically
1310buffer-local. It is equivalent to calling @code{defvar} followed by
1311@code{make-variable-buffer-local}. @var{variable} should be an
1312unquoted symbol.
1313@end defmac
1314
1300@defun local-variable-p variable &optional buffer 1315@defun local-variable-p variable &optional buffer
1301This returns @code{t} if @var{variable} is buffer-local in buffer 1316This 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
1958of arrays, properties of symbols, and many other locations are also 1972of arrays, properties of symbols, and many other locations are also
1959places where Lisp values are stored. 1973places where Lisp values are stored.
1960 1974
1961@c FIXME? Not sure this is a useful analogy...
1962Generalized variables are analogous to ``lvalues'' in the C 1975Generalized variables are analogous to ``lvalues'' in the C
1963language, where @samp{x = a[i]} gets an element from an array 1976language, where @samp{x = a[i]} gets an element from an array
1964and @samp{a[i] = x} stores an element using the same notation. 1977and @samp{a[i] = x} stores an element using the same notation.
1965Just as certain forms like @code{a[i]} can be lvalues in C, there 1978Just as certain forms like @code{a[i]} can be lvalues in C, there
1966is a set of forms that can be generalized variables in Lisp. 1979is 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
1968The @code{setf} macro is the most basic way to operate on generalized 1989The @code{setf} macro is the most basic way to operate on generalized
1969variables. The @code{setf} form is like @code{setq}, except that it 1990variables. The @code{setf} form is like @code{setq}, except that it
1970accepts arbitrary place forms on the left side rather than just 1991accepts 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.
1998A call to any of the following standard Lisp functions: 2019A call to any of the following standard Lisp functions:
1999 2020
2000@smallexample 2021@smallexample
2001car cdr nth nthcdr 2022aref cddr symbol-function
2002caar cadr cdar cddr 2023car elt symbol-plist
2003aref elt get gethash 2024caar get symbol-value
2004symbol-function symbol-value symbol-plist 2025cadr gethash
2026cdr nth
2027cdar nthcdr
2005@end smallexample 2028@end smallexample
2006 2029
2007@item 2030@item
2008The following Emacs-specific functions are also @code{setf}-able: 2031A call to any of the following Emacs-specific functions:
2009 2032
2010@smallexample 2033@smallexample
2011default-value process-get 2034default-value process-get
@@ -2022,8 +2045,8 @@ process-filter
2022@end itemize 2045@end itemize
2023 2046
2024@noindent 2047@noindent
2025Using 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. 2049does 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.
2029Note that for @code{nthcdr}, the list argument of the function must 2052Note that for @code{nthcdr}, the list argument of the function must
@@ -2049,3 +2072,85 @@ place can be used to insert or delete at any position in a list.
2049The @file{cl-lib} library defines various extensions for generalized 2072The @file{cl-lib} library defines various extensions for generalized
2050variables, including additional @code{setf} places. 2073variables, 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
2080This section describes how to define new forms that @code{setf} can
2081operate on.
2082
2083@defmac gv-define-simple-setter name setter &optional fix-return
2084This macro enables you to easily define @code{setf} methods for simple
2085cases. @var{name} is the name of a function, macro, or special form.
2086You can use this macro whenever @var{name} has a directly
2087corresponding @var{setter} function that updates it, e.g.,
2088@code{(gv-define-simple-setter car setcar)}.
2089
2090This macro translates a call of the form
2091
2092@example
2093(setf (@var{name} @var{args}@dots{}) @var{value})
2094@end example
2095
2096into
2097@example
2098(@var{setter} @var{args}@dots{} @var{value})
2099@end example
2100
2101@noindent
2102Such a @code{setf} call is documented to return @var{value}. This is
2103no problem with, e.g., @code{car} and @code{setcar}, because
2104@code{setcar} returns the value that it set. If your @var{setter}
2105function does not return @var{value}, use a non-@code{nil} value for
2106the @var{fix-return} argument of @code{gv-define-simple-setter}. This
2107expands into something equivalent to
2108@example
2109(let ((temp @var{value}))
2110 (@var{setter} @var{args}@dots{} temp)
2111 temp)
2112@end example
2113so ensuring that it returns the correct result.
2114@end defmac
2115
2116
2117@defmac gv-define-setter name arglist &rest body
2118This macro allows for more complex @code{setf} expansions than the
2119previous form. You may need to use this form, for example, if there
2120is no simple setter function to call, or if there is one but it
2121requires different arguments to the place form.
2122
2123This macro expands the form
2124@code{(setf (@var{name} @var{args}@dots{}) @var{value})} by
2125first binding the @code{setf} argument forms
2126@code{(@var{value} @var{args}@dots{})} according to @var{arglist},
2127and then executing @var{body}. @var{body} should return a Lisp
2128form that does the assignment, and finally returns the value that was
2129set. 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@findex gv-define-expander
2137@findex gv-letplace
2138@c FIXME? Not sure what or how much to say about these.
2139@c See cl.texi for an example of using gv-letplace.
2140For more control over the expansion, see the macro @code{gv-define-expander}.
2141The macro @code{gv-letplace} can be useful in defining macros that
2142perform similarly to @code{setf}; for example, the @code{incf} macro
2143of Common Lisp. Consult the source file @file{gv.el} for more details.
2144
2145@cindex CL note---no @code{setf} functions
2146@quotation
2147@b{Common Lisp note:} Common Lisp defines another way to specify the
2148@code{setf} behavior of a function, namely ``@code{setf} functions'',
2149whose names are lists @code{(setf @var{name})} rather than symbols.
2150For example, @code{(defun (setf foo) @dots{})} defines the function
2151that is used when @code{setf} is applied to @code{foo}. Emacs does
2152not support this. It is a compile-time error to use @code{setf} on a
2153form that has not already had an appropriate expansion defined. In
2154Common Lisp, this is not an error since the function @code{(setf
2155@var{func})} might be defined later.
2156@end quotation
diff --git a/doc/lispref/windows.texi b/doc/lispref/windows.texi
index d0e149eb165..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.
587The choice of which window edges this function alters depends on the 589The choice of which window edges this function alters depends on the
588values of the option @code{window-combination-resize} and the 590values of the option @code{window-combination-resize} and the
589combination limits of the involved windows; in some cases, it may alter 591combination limits of the involved windows; in some cases, it may alter
590both edges. @xref{Splitting Windows}. To resize by moving only the 592both edges. @xref{Recombining Windows}. To resize by moving only the
591bottom or right edge of a window, use the function 593bottom 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
795window @var{W3}. A new internal window @var{W1} is created, becoming 797window @var{W3}. A new internal window @var{W1} is created, becoming
796the new root window. 798the new root window.
797 799
798@defopt window-combination-resize 800 For interactive use, Emacs provides two commands which always split
799If this variable is @code{nil}, @code{split-window} can only split a 801the selected window. These call @code{split-window} internally.
800window (denoted by @var{window}) if @var{window}'s screen area is large
801enough to accommodate both itself and the new window.
802 802
803If this variable is @code{t}, @code{split-window} tries to resize all 803@deffn Command split-window-right &optional size
804windows that are part of the same combination as @var{window}, in order 804This function splits the selected window into two side-by-side
805to accommodate the new window. In particular, this may allow 805windows, 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 806positive, the left window gets @var{size} columns; if @var{size} is
807window or too small to ordinarily split. Furthermore, subsequently 807negative, the right window gets @minus{}@var{size} columns.
808resizing or deleting @var{window} may resize all other windows in its 808@end deffn
809combination.
810 809
811The default is @code{nil}. Other values are reserved for future use. 810@deffn Command split-window-below &optional size
812The value of this variable is ignored when 811This function splits the selected window into two windows, one above
813@code{window-combination-limit} is non-@code{nil} (see below). 812the other, leaving the upper window selected. If @var{size} is
813positive, the upper window gets @var{size} lines; if @var{size} is
814negative, the lower window gets @minus{}@var{size} lines.
815@end deffn
816
817@defopt split-window-keep-point
818If the value of this variable is non-@code{nil} (the default),
819@code{split-window-below} behaves as described above.
820
821If it is @code{nil}, @code{split-window-below} adjusts point in each
822of the two windows to minimize redisplay. (This is useful on slow
823terminals.) It selects whichever window contains the screen line that
824point was previously on. Note that this only affects
825@code{split-window-below}, not the lower-level @code{split-window}
826function.
814@end defopt 827@end defopt
815 828
816 To illustrate the effect of @code{window-combination-resize}, 829@node Deleting Windows
817consider 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
834the window is a live window, it disappears from the screen. If the
835window 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
838object, until there are no more references to it. Window deletion can
839be reversed, by restoring a saved window configuration (@pxref{Window
840Configurations}).
841
842@deffn Command delete-window &optional window
843This function removes @var{window} from display and returns
844@code{nil}. If @var{window} is omitted or @code{nil}, it defaults to
845the selected window. If deleting the window would leave no more
846windows in the window tree (e.g. if it is the only live window in the
847frame), an error is signaled.
848
849By default, the space taken up by @var{window} is given to one of its
850adjacent sibling windows, if any. However, if the variable
851@code{window-combination-resize} is non-@code{nil}, the space is
852proportionally distributed among any remaining windows in the window
853combination. @xref{Recombining Windows}.
854
855The behavior of this function may be altered by the window parameters
856of @var{window}, so long as the variable
857@code{ignore-window-parameters} is @code{nil}. If the value of
858the @code{delete-window} window parameter is @code{t}, this function
859ignores all other window parameters. Otherwise, if the value of the
860@code{delete-window} window parameter is a function, that function is
861called 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
868This function makes @var{window} fill its frame, by deleting other
869windows as necessary. If @var{window} is omitted or @code{nil}, it
870defaults to the selected window. The return value is @code{nil}.
871
872The behavior of this function may be altered by the window parameters
873of @var{window}, so long as the variable
874@code{ignore-window-parameters} is @code{nil}. If the value of
875the @code{delete-other-windows} window parameter is @code{t}, this
876function ignores all other window parameters. Otherwise, if the value
877of the @code{delete-other-windows} window parameter is a function,
878that function is called with the argument @var{window}, in lieu of the
879usual action of @code{delete-other-windows}. Otherwise, this function
880obeys the @code{window-atom} or @code{window-side} window parameter,
881if any. @xref{Window Parameters}.
882@end deffn
883
884@deffn Command delete-windows-on &optional buffer-or-name frame
885This function deletes all windows showing @var{buffer-or-name}, by
886calling @code{delete-window} on those windows. @var{buffer-or-name}
887should be a buffer, or the name of a buffer; if omitted or @code{nil},
888it defaults to the current buffer. If there are no windows showing
889the specified buffer, this function does nothing. If the specified
890buffer is a minibuffer, an error is signaled.
891
892If there is a dedicated window showing the buffer, and that window is
893the only one on its frame, this function also deletes that frame if it
894is not the only frame on the terminal.
895
896The optional argument @var{frame} specifies which frames to operate
897on:
898
899@itemize @bullet
900@item @code{nil}
901means operate on all frames.
902@item @code{t}
903means operate on the selected frame.
904@item @code{visible}
905means operate on all visible frames.
906@item @code{0}
907means operate on all visible or iconified frames.
908@item A frame
909means operate on that frame.
910@end itemize
911
912Note that this argument does not have the same meaning as in other
913functions which scan all live windows (@pxref{Cyclic Window
914Ordering}). Specifically, the meanings of @code{t} and @code{nil} here
915are the opposite of what they are in those other functions.
916@end deffn
917
918
919@node Recombining Windows
920@section Recombining Windows
921
922When deleting the last sibling of a window @code{W}, its parent window
923is deleted too, with @code{W} replacing it in the window tree. This
924means that @code{W} must be recombined with its parent's siblings to
925form a new window combination (@pxref{Windows and Frames}). In some
926occasions, deleting a live window may even entail the deletion of two
927internal 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
949Deleting @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
952combination 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
956was used to preserve a combination embedded in a combination of the same
957type. Such embeddings make sense to assure that when you split a window
958and subsequently delete the new window, Emacs reestablishes the layout
959of 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
840If @code{window-combination-resize} is @code{nil}, splitting window 985Split @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
864If @code{window-combination-resize} is @code{t}, splitting @code{W3} 1008Now, when enlarging a window vertically, Emacs tries to obtain the
865instead leaves all three live windows with approximately the same 1009corresponding space from its lower sibling, provided such a window
866height: 1010exists. 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
1034Deleting @code{W4} will now give its entire space to @code{W2},
1035including 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
1058This can be counterintutive, in particular if @code{W4} were used for
1059displaying a buffer only temporarily (@pxref{Temporary Displays}), and
1060you want to continue working with the initial layout.
1061
1062The 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
889If the value of this variable is @code{t}, the @code{split-window} 1066This variable controls whether splitting a window shall make a new
890function always creates a new internal window. If the value is 1067parent 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
1071This means that the new live window is allowed to share the existing
892parent window, if one exists, provided the split occurs in the same 1072parent window, if one exists, provided the split occurs in the same
893direction as the existing window combination (otherwise, a new 1073direction as the existing window combination (otherwise, a new internal
894internal window is created anyway). The default is @code{nil}. Other 1074window is created anyway).
895values are reserved for future use. 1075
896 1076@item window-size
897Thus, if the value of this variable is at all times @code{t}, then at 1077In this case @code{display-buffer} makes a new parent window if it is
898all times every window tree is a binary tree (a tree where each window 1078passed a @code{window-height} or @code{window-width} entry in the
899except the root window has exactly one sibling). 1079@var{alist} argument (@pxref{Display Action Functions}).
900 1080
901Furthermore, @code{split-window} calls 1081@item temp-buffer
902@code{set-window-combination-limit} on the newly-created internal 1082This value causes the creation of a new parent window when a window is
903window, recording the current value of this variable. This affects 1083split for showing a temporary buffer (@pxref{Temporary Displays}) only.
904how the window tree is rearranged when the child windows are deleted 1084
905(see below). 1085@item display-buffer
1086This means that when @code{display-buffer} (@pxref{Choosing Window})
1087splits a window it always makes a new parent window.
1088
1089@item t
1090In this case a new parent window is always created when splitting a
1091window. Thus, if the value of this variable is at all times @code{t},
1092then at all times every window tree is a binary tree (a tree where each
1093window except the root window has exactly one sibling).
1094@end table
1095
1096The default is @code{nil}. Other values are reserved for future use.
1097
1098If, as a consequence of this variable's setting, @code{split-window}
1099makes a new parent window, it also calls
1100@code{set-window-combination-limit} (see below) on the newly-created
1101internal window. This affects how the window tree is rearranged when
1102the 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
1106the 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
1129A 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
1131sibling of @code{W4}, so enlarging @code{W4} will try to shrink
1132@code{W2}, leaving @code{W3} unaffected. Observe that @code{W5}
1133represents a vertical combination of two windows embedded in the
1134vertical 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
910This functions sets the @dfn{combination limit} of the window 1138This functions sets the @dfn{combination limit} of the window
@@ -912,25 +1140,52 @@ This functions sets the @dfn{combination limit} of the window
912function @code{window-combination-limit}. See below for its effects; 1140function @code{window-combination-limit}. See below for its effects;
913note that it is only meaningful for internal windows. The 1141note 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
915the value of the variable @code{window-combination-limit} as 1143it @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
920This function returns the combination limit for @var{window}. 1148This function returns the combination limit for @var{window}.
921 1149
922The combination limit is meaningful only for an internal window. If 1150The combination limit is meaningful only for an internal window. If it
923it is @code{nil}, then Emacs is allowed to automatically delete 1151is @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
925child windows of @var{window} with its sibling windows to form a new 1153child windows of @var{window} with its sibling windows to form a new
926window combination. If the combination limit is @code{t}, the child 1154window combination. If the combination limit is @code{t}, the child
927windows of @var{window} are never automatically re-combined with its 1155windows of @var{window} are never automatically recombined with its
928siblings. 1156siblings.
1157
1158If, in the configuration shown at the beginning of this section, the
1159combination 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}, 1164Alternatively, the problems sketched above can be avoided by always
932consider the following configuration (throughout this example, we will 1165resizing all windows in the same combination whenever one of its windows
933assume that @code{window-combination-resize} is @code{nil}): 1166is split or deleted. This also permits to split windows that would be
1167otherwise too small for such an operation.
1168
1169@defopt window-combination-resize
1170If this variable is @code{nil}, @code{split-window} can only split a
1171window (denoted by @var{window}) if @var{window}'s screen area is large
1172enough to accommodate both itself and the new window.
1173
1174If this variable is @code{t}, @code{split-window} tries to resize all
1175windows that are part of the same combination as @var{window}, in order
1176to accommodate the new window. In particular, this may allow
1177@code{split-window} to succeed even if @var{window} is a fixed-size
1178window or too small to ordinarily split. Furthermore, subsequently
1179resizing or deleting @var{window} may resize all other windows in its
1180combination.
1181
1182The default is @code{nil}. Other values are reserved for future use.
1183The 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
1188the 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
956If @code{window-combination-limit} is @code{nil}, splitting @code{W2} 1211If @code{window-combination-resize} is @code{nil}, splitting window
957into 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
980The newly-created window, @code{W4}, shares the same internal window 1235If @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 1236instead leaves all three live windows with approximately the same
982live window, @code{W3}. 1237height:
983
984 If @code{window-combination-limit} is @code{t}, splitting @code{W2}
985in 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
1008A new internal window @code{W5} has been created; its children are 1260Deleting 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 1261distribute its space proportionally among the two remaining live
1010only sibling of @code{W4}, so resizing @code{W4} will resize 1262windows.
1011@code{W2}, leaving @code{W3} unaffected.
1012 1263
1013 For interactive use, Emacs provides two commands which always split
1014the selected window. These call @code{split-window} internally.
1015
1016@deffn Command split-window-right &optional size
1017This function splits the selected window into two side-by-side
1018windows, putting the selected window on the left. If @var{size} is
1019positive, the left window gets @var{size} columns; if @var{size} is
1020negative, the right window gets @minus{}@var{size} columns.
1021@end deffn
1022
1023@deffn Command split-window-below &optional size
1024This function splits the selected window into two windows, one above
1025the other, leaving the upper window selected. If @var{size} is
1026positive, the upper window gets @var{size} lines; if @var{size} is
1027negative, the lower window gets @minus{}@var{size} lines.
1028@end deffn
1029
1030@defopt split-window-keep-point
1031If the value of this variable is non-@code{nil} (the default),
1032@code{split-window-below} behaves as described above.
1033
1034If it is @code{nil}, @code{split-window-below} adjusts point in each
1035of the two windows to minimize redisplay. (This is useful on slow
1036terminals.) It selects whichever window contains the screen line that
1037point was previously on. Note that this only affects
1038@code{split-window-below}, not the lower-level @code{split-window}
1039function.
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
1047the window is a live window, it disappears from the screen. If the
1048window 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
1051object, until there are no more references to it. Window deletion can
1052be reversed, by restoring a saved window configuration (@pxref{Window
1053Configurations}).
1054
1055@deffn Command delete-window &optional window
1056This function removes @var{window} from display and returns
1057@code{nil}. If @var{window} is omitted or @code{nil}, it defaults to
1058the selected window. If deleting the window would leave no more
1059windows in the window tree (e.g. if it is the only live window in the
1060frame), an error is signaled.
1061
1062By default, the space taken up by @var{window} is given to one of its
1063adjacent sibling windows, if any. However, if the variable
1064@code{window-combination-resize} is non-@code{nil}, the space is
1065proportionally distributed among any remaining windows in the window
1066combination. @xref{Splitting Windows}.
1067
1068The behavior of this function may be altered by the window parameters
1069of @var{window}, so long as the variable
1070@code{ignore-window-parameters} is @code{nil}. If the value of
1071the @code{delete-window} window parameter is @code{t}, this function
1072ignores all other window parameters. Otherwise, if the value of the
1073@code{delete-window} window parameter is a function, that function is
1074called 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
1081This function makes @var{window} fill its frame, by deleting other
1082windows as necessary. If @var{window} is omitted or @code{nil}, it
1083defaults to the selected window. The return value is @code{nil}.
1084
1085The behavior of this function may be altered by the window parameters
1086of @var{window}, so long as the variable
1087@code{ignore-window-parameters} is @code{nil}. If the value of
1088the @code{delete-other-windows} window parameter is @code{t}, this
1089function ignores all other window parameters. Otherwise, if the value
1090of the @code{delete-other-windows} window parameter is a function,
1091that function is called with the argument @var{window}, in lieu of the
1092usual action of @code{delete-other-windows}. Otherwise, this function
1093obeys the @code{window-atom} or @code{window-side} window parameter,
1094if any. @xref{Window Parameters}.
1095@end deffn
1096
1097@deffn Command delete-windows-on &optional buffer-or-name frame
1098This function deletes all windows showing @var{buffer-or-name}, by
1099calling @code{delete-window} on those windows. @var{buffer-or-name}
1100should be a buffer, or the name of a buffer; if omitted or @code{nil},
1101it defaults to the current buffer. If there are no windows showing
1102the specified buffer, this function does nothing. If the specified
1103buffer is a minibuffer, an error is signaled.
1104
1105If there is a dedicated window showing the buffer, and that window is
1106the only one on its frame, this function also deletes that frame if it
1107is not the only frame on the terminal.
1108
1109The optional argument @var{frame} specifies which frames to operate
1110on:
1111
1112@itemize @bullet
1113@item @code{nil}
1114means operate on all frames.
1115@item @code{t}
1116means operate on the selected frame.
1117@item @code{visible}
1118means operate on all visible frames.
1119@item @code{0}
1120means operate on all visible or iconified frames.
1121@item A frame
1122means operate on that frame.
1123@end itemize
1124
1125Note that this argument does not have the same meaning as in other
1126functions which scan all live windows (@pxref{Cyclic Window
1127Ordering}). Specifically, the meanings of @code{t} and @code{nil} here
1128are 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
@@ -1550,6 +1684,26 @@ normally tries to display the buffer in some other window, by invoking
1550instead. 1684instead.
1551@end deffn 1685@end deffn
1552 1686
1687By default, @code{switch-to-buffer} sets @code{window-point} of the
1688window used to the buffer's position of @code{point}. This behavior can
1689be tuned using the following option.
1690
1691@defopt switch-to-buffer-preserve-window-point
1692If this variable is @code{nil}, @code{switch-to-buffer} displays the
1693buffer specified by @var{buffer-or-name} at the position of that
1694buffer's @code{point}. If this variable is @code{already-displayed}, it
1695tries to display the buffer at its previous position in the selected
1696window, provided the buffer is currently displayed in some other window
1697on any visible or iconified frame. If this variable is @code{t},
1698@code{switch-to-buffer} unconditionally tries to display the buffer at
1699its previous position in the selected window.
1700
1701This variable is ignored if the buffer is already displayed in the
1702selected window or never appeared in it before, or if
1703@code{switch-to-buffer} calls @code{pop-to-buffer} to display the
1704buffer.
1705@end defopt
1706
1553The next two functions are similar to @code{switch-to-buffer}, except 1707The next two functions are similar to @code{switch-to-buffer}, except
1554for the described features. 1708for the described features.
1555 1709
@@ -1775,9 +1929,51 @@ It actually performs the split by calling the function specified in
1775@code{split-window-preferred-function} (@pxref{Choosing Window 1929@code{split-window-preferred-function} (@pxref{Choosing Window
1776Options}). 1930Options}).
1777 1931
1778It can fail if no window splitting can be performed for some reason 1932The size of the new window can be adjusted by supplying
1779(e.g. if there is just one frame and it has an @code{unsplittable} 1933@code{window-height} and @code{window-width} entries in @var{alist}. To
1780frame parameter; @pxref{Buffer Parameters}). 1934adjust the window's height, use an entry whose @sc{car} is
1935@code{window-height} and whose @sc{cdr} is one of:
1936
1937@itemize @bullet
1938@item
1939@code{nil} means to leave the height of the new window alone.
1940
1941@item
1942A number specifies the desired height of the new window. An integer
1943number specifies the number of lines of the window. A floating point
1944number gives the fraction of the window's height with respect to the
1945height of the frame's root window.
1946
1947@item
1948If the @sc{cdr} specifies a function, that function is called with one
1949argument - the new window. The function is supposed to adjust the
1950height of the window; its return value is ignored. Suitable functions
1951are @code{shrink-window-if-larger-than-buffer} and
1952@code{fit-window-to-buffer}, see @ref{Resizing Windows}.
1953@end itemize
1954
1955To adjust the window's width, use an entry whose @sc{car} is
1956@code{window-width} and whose @sc{cdr} is one of:
1957
1958@itemize @bullet
1959@item
1960@code{nil} means to leave the width of the new window alone.
1961
1962@item
1963A number specifies the desired width of the new window. An integer
1964number specifies the number of columns of the window. A floating point
1965number gives the fraction of the window's width with respect to the
1966width of the frame's root window.
1967
1968@item
1969If the @sc{cdr} specifies a function, that function is called with one
1970argument - the new window. The function is supposed to adjust the width
1971of the window; its return value is ignored.
1972@end itemize
1973
1974This function can fail if no window splitting can be performed for some
1975reason (e.g. if there is just one frame and it has an
1976@code{unsplittable} frame parameter; @pxref{Buffer Parameters}).
1781@end defun 1977@end defun
1782 1978
1783@defun display-buffer-use-some-window buffer alist 1979@defun display-buffer-use-some-window buffer alist
@@ -1786,6 +1982,26 @@ window and displaying the buffer in that window. It can fail if all
1786windows are dedicated to another buffer (@pxref{Dedicated Windows}). 1982windows are dedicated to another buffer (@pxref{Dedicated Windows}).
1787@end defun 1983@end defun
1788 1984
1985@defun display-buffer-below-selected buffer alist
1986This function tries to display @var{buffer} in a window below the
1987selected window. This means to either split the selected window or
1988reuse the window below the selected one.
1989@end defun
1990
1991@defun display-buffer-in-previous-window buffer alist
1992This function tries to display @var{buffer} in a window previously
1993showing it. If @var{alist} has a non-@code{nil}
1994@code{inhibit-same-window} entry, the selected window is not eligible
1995for reuse. If @var{alist} contains a @code{reusable-frames} entry, its
1996value determines which frames to search for a suitable window as with
1997@code{display-buffer-reuse-window}.
1998
1999If @var{alist} has a @code{previous-window} entry, the window
2000specified by that entry will override any other window found by the
2001methods above, even if that window never showed @var{buffer} before.
2002@end defun
2003
2004
1789@node Choosing Window Options 2005@node Choosing Window Options
1790@section Additional Options for Displaying Buffers 2006@section Additional Options for Displaying Buffers
1791 2007
@@ -2086,45 +2302,77 @@ function @code{switch-to-prev-buffer} (@pxref{Window History}).
2086Finally, you might want to either bury (@pxref{The Buffer List}) or kill 2302Finally, you might want to either bury (@pxref{The Buffer List}) or kill
2087(@pxref{Killing Buffers}) the window's buffer. 2303(@pxref{Killing Buffers}) the window's buffer.
2088 2304
2089 The following function uses information on how the window for 2305 The following command uses information on how the window for
2090displaying the buffer was obtained in the first place, thus attempting to 2306displaying the buffer was obtained in the first place, thus attempting
2091automate the above decisions for you. 2307to automate the above decisions for you.
2092 2308
2093@deffn Command quit-window &optional kill window 2309@deffn Command quit-window &optional kill window
2094This command quits @var{window} and buries its buffer. The argument 2310This command quits @var{window} and buries its buffer. The argument
2095@var{window} must be a live window and defaults to the selected one. 2311@var{window} must be a live window and defaults to the selected one.
2096With prefix argument @var{kill} non-@code{nil}, it kills the buffer 2312With prefix argument @var{kill} non-@code{nil}, it kills the buffer
2097instead of burying it. 2313instead of burying it. It calls the function @code{quit-restore-window}
2098 2314described next to deal with the window and its buffer.
2099Quitting @var{window} means to proceed as follows: If @var{window} was
2100created specially for displaying its current buffer, delete @var{window}
2101provided its frame contains at least one other live window. If
2102@var{window} is the only window on its frame and there are other frames
2103on the frame's terminal, the value of @var{kill} determines how to
2104proceed with the window. If @var{kill} is @code{nil}, the fate of the
2105frame is determined by calling @code{frame-auto-hide-function} (see
2106below) with that frame as sole argument. If @var{kill} is
2107non-@code{nil}, the frame is deleted unconditionally.
2108
2109If @var{window} was reused for displaying its buffer, this command tries
2110to display the buffer previously shown in it. It also tries to restore
2111the window start (@pxref{Window Start and End}) and point (@pxref{Window
2112Point}) positions of the previously shown buffer. If, in addition, the
2113current buffer was temporarily resized, this command will also try to
2114restore the original height of @var{window}.
2115
2116The three cases described so far require that the buffer shown in
2117@var{window} is still the buffer displayed by the last buffer display
2118function for this window. If another buffer has been shown in the
2119meantime, or the buffer previously shown no longer exists, this command
2120calls @code{switch-to-prev-buffer} (@pxref{Window History}) to show some
2121other buffer instead.
2122@end deffn 2315@end deffn
2123 2316
2124The function @code{quit-window} bases its decisions on information 2317@defun quit-restore-window &optional window bury-or-kill
2125stored in @var{window}'s @code{quit-restore} window parameter 2318This function tries to restore the state of @var{window} that existed
2126(@pxref{Window Parameters}), and resets that parameter to @code{nil} 2319before its buffer was displayed in it. The optional argument
2127after it's done. 2320@var{window} must be a live window and defaults to the selected one.
2321
2322If @var{window} was created specially for displaying its buffer, this
2323function deletes @var{window} provided its frame contains at least one
2324other live window. If @var{window} is the only window on its frame and
2325there are other frames on the frame's terminal, the value of the
2326optional argument @var{bury-or-kill} determines how to proceed with the
2327window. If @var{bury-or-kill} equals @code{kill}, the frame is deleted
2328unconditionally. Otherwise, the fate of the frame is determined by
2329calling @code{frame-auto-hide-function} (see below) with that frame as
2330sole argument.
2331
2332Otherwise, this function tries to redisplay the buffer previously shown
2333in @var{window}. It also tries to restore the window start
2334(@pxref{Window Start and End}) and point (@pxref{Window Point})
2335positions of the previously shown buffer. If, in addition,
2336@var{window}'s buffer was temporarily resized, this function will also
2337try to restore the original height of @var{window}.
2338
2339The cases described so far require that the buffer shown in @var{window}
2340is still the buffer displayed by the last buffer display function for
2341this window. If another buffer has been shown in the meantime, or the
2342buffer previously shown no longer exists, this function calls
2343@code{switch-to-prev-buffer} (@pxref{Window History}) to show some other
2344buffer instead.
2345
2346The optional argument @var{bury-or-kill} specifes how to deal with
2347@var{window}'s buffer. The following values are handled:
2348
2349@table @code
2350@item nil
2351This means to not deal with the buffer in any particular way. As a
2352consequence, if @var{window} is not deleted, invoking
2353@code{switch-to-prev-buffer} will usually show the buffer again.
2354
2355@item append
2356This means that if @var{window} is not deleted, its buffer is moved to
2357the end of @var{window}'s list of previous buffers, so it's less likely
2358that a future invocation of @code{switch-to-prev-buffer} will switch to
2359it. Also, it moves the buffer to the end of the frame's buffer list.
2360
2361@item bury
2362This means that if @var{window} is not deleted, its buffer is removed
2363from @var{window}'s list of previous buffers. Also, it moves the buffer
2364to the end of the frame's buffer list. This value provides the most
2365reliable remedy to not have @code{switch-to-prev-buffer} switch to this
2366buffer again without killing the buffer.
2367
2368@item kill
2369This means to kill @var{window}'s buffer.
2370@end table
2371
2372@code{quit-restore-window} bases its decisions on information stored in
2373@var{window}'s @code{quit-restore} window parameter (@pxref{Window
2374Parameters}), and resets that parameter to @code{nil} after it's done.
2375@end defun
2128 2376
2129The following option specifies how to deal with a frame containing just 2377The following option specifies how to deal with a frame containing just
2130one window that should be either quit, or whose buffer should be buried. 2378one window that should be either quit, or whose buffer should be buried.
@@ -2135,10 +2383,9 @@ frames. This function is called with one argument---a frame.
2135 2383
2136The function specified here is called by @code{bury-buffer} (@pxref{The 2384The function specified here is called by @code{bury-buffer} (@pxref{The
2137Buffer List}) when the selected window is dedicated and shows the buffer 2385Buffer List}) when the selected window is dedicated and shows the buffer
2138that should be buried. It is also called by @code{quit-window} (see 2386to bury. It is also called by @code{quit-restore-window} (see above)
2139above) when the frame of the window that should be quit has been 2387when the frame of the window to quit has been specially created for
2140specially created for displaying that window's buffer and the buffer 2388displaying that window's buffer and the buffer is not killed.
2141should be buried.
2142 2389
2143The default is to call @code{iconify-frame} (@pxref{Visibility of 2390The default is to call @code{iconify-frame} (@pxref{Visibility of
2144Frames}). Alternatively, you may specify either @code{delete-frame} 2391Frames}). Alternatively, you may specify either @code{delete-frame}
@@ -2146,9 +2393,9 @@ Frames}). Alternatively, you may specify either @code{delete-frame}
2146@code{ignore} to leave the frame unchanged, or any other function that 2393@code{ignore} to leave the frame unchanged, or any other function that
2147can take a frame as its sole argument. 2394can take a frame as its sole argument.
2148 2395
2149Note that the function specified by this option is called if and only if 2396Note that the function specified by this option is called only if the
2150there is at least one other frame on the terminal of the frame it's 2397specified frame contains just one live window and there is at least one
2151supposed to handle, and that frame contains only one live window. 2398other frame on the same terminal.
2152@end defopt 2399@end defopt
2153 2400
2154 2401
@@ -3123,8 +3370,8 @@ frame into the root window of that very frame only).
3123 3370
3124@defun window-state-get &optional window writable 3371@defun window-state-get &optional window writable
3125This function returns the state of @var{window} as a Lisp object. The 3372This function returns the state of @var{window} as a Lisp object. The
3126argument @var{window} can be any window and defaults to the root window 3373argument @var{window} must be a valid window and defaults to the root
3127of the selected frame. 3374window of the selected frame.
3128 3375
3129If the optional argument @var{writable} is non-@code{nil}, this means to 3376If the optional argument @var{writable} is non-@code{nil}, this means to
3130not use markers for sampling positions like @code{window-point} or 3377not use markers for sampling positions like @code{window-point} or
@@ -3267,10 +3514,28 @@ from. It is installed by @code{window-state-get} (@pxref{Window
3267Configurations}). 3514Configurations}).
3268 3515
3269@item @code{quit-restore} 3516@item @code{quit-restore}
3270This parameter specifies what to do with a window when the buffer it 3517This parameter is installed by the buffer display functions
3271shows is not needed any more. It is installed by the buffer display 3518(@pxref{Choosing Window}) and consulted by @code{quit-restore-window}
3272functions (@pxref{Choosing Window}), and consulted by the function 3519(@pxref{Quitting Windows}). It contains four elements:
3273@code{quit-window} (@pxref{Quitting Windows}). 3520
3521The first element is one of the symbols @code{window} - meaning that the
3522window has been specially created by @code{display-buffer}, @code{frame}
3523- a separate frame has been created, @code{same} - the window has
3524displayed the same buffer before, or @code{other} - the window showed
3525another buffer before.
3526
3527The second element is either one of the symbols @code{window} or
3528@code{frame}, or a list whose elements are the buffer shown in the
3529window before, that buffer's window start and window point positions,
3530and the window's height at that time.
3531
3532The third element is the window selected at the time the parameter was
3533created. The function @code{quit-restore-window} tries to reselect that
3534window when it deletes the window passed to it as argument.
3535
3536The fourth element is the buffer whose display caused the creation of
3537this parameter. @code{quit-restore-window} deletes the specified window
3538only if it still shows that buffer.
3274@end table 3539@end table
3275 3540
3276There are additional parameters @code{window-atom} and @code{window-side}; 3541There are additional parameters @code{window-atom} and @code{window-side};
diff --git a/doc/misc/ChangeLog b/doc/misc/ChangeLog
index d719a02e32e..7322613e0db 100644
--- a/doc/misc/ChangeLog
+++ b/doc/misc/ChangeLog
@@ -1,3 +1,68 @@
12012-11-13 Glenn Morris <rgm@gnu.org>
2
3 * flymake.texi (Customizable variables)
4 (Highlighting erroneous lines): Mention flymake-error-bitmap,
5 flymake-warning-bitmap, and flymake-fringe-indicator-position.
6
72012-11-12 Vincent Belaïche <vincentb1@users.sourceforge.net>
8
9 * ses.texi: Doc for ses-rename-cell, ses-repair-cell-reference-all & ses-range.
10 In all file place SES into @acronym{...}.
11 (Advanced Features): Add key index and function index for
12 ses-set-header-row. Add description for function
13 ses-rename-cell. Add description for function
14 ses-repair-cell-reference-all.
15 (Ranges in formulas): Add description for ses-range flags.
16
172012-11-12 Paul Eggert <eggert@cs.ucla.edu>
18
19 * texinfo.tex: Merge from gnulib.
20
212012-11-10 Chong Yidong <cyd@gnu.org>
22
23 * url.texi (Introduction): Move url-configuration-directory to
24 Customization node.
25 (Parsed URIs): Split into its own node.
26 (URI Encoding): New node.
27 (Defining New URLs): Remove empty chapter.
28 (Retrieving URLs): Add an introduction. Doc fix for url-retrieve.
29 Improve docs for url-queue-*.
30 (Supported URL Types): Copyedits. Delete empty subnodes.
31
32 * url.texi (Introduction): Rename from Getting Started. Rewrite
33 the introduction.
34 (URI Parsing): Rewrite. Omit the obsolete attributes slot.
35
362012-11-10 Glenn Morris <rgm@gnu.org>
37
38 * cl.texi (Obsolete Setf Customization):
39 Revert defsetf example to the more correct let rather than prog1.
40 Give define-modify-macro, defsetf, and define-setf-method
41 gv.el replacements.
42
43 * cl.texi (Overview): Mention EIEIO here, as well as the appendix.
44 (Setf Extensions): Remove obsolete reference.
45 (Obsolete Setf Customization):
46 Move note on lack of setf functions to lispref/variables.texi.
47 Undocument get-setf-method, since it no longer exists.
48 Mention simple defsetf replaced by gv-define-simple-setter.
49
502012-11-03 Glenn Morris <rgm@gnu.org>
51
52 * cl.texi: Further general copyedits.
53 (List Functions): Remove copy-tree, standard elisp for some time.
54 (Efficiency Concerns): Comment out examples that no longer apply.
55 (Compiler Optimizations): Rename from "Optimizing Compiler"; reword.
56 (Creating Symbols, Random Numbers): De-emphasize internal
57 variables cl--gensym-counter and cl--random-state. (Bug#12788)
58 (Naming Conventions, Type Predicates, Macros)
59 (Predicates on Numbers): No longer mention cl-floatp-safe.
60
612012-11-02 Katsumi Yamaoka <yamaoka@jpl.org>
62
63 * gnus.texi (Mail Source Specifiers):
64 Document :leave keyword used for pop mail source.
65
12012-11-01 Glenn Morris <rgm@gnu.org> 662012-11-01 Glenn Morris <rgm@gnu.org>
2 67
3 * cl.texi: General copyedits for style, line-breaks, etc. 68 * cl.texi: General copyedits for style, line-breaks, etc.
diff --git a/doc/misc/cl.texi b/doc/misc/cl.texi
index 4a728049ce8..a50be1027f3 100644
--- a/doc/misc/cl.texi
+++ b/doc/misc/cl.texi
@@ -107,7 +107,8 @@ for various reasons:
107@item 107@item
108Some features are too complex or bulky relative to their benefit 108Some features are too complex or bulky relative to their benefit
109to Emacs Lisp programmers. CLOS and Common Lisp streams are fine 109to Emacs Lisp programmers. CLOS and Common Lisp streams are fine
110examples of this group. 110examples of this group. (The separate package EIEIO implements
111a subset of CLOS functionality. @xref{Top, , Introduction, eieio, EIEIO}.)
111 112
112@item 113@item
113Other features cannot be implemented without modification to the 114Other features cannot be implemented without modification to the
@@ -229,7 +230,7 @@ by @code{cl--}. Here is a complete list of functions prefixed by
229 230
230@example 231@example
231cl-callf cl-callf2 cl-defsubst 232cl-callf cl-callf2 cl-defsubst
232cl-floatp-safe cl-letf cl-letf* 233cl-letf cl-letf*
233@end example 234@end example
234 235
235@c This is not uninteresting I suppose, but is of zero practical relevance 236@c This is not uninteresting I suppose, but is of zero practical relevance
@@ -239,13 +240,13 @@ they do not cause other components like @file{cl-extra} to be loaded.
239 240
240@example 241@example
241cl-evenp cl-oddp cl-minusp 242cl-evenp cl-oddp cl-minusp
242cl-plusp cl-floatp-safe cl-endp 243cl-plusp cl-endp cl-subst
243cl-copy-list cl-list* cl-ldiff 244cl-copy-list cl-list* cl-ldiff
244cl-rest cl-decf [1] cl-incf [1] 245cl-rest cl-decf [1] cl-incf [1]
245cl-acons cl-adjoin [2] cl-pairlis 246cl-acons cl-adjoin [2] cl-pairlis
246cl-pushnew [1,2] cl-declaim cl-proclaim 247cl-pushnew [1,2] cl-declaim cl-proclaim
247cl-caaar@dots{}cl-cddddr cl-first@dots{}cl-tenth 248cl-caaar@dots{}cl-cddddr cl-first@dots{}cl-tenth
248cl-subst cl-mapcar [3] 249cl-mapcar [3]
249@end example 250@end example
250 251
251@noindent 252@noindent
@@ -300,7 +301,8 @@ calls to it may be expanded into in-line code by the byte compiler.
300This is analogous to the @code{defsubst} form; 301This is analogous to the @code{defsubst} form;
301@code{cl-defsubst} uses a different method (compiler macros) which 302@code{cl-defsubst} uses a different method (compiler macros) which
302works in all versions of Emacs, and also generates somewhat more 303works in all versions of Emacs, and also generates somewhat more
303@c Really? 304@c For some examples,
305@c see http://lists.gnu.org/archive/html/emacs-devel/2012-11/msg00009.html
304efficient inline expansions. In particular, @code{cl-defsubst} 306efficient inline expansions. In particular, @code{cl-defsubst}
305arranges for the processing of keyword arguments, default values, 307arranges for the processing of keyword arguments, default values,
306etc., to be done at compile-time whenever possible. 308etc., to be done at compile-time whenever possible.
@@ -702,11 +704,13 @@ The type symbol @code{real} is a synonym for @code{number}, and
702The type symbols @code{character} and @code{string-char} match 704The type symbols @code{character} and @code{string-char} match
703integers in the range from 0 to 255. 705integers in the range from 0 to 255.
704 706
707@c No longer relevant, so covered by first item above (float -> floatp).
708@ignore
705@item 709@item
706The type symbol @code{float} uses the @code{cl-floatp-safe} predicate 710The type symbol @code{float} uses the @code{cl-floatp-safe} predicate
707defined by this package rather than @code{floatp}, so it will work 711defined by this package rather than @code{floatp}, so it will work
708@c FIXME are any such platforms still relevant?
709correctly even in Emacs versions without floating-point support. 712correctly even in Emacs versions without floating-point support.
713@end ignore
710 714
711@item 715@item
712The type list @code{(integer @var{low} @var{high})} represents all 716The type list @code{(integer @var{low} @var{high})} represents all
@@ -833,7 +837,7 @@ constructs.
833* Conditionals:: @code{cl-case}, @code{cl-typecase}. 837* Conditionals:: @code{cl-case}, @code{cl-typecase}.
834* Blocks and Exits:: @code{cl-block}, @code{cl-return}, @code{cl-return-from}. 838* Blocks and Exits:: @code{cl-block}, @code{cl-return}, @code{cl-return-from}.
835* Iteration:: @code{cl-do}, @code{cl-dotimes}, @code{cl-dolist}, @code{cl-do-symbols}. 839* Iteration:: @code{cl-do}, @code{cl-dotimes}, @code{cl-dolist}, @code{cl-do-symbols}.
836* Loop Facility:: The Common Lisp @code{cl-loop} macro. 840* Loop Facility:: The Common Lisp @code{loop} macro.
837* Multiple Values:: @code{cl-values}, @code{cl-multiple-value-bind}, etc. 841* Multiple Values:: @code{cl-values}, @code{cl-multiple-value-bind}, etc.
838@end menu 842@end menu
839 843
@@ -971,7 +975,7 @@ a
971The generalized variable @code{buffer-substring}, listed above, 975The generalized variable @code{buffer-substring}, listed above,
972also works in this way by replacing a portion of the current buffer. 976also works in this way by replacing a portion of the current buffer.
973 977
974@c FIXME? Also `eq'? (see cl-lib.el) 978@c FIXME? Also `eq'? (see cl-lib.el)
975 979
976@c Currently commented out in cl.el. 980@c Currently commented out in cl.el.
977@ignore 981@ignore
@@ -986,13 +990,10 @@ only interesting when used with places you define yourself with
986@xref{Obsolete Setf Customization}. 990@xref{Obsolete Setf Customization}.
987@end ignore 991@end ignore
988 992
993@c FIXME? Is this still true?
989@item 994@item
990A macro call, in which case the macro is expanded and @code{setf} 995A macro call, in which case the macro is expanded and @code{setf}
991is applied to the resulting form. 996is applied to the resulting form.
992
993@item
994Any form for which a @code{defsetf} or @code{define-setf-method}
995has been made. @xref{Obsolete Setf Customization}.
996@end itemize 997@end itemize
997 998
998@c FIXME should this be in lispref? It seems self-evident. 999@c FIXME should this be in lispref? It seems self-evident.
@@ -1521,7 +1522,7 @@ Common Lisp @dfn{blocks} provide a non-local exit mechanism very
1521similar to @code{catch} and @code{throw}, with lexical scoping. 1522similar to @code{catch} and @code{throw}, with lexical scoping.
1522This package actually implements @code{cl-block} 1523This package actually implements @code{cl-block}
1523in terms of @code{catch}; however, the lexical scoping allows the 1524in terms of @code{catch}; however, the lexical scoping allows the
1524optimizing byte-compiler to omit the costly @code{catch} step if the 1525byte-compiler to omit the costly @code{catch} step if the
1525body of the block does not actually @code{cl-return-from} the block. 1526body of the block does not actually @code{cl-return-from} the block.
1526 1527
1527@defmac cl-block name forms@dots{} 1528@defmac cl-block name forms@dots{}
@@ -1558,7 +1559,7 @@ just as in Common Lisp.
1558Because they are implemented in terms of Emacs Lisp's @code{catch} 1559Because they are implemented in terms of Emacs Lisp's @code{catch}
1559and @code{throw}, blocks have the same overhead as actual 1560and @code{throw}, blocks have the same overhead as actual
1560@code{catch} constructs (roughly two function calls). However, 1561@code{catch} constructs (roughly two function calls). However,
1561the optimizing byte compiler will optimize away the @code{catch} 1562the byte compiler will optimize away the @code{catch}
1562if the block does 1563if the block does
1563not in fact contain any @code{cl-return} or @code{cl-return-from} calls 1564not in fact contain any @code{cl-return} or @code{cl-return-from} calls
1564that jump to it. This means that @code{cl-do} loops and @code{cl-defun} 1565that jump to it. This means that @code{cl-do} loops and @code{cl-defun}
@@ -1723,18 +1724,18 @@ iterating over vectors or lists.
1723@section Loop Facility 1724@section Loop Facility
1724 1725
1725@noindent 1726@noindent
1726A common complaint with Lisp's traditional looping constructs is 1727A common complaint with Lisp's traditional looping constructs was
1727that they are either too simple and limited, such as Common Lisp's 1728that they were either too simple and limited, such as @code{dotimes}
1728@code{dotimes} or Emacs Lisp's @code{while}, or too unreadable and 1729or @code{while}, or too unreadable and obscure, like Common Lisp's
1729obscure, like Common Lisp's @code{do} loop. 1730@code{do} loop.
1730 1731
1731To remedy this, recent versions of Common Lisp have added a new 1732To remedy this, Common Lisp added a construct called the ``Loop
1732construct called the ``Loop Facility'' or ``@code{loop} macro'', 1733Facility'' or ``@code{loop} macro'', with an easy-to-use but very
1733with an easy-to-use but very powerful and expressive syntax. 1734powerful and expressive syntax.
1734 1735
1735@menu 1736@menu
1736* Loop Basics:: @code{cl-loop} macro, basic clause structure. 1737* Loop Basics:: The @code{cl-loop} macro, basic clause structure.
1737* Loop Examples:: Working examples of @code{cl-loop} macro. 1738* Loop Examples:: Working examples of the @code{cl-loop} macro.
1738* For Clauses:: Clauses introduced by @code{for} or @code{as}. 1739* For Clauses:: Clauses introduced by @code{for} or @code{as}.
1739* Iteration Clauses:: @code{repeat}, @code{while}, @code{thereis}, etc. 1740* Iteration Clauses:: @code{repeat}, @code{while}, @code{thereis}, etc.
1740* Accumulation Clauses:: @code{collect}, @code{sum}, @code{maximize}, etc. 1741* Accumulation Clauses:: @code{collect}, @code{sum}, @code{maximize}, etc.
@@ -1767,9 +1768,9 @@ Common Lisp specifies a certain general order of clauses in a
1767loop: 1768loop:
1768 1769
1769@example 1770@example
1770(cl-loop @var{name-clause} 1771(loop @var{name-clause}
1771 @var{var-clauses}@dots{} 1772 @var{var-clauses}@dots{}
1772 @var{action-clauses}@dots{}) 1773 @var{action-clauses}@dots{})
1773@end example 1774@end example
1774 1775
1775The @var{name-clause} optionally gives a name to the implicit 1776The @var{name-clause} optionally gives a name to the implicit
@@ -1795,10 +1796,10 @@ also use regular Lisp @code{cl-return} or @code{cl-return-from} to
1795break out of the loop.) 1796break out of the loop.)
1796@end defmac 1797@end defmac
1797 1798
1798The following sections give some examples of the Loop Macro in 1799The following sections give some examples of the loop macro in
1799action, and describe the particular loop clauses in great detail. 1800action, and describe the particular loop clauses in great detail.
1800Consult the second edition of Steele for additional discussion 1801Consult the second edition of Steele for additional discussion
1801and examples of the @code{loop} macro. 1802and examples.
1802 1803
1803@node Loop Examples 1804@node Loop Examples
1804@subsection Loop Examples 1805@subsection Loop Examples
@@ -2162,8 +2163,9 @@ that was just set by the previous clause; in the second loop,
2162based on the value of @code{x} left over from the previous time 2163based on the value of @code{x} left over from the previous time
2163through the loop. 2164through the loop.
2164 2165
2165Another feature of the @code{cl-loop} macro is @dfn{destructuring}, 2166Another feature of the @code{cl-loop} macro is @emph{destructuring},
2166similar in concept to the destructuring provided by @code{defmacro}. 2167similar in concept to the destructuring provided by @code{defmacro}
2168(@pxref{Argument Lists}).
2167The @var{var} part of any @code{for} clause can be given as a list 2169The @var{var} part of any @code{for} clause can be given as a list
2168of variables instead of a single variable. The values produced 2170of variables instead of a single variable. The values produced
2169during loop execution must be lists; the values in the lists are 2171during loop execution must be lists; the values in the lists are
@@ -2375,7 +2377,7 @@ by the name @code{it} in the ``then'' part. For example:
2375(setq funny-numbers '(6 13 -1)) 2377(setq funny-numbers '(6 13 -1))
2376 @result{} (6 13 -1) 2378 @result{} (6 13 -1)
2377(cl-loop for x below 10 2379(cl-loop for x below 10
2378 if (oddp x) 2380 if (cl-oddp x)
2379 collect x into odds 2381 collect x into odds
2380 and if (memq x funny-numbers) return (cdr it) end 2382 and if (memq x funny-numbers) return (cdr it) end
2381 else 2383 else
@@ -2441,15 +2443,14 @@ loop. Many of the examples in this section illustrate the use of
2441 2443
2442@item return @var{form} 2444@item return @var{form}
2443This clause causes the loop to return immediately. The following 2445This clause causes the loop to return immediately. The following
2444Lisp form is evaluated to give the return value of the @code{loop} 2446Lisp form is evaluated to give the return value of the loop
2445form. The @code{finally} clauses, if any, are not executed. 2447form. The @code{finally} clauses, if any, are not executed.
2446Of course, @code{return} is generally used inside an @code{if} or 2448Of course, @code{return} is generally used inside an @code{if} or
2447@code{unless}, as its use in a top-level loop clause would mean 2449@code{unless}, as its use in a top-level loop clause would mean
2448the loop would never get to ``loop'' more than once. 2450the loop would never get to ``loop'' more than once.
2449 2451
2450The clause @samp{return @var{form}} is equivalent to 2452The clause @samp{return @var{form}} is equivalent to
2451@c FIXME cl-do, cl-return? 2453@samp{do (cl-return @var{form})} (or @code{cl-return-from} if the loop
2452@samp{do (return @var{form})} (or @code{return-from} if the loop
2453was named). The @code{return} clause is implemented a bit more 2454was named). The @code{return} clause is implemented a bit more
2454efficiently, though. 2455efficiently, though.
2455@end table 2456@end table
@@ -2463,7 +2464,7 @@ clause, respectively. Consult the source code in file
2463 2464
2464This package's @code{cl-loop} macro is compatible with that of Common 2465This package's @code{cl-loop} macro is compatible with that of Common
2465Lisp, except that a few features are not implemented: @code{loop-finish} 2466Lisp, except that a few features are not implemented: @code{loop-finish}
2466and data-type specifiers. Naturally, the @code{for} clauses which 2467and data-type specifiers. Naturally, the @code{for} clauses that
2467iterate over keymaps, overlays, intervals, frames, windows, and 2468iterate over keymaps, overlays, intervals, frames, windows, and
2468buffers are Emacs-specific extensions. 2469buffers are Emacs-specific extensions.
2469 2470
@@ -2516,17 +2517,17 @@ Destructuring is made available to the user by way of the
2516following macro: 2517following macro:
2517 2518
2518@defmac cl-destructuring-bind arglist expr forms@dots{} 2519@defmac cl-destructuring-bind arglist expr forms@dots{}
2519This macro expands to code which executes @var{forms}, with 2520This macro expands to code that executes @var{forms}, with
2520the variables in @var{arglist} bound to the list of values 2521the variables in @var{arglist} bound to the list of values
2521returned by @var{expr}. The @var{arglist} can include all 2522returned by @var{expr}. The @var{arglist} can include all
2522the features allowed for @code{defmacro} argument lists, 2523the features allowed for @code{cl-defmacro} argument lists,
2523including destructuring. (The @code{&environment} keyword 2524including destructuring. (The @code{&environment} keyword
2524is not allowed.) The macro expansion will signal an error 2525is not allowed.) The macro expansion will signal an error
2525if @var{expr} returns a list of the wrong number of arguments 2526if @var{expr} returns a list of the wrong number of arguments
2526or with incorrect keyword arguments. 2527or with incorrect keyword arguments.
2527@end defmac 2528@end defmac
2528 2529
2529This package also includes the Common Lisp @code{cl-define-compiler-macro} 2530This package also includes the Common Lisp @code{define-compiler-macro}
2530facility, which allows you to define compile-time expansions and 2531facility, which allows you to define compile-time expansions and
2531optimizations for your functions. 2532optimizations for your functions.
2532 2533
@@ -2551,7 +2552,7 @@ appears as a standard part of this package:
2551(cl-define-compiler-macro cl-member (&whole form a list &rest keys) 2552(cl-define-compiler-macro cl-member (&whole form a list &rest keys)
2552 (if (and (null keys) 2553 (if (and (null keys)
2553 (eq (car-safe a) 'quote) 2554 (eq (car-safe a) 'quote)
2554 (not (floatp-safe (cadr a)))) 2555 (not (floatp (cadr a))))
2555 (list 'memq a list) 2556 (list 'memq a list)
2556 form)) 2557 form))
2557@end example 2558@end example
@@ -2589,16 +2590,19 @@ mechanism that allows you to give the compiler special hints
2589about the types of data that will be stored in particular variables, 2590about the types of data that will be stored in particular variables,
2590and about the ways those variables and functions will be used. This 2591and about the ways those variables and functions will be used. This
2591package defines versions of all the Common Lisp declaration forms: 2592package defines versions of all the Common Lisp declaration forms:
2592@code{cl-declare}, @code{cl-locally}, @code{cl-proclaim}, @code{cl-declaim}, 2593@code{declare}, @code{locally}, @code{proclaim}, @code{declaim},
2593and @code{cl-the}. 2594and @code{the}.
2594 2595
2595Most of the Common Lisp declarations are not currently useful in 2596Most of the Common Lisp declarations are not currently useful in Emacs
2596Emacs Lisp, as the byte-code system provides little opportunity 2597Lisp. For example, the byte-code system provides little
2597to benefit from type information, and @code{special} declarations 2598opportunity to benefit from type information.
2598are redundant in a fully dynamically-scoped Lisp. A few 2599@ignore
2599declarations are meaningful when the optimizing byte 2600and @code{special} declarations are redundant in a fully
2600compiler is being used, however. Under the earlier non-optimizing 2601dynamically-scoped Lisp.
2601compiler, these declarations will effectively be ignored. 2602@end ignore
2603A few declarations are meaningful when byte compiler optimizations
2604are enabled, as they are by the default. Otherwise these
2605declarations will effectively be ignored.
2602 2606
2603@defun cl-proclaim decl-spec 2607@defun cl-proclaim decl-spec
2604This function records a ``global'' declaration specified by 2608This function records a ``global'' declaration specified by
@@ -2609,7 +2613,7 @@ is evaluated and thus should normally be quoted.
2609@defmac cl-declaim decl-specs@dots{} 2613@defmac cl-declaim decl-specs@dots{}
2610This macro is like @code{cl-proclaim}, except that it takes any number 2614This macro is like @code{cl-proclaim}, except that it takes any number
2611of @var{decl-spec} arguments, and the arguments are unevaluated and 2615of @var{decl-spec} arguments, and the arguments are unevaluated and
2612unquoted. The @code{cl-declaim} macro also puts an @code{(cl-eval-when 2616unquoted. The @code{cl-declaim} macro also puts @code{(cl-eval-when
2613(compile load eval) @dots{})} around the declarations so that they will 2617(compile load eval) @dots{})} around the declarations so that they will
2614be registered at compile-time as well as at run-time. (This is vital, 2618be registered at compile-time as well as at run-time. (This is vital,
2615since normally the declarations are meant to influence the way the 2619since normally the declarations are meant to influence the way the
@@ -2632,9 +2636,9 @@ In this package, @code{cl-locally} is no different from @code{progn}.
2632 2636
2633@defmac cl-the type form 2637@defmac cl-the type form
2634Type information provided by @code{cl-the} is ignored in this package; 2638Type information provided by @code{cl-the} is ignored in this package;
2635in other words, @code{(cl-the @var{type} @var{form})} is equivalent 2639in other words, @code{(cl-the @var{type} @var{form})} is equivalent to
2636to @var{form}. Future versions of the optimizing byte-compiler may 2640@var{form}. Future byte-compiler optimizations may make use of this
2637make use of this information. 2641information.
2638 2642
2639For example, @code{mapcar} can map over both lists and arrays. It is 2643For example, @code{mapcar} can map over both lists and arrays. It is
2640hard for the compiler to expand @code{mapcar} into an in-line loop 2644hard for the compiler to expand @code{mapcar} into an in-line loop
@@ -2655,35 +2659,31 @@ such as @code{type} and @code{ftype}, are silently ignored.
2655 2659
2656@table @code 2660@table @code
2657@item special 2661@item special
2662@c FIXME ?
2658Since all variables in Emacs Lisp are ``special'' (in the Common 2663Since all variables in Emacs Lisp are ``special'' (in the Common
2659Lisp sense), @code{special} declarations are only advisory. They 2664Lisp sense), @code{special} declarations are only advisory. They
2660simply tell the optimizing byte compiler that the specified 2665simply tell the byte compiler that the specified
2661variables are intentionally being referred to without being 2666variables are intentionally being referred to without being
2662bound in the body of the function. The compiler normally emits 2667bound in the body of the function. The compiler normally emits
2663warnings for such references, since they could be typographical 2668warnings for such references, since they could be typographical
2664errors for references to local variables. 2669errors for references to local variables.
2665 2670
2666The declaration @code{(cl-declare (special @var{var1} @var{var2}))} is 2671The declaration @code{(cl-declare (special @var{var1} @var{var2}))} is
2667equivalent to @code{(defvar @var{var1}) (defvar @var{var2})} in the 2672equivalent to @code{(defvar @var{var1}) (defvar @var{var2})}.
2668optimizing compiler, or to nothing at all in older compilers (which
2669do not warn for non-local references).
2670 2673
2671In top-level contexts, it is generally better to write 2674In top-level contexts, it is generally better to write
2672@code{(defvar @var{var})} than @code{(cl-declaim (special @var{var}))}, 2675@code{(defvar @var{var})} than @code{(cl-declaim (special @var{var}))},
2673since @code{defvar} makes your intentions clearer. But the older 2676since @code{defvar} makes your intentions clearer.
2674byte compilers can not handle @code{defvar}s appearing inside of
2675functions, while @code{(cl-declare (special @var{var}))} takes care
2676to work correctly with all compilers.
2677 2677
2678@item inline 2678@item inline
2679The @code{inline} @var{decl-spec} lists one or more functions 2679The @code{inline} @var{decl-spec} lists one or more functions
2680whose bodies should be expanded ``in-line'' into calling functions 2680whose bodies should be expanded ``in-line'' into calling functions
2681whenever the compiler is able to arrange for it. For example, 2681whenever the compiler is able to arrange for it. For example,
2682the Common Lisp function @code{cadr} is declared @code{inline} 2682the function @code{cl-acons} is declared @code{inline}
2683by this package so that the form @code{(cadr @var{x})} will 2683by this package so that the form @code{(cl-acons @var{key} @var{value}
2684expand directly into @code{(car (cdr @var{x}))} when it is called 2684@var{alist})} will
2685in user functions, for a savings of one (relatively expensive) 2685expand directly into @code{(cons (cons @var{key} @var{value}) @var{alist})}
2686function call. 2686when it is called in user functions, so as to save function calls.
2687 2687
2688The following declarations are all equivalent. Note that the 2688The following declarations are all equivalent. Note that the
2689@code{defsubst} form is a convenient way to define a function 2689@code{defsubst} form is a convenient way to define a function
@@ -2702,7 +2702,7 @@ request that a function you have defined should be inlined,
2702but it is impolite to use it to request inlining of an external 2702but it is impolite to use it to request inlining of an external
2703function. 2703function.
2704 2704
2705In Common Lisp, it is possible to use @code{(cl-declare (inline @dots{}))} 2705In Common Lisp, it is possible to use @code{(declare (inline @dots{}))}
2706before a particular call to a function to cause just that call to 2706before a particular call to a function to cause just that call to
2707be inlined; the current byte compilers provide no way to implement 2707be inlined; the current byte compilers provide no way to implement
2708this, so @code{(cl-declare (inline @dots{}))} is currently ignored by 2708this, so @code{(cl-declare (inline @dots{}))} is currently ignored by
@@ -2715,8 +2715,7 @@ declaration.
2715 2715
2716@item optimize 2716@item optimize
2717This declaration controls how much optimization is performed by 2717This declaration controls how much optimization is performed by
2718the compiler. Naturally, it is ignored by the earlier non-optimizing 2718the compiler.
2719compilers.
2720 2719
2721The word @code{optimize} is followed by any number of lists like 2720The word @code{optimize} is followed by any number of lists like
2722@code{(speed 3)} or @code{(safety 2)}. Common Lisp defines several 2721@code{(speed 3)} or @code{(safety 2)}. Common Lisp defines several
@@ -2725,8 +2724,7 @@ and @code{safety}. The value of a quality should be an integer from
27250 to 3, with 0 meaning ``unimportant'' and 3 meaning ``very important''. 27240 to 3, with 0 meaning ``unimportant'' and 3 meaning ``very important''.
2726The default level for both qualities is 1. 2725The default level for both qualities is 1.
2727 2726
2728In this package, with the optimizing compiler, the 2727In this package, the @code{speed} quality is tied to the @code{byte-optimize}
2729@code{speed} quality is tied to the @code{byte-optimize}
2730flag, which is set to @code{nil} for @code{(speed 0)} and to 2728flag, which is set to @code{nil} for @code{(speed 0)} and to
2731@code{t} for higher settings; and the @code{safety} quality is 2729@code{t} for higher settings; and the @code{safety} quality is
2732tied to the @code{byte-compile-delete-errors} flag, which is 2730tied to the @code{byte-compile-delete-errors} flag, which is
@@ -2745,22 +2743,22 @@ just because of an error in a fully-optimized Lisp program.
2745 2743
2746The @code{optimize} declaration is normally used in a top-level 2744The @code{optimize} declaration is normally used in a top-level
2747@code{cl-proclaim} or @code{cl-declaim} in a file; Common Lisp allows 2745@code{cl-proclaim} or @code{cl-declaim} in a file; Common Lisp allows
2748it to be used with @code{cl-declare} to set the level of optimization 2746it to be used with @code{declare} to set the level of optimization
2749locally for a given form, but this will not work correctly with the 2747locally for a given form, but this will not work correctly with the
2750current version of the optimizing compiler. (The @code{cl-declare} 2748current byte-compiler. (The @code{cl-declare}
2751will set the new optimization level, but that level will not 2749will set the new optimization level, but that level will not
2752automatically be unset after the enclosing form is done.) 2750automatically be unset after the enclosing form is done.)
2753 2751
2754@item warn 2752@item warn
2755This declaration controls what sorts of warnings are generated 2753This declaration controls what sorts of warnings are generated
2756by the byte compiler. Again, only the optimizing compiler 2754by the byte compiler. The word @code{warn} is followed by any
2757generates warnings. The word @code{warn} is followed by any
2758number of ``warning qualities'', similar in form to optimization 2755number of ``warning qualities'', similar in form to optimization
2759qualities. The currently supported warning types are 2756qualities. The currently supported warning types are
2760@code{redefine}, @code{callargs}, @code{unresolved}, and 2757@code{redefine}, @code{callargs}, @code{unresolved}, and
2761@code{free-vars}; in the current system, a value of 0 will 2758@code{free-vars}; in the current system, a value of 0 will
2762disable these warnings and any higher value will enable them. 2759disable these warnings and any higher value will enable them.
2763See the documentation for the optimizing byte compiler for details. 2760See the documentation of the variable @code{byte-compile-warnings}
2761for more details.
2764@end table 2762@end table
2765 2763
2766@node Symbols 2764@node Symbols
@@ -2873,19 +2871,17 @@ string is used as a prefix instead of @samp{G}. Uninterned symbols
2873are used in macro expansions for temporary variables, to ensure that 2871are used in macro expansions for temporary variables, to ensure that
2874their names will not conflict with ``real'' variables in the user's 2872their names will not conflict with ``real'' variables in the user's
2875code. 2873code.
2876@end defun
2877 2874
2878@defvar cl--gensym-counter 2875(Internally, the variable @code{cl--gensym-counter} holds the counter
2879This variable holds the counter used to generate @code{cl-gensym} names. 2876used to generate names. It is incremented after each use. In Common
2880It is incremented after each use by @code{cl-gensym}. In Common Lisp 2877Lisp this is initialized with 0, but this package initializes it with
2881this is initialized with 0, but this package initializes it with a 2878a random time-dependent value to avoid trouble when two files that
2882random (time-dependent) value to avoid trouble when two files that
2883each used @code{cl-gensym} in their compilation are loaded together. 2879each used @code{cl-gensym} in their compilation are loaded together.
2884(Uninterned symbols become interned when the compiler writes them 2880Uninterned symbols become interned when the compiler writes them out
2885out to a file and the Emacs loader loads them, so their names have to 2881to a file and the Emacs loader loads them, so their names have to be
2886be treated a bit more carefully than in Common Lisp where uninterned 2882treated a bit more carefully than in Common Lisp where uninterned
2887symbols remain uninterned after loading.) 2883symbols remain uninterned after loading.)
2888@end defvar 2884@end defun
2889 2885
2890@defun cl-gentemp &optional x 2886@defun cl-gentemp &optional x
2891This function is like @code{cl-gensym}, except that it produces a new 2887This function is like @code{cl-gensym}, except that it produces a new
@@ -2905,13 +2901,13 @@ provided.
2905 2901
2906@noindent 2902@noindent
2907This section defines a few simple Common Lisp operations on numbers 2903This section defines a few simple Common Lisp operations on numbers
2908which were left out of Emacs Lisp. 2904that were left out of Emacs Lisp.
2909 2905
2910@menu 2906@menu
2911* Predicates on Numbers:: @code{cl-plusp}, @code{cl-oddp}, @code{cl-floatp-safe}, etc. 2907* Predicates on Numbers:: @code{cl-plusp}, @code{cl-oddp}, etc.
2912* Numerical Functions:: @code{abs}, @code{cl-floor}, etc. 2908* Numerical Functions:: @code{cl-floor}, @code{cl-ceiling}, etc.
2913* Random Numbers:: @code{cl-random}, @code{cl-make-random-state}. 2909* Random Numbers:: @code{cl-random}, @code{cl-make-random-state}.
2914* Implementation Parameters:: @code{cl-most-positive-float}. 2910* Implementation Parameters:: @code{cl-most-positive-float}, etc.
2915@end menu 2911@end menu
2916 2912
2917@node Predicates on Numbers 2913@node Predicates on Numbers
@@ -2941,11 +2937,13 @@ This predicate tests whether @var{integer} is even. It is an
2941error if the argument is not an integer. 2937error if the argument is not an integer.
2942@end defun 2938@end defun
2943 2939
2940@ignore
2944@defun cl-floatp-safe object 2941@defun cl-floatp-safe object
2945This predicate tests whether @var{object} is a floating-point 2942This predicate tests whether @var{object} is a floating-point
2946number. On systems that support floating-point, this is equivalent 2943number. On systems that support floating-point, this is equivalent
2947to @code{floatp}. On other systems, this always returns @code{nil}. 2944to @code{floatp}. On other systems, this always returns @code{nil}.
2948@end defun 2945@end defun
2946@end ignore
2949 2947
2950@node Numerical Functions 2948@node Numerical Functions
2951@section Numerical Functions 2949@section Numerical Functions
@@ -3036,6 +3034,7 @@ of @code{cl-truncate}.
3036This package also provides an implementation of the Common Lisp 3034This package also provides an implementation of the Common Lisp
3037random number generator. It uses its own additive-congruential 3035random number generator. It uses its own additive-congruential
3038algorithm, which is much more likely to give statistically clean 3036algorithm, which is much more likely to give statistically clean
3037@c FIXME? Still true?
3039random numbers than the simple generators supplied by many 3038random numbers than the simple generators supplied by many
3040operating systems. 3039operating systems.
3041 3040
@@ -3043,22 +3042,16 @@ operating systems.
3043This function returns a random nonnegative number less than 3042This function returns a random nonnegative number less than
3044@var{number}, and of the same type (either integer or floating-point). 3043@var{number}, and of the same type (either integer or floating-point).
3045The @var{state} argument should be a @code{random-state} object 3044The @var{state} argument should be a @code{random-state} object
3046which holds the state of the random number generator. The 3045that holds the state of the random number generator. The
3047function modifies this state object as a side effect. If 3046function modifies this state object as a side effect. If
3048@var{state} is omitted, it defaults to the variable 3047@var{state} is omitted, it defaults to the internal variable
3049@code{cl--random-state}, which contains a pre-initialized 3048@code{cl--random-state}, which contains a pre-initialized
3050@code{random-state} object. 3049default @code{random-state} object. (Since any number of programs in
3050the Emacs process may be accessing @code{cl--random-state} in
3051interleaved fashion, the sequence generated from this will be
3052irreproducible for all intents and purposes.)
3051@end defun 3053@end defun
3052 3054
3053@defvar cl--random-state
3054This variable contains the system ``default'' @code{random-state}
3055object, used for calls to @code{cl-random} that do not specify an
3056alternative state object. Since any number of programs in the
3057Emacs process may be accessing @code{cl--random-state} in interleaved
3058fashion, the sequence generated from this variable will be
3059irreproducible for all intents and purposes.
3060@end defvar
3061
3062@defun cl-make-random-state &optional state 3055@defun cl-make-random-state &optional state
3063This function creates or copies a @code{random-state} object. 3056This function creates or copies a @code{random-state} object.
3064If @var{state} is omitted or @code{nil}, it returns a new copy of 3057If @var{state} is omitted or @code{nil}, it returns a new copy of
@@ -3094,10 +3087,10 @@ This predicate returns @code{t} if @var{object} is a
3094@section Implementation Parameters 3087@section Implementation Parameters
3095 3088
3096@noindent 3089@noindent
3097This package defines several useful constants having to with numbers. 3090This package defines several useful constants having to do with
3091floating-point numbers.
3098 3092
3099The following parameters have to do with floating-point numbers. 3093It determines their values by exercising the computer's
3100This package determines their values by exercising the computer's
3101floating-point arithmetic in various ways. Because this operation 3094floating-point arithmetic in various ways. Because this operation
3102might be slow, the code for initializing them is kept in a separate 3095might be slow, the code for initializing them is kept in a separate
3103function that must be called before the parameters can be used. 3096function that must be called before the parameters can be used.
@@ -3105,12 +3098,13 @@ function that must be called before the parameters can be used.
3105@defun cl-float-limits 3098@defun cl-float-limits
3106This function makes sure that the Common Lisp floating-point parameters 3099This function makes sure that the Common Lisp floating-point parameters
3107like @code{cl-most-positive-float} have been initialized. Until it is 3100like @code{cl-most-positive-float} have been initialized. Until it is
3108called, these parameters will be @code{nil}. If this version of Emacs 3101called, these parameters will be @code{nil}.
3109does not support floats, the parameters will remain @code{nil}. If the 3102@c If this version of Emacs does not support floats, the parameters will
3110parameters have already been initialized, the function returns 3103@c remain @code{nil}.
3104If the parameters have already been initialized, the function returns
3111immediately. 3105immediately.
3112 3106
3113The algorithm makes assumptions that will be valid for most modern 3107The algorithm makes assumptions that will be valid for almost all
3114machines, but will fail if the machine's arithmetic is extremely 3108machines, but will fail if the machine's arithmetic is extremely
3115unusual, e.g., decimal. 3109unusual, e.g., decimal.
3116@end defun 3110@end defun
@@ -3130,7 +3124,7 @@ is approximately @code{1.79e+308}.
3130@end defvar 3124@end defvar
3131 3125
3132@defvar cl-most-negative-float 3126@defvar cl-most-negative-float
3133This constant equals the most-negative value a Lisp float can hold. 3127This constant equals the most negative value a Lisp float can hold.
3134(It is assumed to be equal to @code{(- cl-most-positive-float)}.) 3128(It is assumed to be equal to @code{(- cl-most-positive-float)}.)
3135@end defvar 3129@end defvar
3136 3130
@@ -3199,7 +3193,7 @@ may appear in any order.
3199The @code{:key} argument should be passed either @code{nil}, or a 3193The @code{:key} argument should be passed either @code{nil}, or a
3200function of one argument. This key function is used as a filter 3194function of one argument. This key function is used as a filter
3201through which the elements of the sequence are seen; for example, 3195through which the elements of the sequence are seen; for example,
3202@code{(cl-find x y :key 'car)} is similar to @code{(cl-assoc x y)}: 3196@code{(cl-find x y :key 'car)} is similar to @code{(cl-assoc x y)}.
3203It searches for an element of the list whose @sc{car} equals 3197It searches for an element of the list whose @sc{car} equals
3204@code{x}, rather than for an element which equals @code{x} itself. 3198@code{x}, rather than for an element which equals @code{x} itself.
3205If @code{:key} is omitted or @code{nil}, the filter is effectively 3199If @code{:key} is omitted or @code{nil}, the filter is effectively
@@ -3217,7 +3211,7 @@ true (non-@code{nil}) to indicate a match; instead, you may use
3217@code{:test-not} to give a function which returns @emph{false} to 3211@code{:test-not} to give a function which returns @emph{false} to
3218indicate a match. The default test function is @code{eql}. 3212indicate a match. The default test function is @code{eql}.
3219 3213
3220Many functions which take @var{item} and @code{:test} or @code{:test-not} 3214Many functions that take @var{item} and @code{:test} or @code{:test-not}
3221arguments also come in @code{-if} and @code{-if-not} varieties, 3215arguments also come in @code{-if} and @code{-if-not} varieties,
3222where a @var{predicate} function is passed instead of @var{item}, 3216where a @var{predicate} function is passed instead of @var{item},
3223and sequence elements match if the predicate returns true on them 3217and sequence elements match if the predicate returns true on them
@@ -3231,7 +3225,7 @@ and sequence elements match if the predicate returns true on them
3231to remove all zeros from sequence @code{seq}. 3225to remove all zeros from sequence @code{seq}.
3232 3226
3233Some operations can work on a subsequence of the argument sequence; 3227Some operations can work on a subsequence of the argument sequence;
3234these function take @code{:start} and @code{:end} arguments which 3228these function take @code{:start} and @code{:end} arguments, which
3235default to zero and the length of the sequence, respectively. 3229default to zero and the length of the sequence, respectively.
3236Only elements between @var{start} (inclusive) and @var{end} 3230Only elements between @var{start} (inclusive) and @var{end}
3237(exclusive) are affected by the operation. The @var{end} argument 3231(exclusive) are affected by the operation. The @var{end} argument
@@ -3339,7 +3333,7 @@ the return values using @code{nconc}.
3339@defun cl-some predicate seq &rest more-seqs 3333@defun cl-some predicate seq &rest more-seqs
3340This function calls @var{predicate} on each element of @var{seq} 3334This function calls @var{predicate} on each element of @var{seq}
3341in turn; if @var{predicate} returns a non-@code{nil} value, 3335in turn; if @var{predicate} returns a non-@code{nil} value,
3342@code{some} returns that value, otherwise it returns @code{nil}. 3336@code{cl-some} returns that value, otherwise it returns @code{nil}.
3343Given several sequence arguments, it steps through the sequences 3337Given several sequence arguments, it steps through the sequences
3344in parallel until the shortest one runs out, just as in 3338in parallel until the shortest one runs out, just as in
3345@code{cl-mapcar}. You can rely on the left-to-right order in which 3339@code{cl-mapcar}. You can rely on the left-to-right order in which
@@ -3388,7 +3382,7 @@ of left-associative:
3388 @equiv{} (- 1 (- 2 (- 3 4))) @result{} -2 3382 @equiv{} (- 1 (- 2 (- 3 4))) @result{} -2
3389@end example 3383@end example
3390 3384
3391If @code{:key} is specified, it is a function of one argument which 3385If @code{:key} is specified, it is a function of one argument, which
3392is called on each of the sequence elements in turn. 3386is called on each of the sequence elements in turn.
3393 3387
3394If @code{:initial-value} is specified, it is effectively added to the 3388If @code{:initial-value} is specified, it is effectively added to the
@@ -3457,7 +3451,7 @@ of data copied is simply the shorter of the source and destination
3457If @var{seq1} and @var{seq2} are @code{eq}, then the replacement 3451If @var{seq1} and @var{seq2} are @code{eq}, then the replacement
3458will work correctly even if the regions indicated by the start 3452will work correctly even if the regions indicated by the start
3459and end arguments overlap. However, if @var{seq1} and @var{seq2} 3453and end arguments overlap. However, if @var{seq1} and @var{seq2}
3460are lists which share storage but are not @code{eq}, and the 3454are lists that share storage but are not @code{eq}, and the
3461start and end arguments specify overlapping regions, the effect 3455start and end arguments specify overlapping regions, the effect
3462is undefined. 3456is undefined.
3463@end defun 3457@end defun
@@ -3480,7 +3474,7 @@ if @var{count} was also specified).
3480@end defun 3474@end defun
3481 3475
3482@defun cl-delete item seq @t{&key :test :test-not :key :count :start :end :from-end} 3476@defun cl-delete item seq @t{&key :test :test-not :key :count :start :end :from-end}
3483This deletes all elements of @var{seq} which match @var{item}. 3477This deletes all elements of @var{seq} that match @var{item}.
3484It is a destructive operation. Since Emacs Lisp does not support 3478It is a destructive operation. Since Emacs Lisp does not support
3485stretchable strings or vectors, this is the same as @code{cl-remove} 3479stretchable strings or vectors, this is the same as @code{cl-remove}
3486for those sequence types. On lists, @code{cl-remove} will copy the 3480for those sequence types. On lists, @code{cl-remove} will copy the
@@ -3580,7 +3574,7 @@ elements match (according to @code{:test}, @code{:test-not},
3580and @code{:key}), the function returns @code{nil}. If there is 3574and @code{:key}), the function returns @code{nil}. If there is
3581a mismatch, the function returns the index (relative to @var{seq1}) 3575a mismatch, the function returns the index (relative to @var{seq1})
3582of the first mismatching element. This will be the leftmost pair of 3576of the first mismatching element. This will be the leftmost pair of
3583elements which do not match, or the position at which the shorter of 3577elements that do not match, or the position at which the shorter of
3584the two otherwise-matching sequences runs out. 3578the two otherwise-matching sequences runs out.
3585 3579
3586If @code{:from-end} is true, then the elements are compared from right 3580If @code{:from-end} is true, then the elements are compared from right
@@ -3595,7 +3589,7 @@ which compares two strings case-insensitively.
3595@defun cl-search seq1 seq2 @t{&key :test :test-not :key :from-end :start1 :end1 :start2 :end2} 3589@defun cl-search seq1 seq2 @t{&key :test :test-not :key :from-end :start1 :end1 :start2 :end2}
3596This function searches @var{seq2} for a subsequence that matches 3590This function searches @var{seq2} for a subsequence that matches
3597@var{seq1} (or part of it specified by @code{:start1} and 3591@var{seq1} (or part of it specified by @code{:start1} and
3598@code{:end1}.) Only matches which fall entirely within the region 3592@code{:end1}). Only matches that fall entirely within the region
3599defined by @code{:start2} and @code{:end2} will be considered. 3593defined by @code{:start2} and @code{:end2} will be considered.
3600The return value is the index of the leftmost element of the 3594The return value is the index of the leftmost element of the
3601leftmost match, relative to the start of @var{seq2}, or @code{nil} 3595leftmost match, relative to the start of @var{seq2}, or @code{nil}
@@ -3606,7 +3600,7 @@ function finds the @emph{rightmost} matching subsequence.
3606@node Sorting Sequences 3600@node Sorting Sequences
3607@section Sorting Sequences 3601@section Sorting Sequences
3608 3602
3609@defun clsort seq predicate @t{&key :key} 3603@defun cl-sort seq predicate @t{&key :key}
3610This function sorts @var{seq} into increasing order as determined 3604This function sorts @var{seq} into increasing order as determined
3611by using @var{predicate} to compare pairs of elements. @var{predicate} 3605by using @var{predicate} to compare pairs of elements. @var{predicate}
3612should return true (non-@code{nil}) if and only if its first argument 3606should return true (non-@code{nil}) if and only if its first argument
@@ -3617,7 +3611,7 @@ numbers into decreasing rather than increasing order.
3617 3611
3618This function differs from Emacs's built-in @code{sort} in that it 3612This function differs from Emacs's built-in @code{sort} in that it
3619can operate on any type of sequence, not just lists. Also, it 3613can operate on any type of sequence, not just lists. Also, it
3620accepts a @code{:key} argument which is used to preprocess data 3614accepts a @code{:key} argument, which is used to preprocess data
3621fed to the @var{predicate} function. For example, 3615fed to the @var{predicate} function. For example,
3622 3616
3623@example 3617@example
@@ -3628,7 +3622,7 @@ fed to the @var{predicate} function. For example,
3628sorts @var{data}, a sequence of strings, into increasing alphabetical 3622sorts @var{data}, a sequence of strings, into increasing alphabetical
3629order without regard to case. A @code{:key} function of @code{car} 3623order without regard to case. A @code{:key} function of @code{car}
3630would be useful for sorting association lists. It should only be a 3624would be useful for sorting association lists. It should only be a
3631simple accessor though, it's used heavily in the current 3625simple accessor though, since it's used heavily in the current
3632implementation. 3626implementation.
3633 3627
3634The @code{cl-sort} function is destructive; it sorts lists by actually 3628The @code{cl-sort} function is destructive; it sorts lists by actually
@@ -3684,7 +3678,7 @@ i.e., chains of cons cells.
3684 3678
3685@defun cl-caddr x 3679@defun cl-caddr x
3686This function is equivalent to @code{(car (cdr (cdr @var{x})))}. 3680This function is equivalent to @code{(car (cdr (cdr @var{x})))}.
3687Likewise, this package defines all 28 @code{c@var{xxx}r} functions 3681Likewise, this package defines all 24 @code{c@var{xxx}r} functions
3688where @var{xxx} is up to four @samp{a}s and/or @samp{d}s. 3682where @var{xxx} is up to four @samp{a}s and/or @samp{d}s.
3689All of these functions are @code{setf}-able, and calls to them 3683All of these functions are @code{setf}-able, and calls to them
3690are expanded inline by the byte-compiler for maximum efficiency. 3684are expanded inline by the byte-compiler for maximum efficiency.
@@ -3712,7 +3706,8 @@ This function returns the length of list @var{x}, exactly like
3712@code{(length @var{x})}, except that if @var{x} is a circular 3706@code{(length @var{x})}, except that if @var{x} is a circular
3713list (where the @sc{cdr}-chain forms a loop rather than terminating 3707list (where the @sc{cdr}-chain forms a loop rather than terminating
3714with @code{nil}), this function returns @code{nil}. (The regular 3708with @code{nil}), this function returns @code{nil}. (The regular
3715@code{length} function would get stuck if given a circular list.) 3709@code{length} function would get stuck if given a circular list.
3710See also the @code{safe-length} function.)
3716@end defun 3711@end defun
3717 3712
3718@defun cl-list* arg &rest others 3713@defun cl-list* arg &rest others
@@ -3740,18 +3735,6 @@ This function returns a copy of the list @var{list}. It copies
3740dotted lists like @code{(1 2 . 3)} correctly. 3735dotted lists like @code{(1 2 . 3)} correctly.
3741@end defun 3736@end defun
3742 3737
3743@defun copy-tree x &optional vecp
3744This function returns a copy of the tree of cons cells @var{x}.
3745@c FIXME? cl-copy-list is not an alias of copy-sequence.
3746Unlike @code{copy-sequence} (and its alias @code{cl-copy-list}),
3747which copies only along the @sc{cdr} direction, this function
3748copies (recursively) along both the @sc{car} and the @sc{cdr}
3749directions. If @var{x} is not a cons cell, the function simply
3750returns @var{x} unchanged. If the optional @var{vecp} argument
3751is true, this function copies vectors (recursively) as well as
3752cons cells.
3753@end defun
3754
3755@defun cl-tree-equal x y @t{&key :test :test-not :key} 3738@defun cl-tree-equal x y @t{&key :test :test-not :key}
3756This function compares two trees of cons cells. If @var{x} and 3739This function compares two trees of cons cells. If @var{x} and
3757@var{y} are both cons cells, their @sc{car}s and @sc{cdr}s are 3740@var{y} are both cons cells, their @sc{car}s and @sc{cdr}s are
@@ -3814,7 +3797,7 @@ This is a destructive version of @code{cl-sublis}.
3814@section Lists as Sets 3797@section Lists as Sets
3815 3798
3816@noindent 3799@noindent
3817These functions perform operations on lists which represent sets 3800These functions perform operations on lists that represent sets
3818of elements. 3801of elements.
3819 3802
3820@defun cl-member item list @t{&key :test :test-not :key} 3803@defun cl-member item list @t{&key :test :test-not :key}
@@ -3827,13 +3810,14 @@ are compared by @code{eql} by default; you can use the @code{:test},
3827 3810
3828The standard Emacs lisp function @code{member} uses @code{equal} for 3811The standard Emacs lisp function @code{member} uses @code{equal} for
3829comparisons; it is equivalent to @code{(cl-member @var{item} @var{list} 3812comparisons; it is equivalent to @code{(cl-member @var{item} @var{list}
3830:test 'equal)}. 3813:test 'equal)}. With no keyword arguments, @code{cl-member} is
3814equivalent to @code{memq}.
3831@end defun 3815@end defun
3832 3816
3833@findex cl-member-if 3817@findex cl-member-if
3834@findex cl-member-if-not 3818@findex cl-member-if-not
3835The @code{cl-member-if} and @code{cl-member-if-not} functions 3819The @code{cl-member-if} and @code{cl-member-if-not} functions
3836analogously search for elements which satisfy a given predicate. 3820analogously search for elements that satisfy a given predicate.
3837 3821
3838@defun cl-tailp sublist list 3822@defun cl-tailp sublist list
3839This function returns @code{t} if @var{sublist} is a sublist of 3823This function returns @code{t} if @var{sublist} is a sublist of
@@ -3852,11 +3836,11 @@ become part of the list.
3852@end defun 3836@end defun
3853 3837
3854@defun cl-union list1 list2 @t{&key :test :test-not :key} 3838@defun cl-union list1 list2 @t{&key :test :test-not :key}
3855This function combines two lists which represent sets of items, 3839This function combines two lists that represent sets of items,
3856returning a list that represents the union of those two sets. 3840returning a list that represents the union of those two sets.
3857The result list will contain all items which appear in @var{list1} 3841The resulting list contains all items that appear in @var{list1}
3858or @var{list2}, and no others. If an item appears in both 3842or @var{list2}, and no others. If an item appears in both
3859@var{list1} and @var{list2} it will be copied only once. If 3843@var{list1} and @var{list2} it is copied only once. If
3860an item is duplicated in @var{list1} or @var{list2}, it is 3844an item is duplicated in @var{list1} or @var{list2}, it is
3861undefined whether or not that duplication will survive in the 3845undefined whether or not that duplication will survive in the
3862result list. The order of elements in the result list is also 3846result list. The order of elements in the result list is also
@@ -3871,7 +3855,7 @@ it tries to reuse the storage of the argument lists if possible.
3871@defun cl-intersection list1 list2 @t{&key :test :test-not :key} 3855@defun cl-intersection list1 list2 @t{&key :test :test-not :key}
3872This function computes the intersection of the sets represented 3856This function computes the intersection of the sets represented
3873by @var{list1} and @var{list2}. It returns the list of items 3857by @var{list1} and @var{list2}. It returns the list of items
3874which appear in both @var{list1} and @var{list2}. 3858that appear in both @var{list1} and @var{list2}.
3875@end defun 3859@end defun
3876 3860
3877@defun cl-nintersection list1 list2 @t{&key :test :test-not :key} 3861@defun cl-nintersection list1 list2 @t{&key :test :test-not :key}
@@ -3921,7 +3905,7 @@ This function searches the association list @var{a-list} for an
3921element whose @sc{car} matches (in the sense of @code{:test}, 3905element whose @sc{car} matches (in the sense of @code{:test},
3922@code{:test-not}, and @code{:key}, or by comparison with @code{eql}) 3906@code{:test-not}, and @code{:key}, or by comparison with @code{eql})
3923a given @var{item}. It returns the matching element, if any, 3907a given @var{item}. It returns the matching element, if any,
3924otherwise @code{nil}. It ignores elements of @var{a-list} which 3908otherwise @code{nil}. It ignores elements of @var{a-list} that
3925are not cons cells. (This corresponds to the behavior of 3909are not cons cells. (This corresponds to the behavior of
3926@code{assq} and @code{assoc} in Emacs Lisp; Common Lisp's 3910@code{assq} and @code{assoc} in Emacs Lisp; Common Lisp's
3927@code{assoc} ignores @code{nil}s but considers any other non-cons 3911@code{assoc} ignores @code{nil}s but considers any other non-cons
@@ -3982,11 +3966,11 @@ are symbols. For example,
3982@end example 3966@end example
3983 3967
3984@noindent 3968@noindent
3985defines a struct type called @code{person} which contains three 3969defines a struct type called @code{person} that contains three
3986slots. Given a @code{person} object @var{p}, you can access those 3970slots. Given a @code{person} object @var{p}, you can access those
3987slots by calling @code{(person-name @var{p})}, @code{(person-age @var{p})}, 3971slots by calling @code{(person-name @var{p})}, @code{(person-age @var{p})},
3988and @code{(person-sex @var{p})}. You can also change these slots by 3972and @code{(person-sex @var{p})}. You can also change these slots by
3989using @code{setf} on any of these place forms: 3973using @code{setf} on any of these place forms, for example:
3990 3974
3991@example 3975@example
3992(cl-incf (person-age birthday-boy)) 3976(cl-incf (person-age birthday-boy))
@@ -4003,10 +3987,10 @@ Given a @code{person}, @code{(copy-person @var{p})} makes a new
4003object of the same type whose slots are @code{eq} to those of @var{p}. 3987object of the same type whose slots are @code{eq} to those of @var{p}.
4004 3988
4005Given any Lisp object @var{x}, @code{(person-p @var{x})} returns 3989Given any Lisp object @var{x}, @code{(person-p @var{x})} returns
4006true if @var{x} looks like a @code{person}, false otherwise. (Again, 3990true if @var{x} looks like a @code{person}, and false otherwise. (Again,
4007in Common Lisp this predicate would be exact; in Emacs Lisp the 3991in Common Lisp this predicate would be exact; in Emacs Lisp the
4008best it can do is verify that @var{x} is a vector of the correct 3992best it can do is verify that @var{x} is a vector of the correct
4009length which starts with the correct tag symbol.) 3993length that starts with the correct tag symbol.)
4010 3994
4011Accessors like @code{person-name} normally check their arguments 3995Accessors like @code{person-name} normally check their arguments
4012(effectively using @code{person-p}) and signal an error if the 3996(effectively using @code{person-p}) and signal an error if the
@@ -4043,7 +4027,7 @@ In general, @var{name} is either a name symbol or a list of a name
4043symbol followed by any number of @dfn{struct options}; each @var{slot} 4027symbol followed by any number of @dfn{struct options}; each @var{slot}
4044is either a slot symbol or a list of the form @samp{(@var{slot-name} 4028is either a slot symbol or a list of the form @samp{(@var{slot-name}
4045@var{default-value} @var{slot-options}@dots{})}. The @var{default-value} 4029@var{default-value} @var{slot-options}@dots{})}. The @var{default-value}
4046is a Lisp form which is evaluated any time an instance of the 4030is a Lisp form that is evaluated any time an instance of the
4047structure type is created without specifying that slot's value. 4031structure type is created without specifying that slot's value.
4048 4032
4049Common Lisp defines several slot options, but the only one 4033Common Lisp defines several slot options, but the only one
@@ -4101,11 +4085,11 @@ The argument names should match the slot names; each slot is
4101initialized from the corresponding argument. Slots whose names 4085initialized from the corresponding argument. Slots whose names
4102do not appear in the argument list are initialized based on the 4086do not appear in the argument list are initialized based on the
4103@var{default-value} in their slot descriptor. Also, @code{&optional} 4087@var{default-value} in their slot descriptor. Also, @code{&optional}
4104and @code{&key} arguments which don't specify defaults take their 4088and @code{&key} arguments that don't specify defaults take their
4105defaults from the slot descriptor. It is valid to include arguments 4089defaults from the slot descriptor. It is valid to include arguments
4106which don't correspond to slot names; these are useful if they are 4090that don't correspond to slot names; these are useful if they are
4107referred to in the defaults for optional, keyword, or @code{&aux} 4091referred to in the defaults for optional, keyword, or @code{&aux}
4108arguments which @emph{do} correspond to slots. 4092arguments that @emph{do} correspond to slots.
4109 4093
4110You can specify any number of full-format @code{:constructor} 4094You can specify any number of full-format @code{:constructor}
4111options on a structure. The default constructor is still generated 4095options on a structure. The default constructor is still generated
@@ -4146,7 +4130,7 @@ means not to generate a copier function. (In this implementation,
4146all copier functions are simply synonyms for @code{copy-sequence}.) 4130all copier functions are simply synonyms for @code{copy-sequence}.)
4147 4131
4148@item :predicate 4132@item :predicate
4149The argument is an alternate name for the predicate which recognizes 4133The argument is an alternate name for the predicate that recognizes
4150objects of this type. The default is @code{@var{name}-p}. @code{nil} 4134objects of this type. The default is @code{@var{name}-p}. @code{nil}
4151means not to generate a predicate function. (If the @code{:type} 4135means not to generate a predicate function. (If the @code{:type}
4152option is used without the @code{:named} option, no predicate is 4136option is used without the @code{:named} option, no predicate is
@@ -4206,7 +4190,7 @@ work on astronauts just like other people.
4206 4190
4207@item :print-function 4191@item :print-function
4208In full Common Lisp, this option allows you to specify a function 4192In full Common Lisp, this option allows you to specify a function
4209which is called to print an instance of the structure type. The 4193that is called to print an instance of the structure type. The
4210Emacs Lisp system offers no hooks into the Lisp printer which would 4194Emacs Lisp system offers no hooks into the Lisp printer which would
4211allow for such a feature, so this package simply ignores 4195allow for such a feature, so this package simply ignores
4212@code{:print-function}. 4196@code{:print-function}.
@@ -4383,7 +4367,7 @@ You can find out how a macro expands by using the
4383This function takes a single Lisp form as an argument and inserts 4367This function takes a single Lisp form as an argument and inserts
4384a nicely formatted copy of it in the current buffer (which must be 4368a nicely formatted copy of it in the current buffer (which must be
4385in Lisp mode so that indentation works properly). It also expands 4369in Lisp mode so that indentation works properly). It also expands
4386all Lisp macros which appear in the form. The easiest way to use 4370all Lisp macros that appear in the form. The easiest way to use
4387this function is to go to the @file{*scratch*} buffer and type, say, 4371this function is to go to the @file{*scratch*} buffer and type, say,
4388 4372
4389@example 4373@example
@@ -4392,7 +4376,7 @@ this function is to go to the @file{*scratch*} buffer and type, say,
4392 4376
4393@noindent 4377@noindent
4394and type @kbd{C-x C-e} immediately after the closing parenthesis; 4378and type @kbd{C-x C-e} immediately after the closing parenthesis;
4395the expansion 4379an expansion similar to:
4396 4380
4397@example 4381@example
4398(cl-block nil 4382(cl-block nil
@@ -4413,7 +4397,11 @@ variable @code{G1004} was created by @code{cl-gensym}.)
4413If the optional argument @var{full} is true, then @emph{all} 4397If the optional argument @var{full} is true, then @emph{all}
4414macros are expanded, including @code{cl-block}, @code{cl-eval-when}, 4398macros are expanded, including @code{cl-block}, @code{cl-eval-when},
4415and compiler macros. Expansion is done as if @var{form} were 4399and compiler macros. Expansion is done as if @var{form} were
4416a top-level form in a file being compiled. For example, 4400a top-level form in a file being compiled.
4401
4402@c FIXME none of these examples are still applicable.
4403@ignore
4404For example,
4417 4405
4418@example 4406@example
4419(cl-prettyexpand '(cl-pushnew 'x list)) 4407(cl-prettyexpand '(cl-pushnew 'x list))
@@ -4423,16 +4411,12 @@ a top-level form in a file being compiled. For example,
4423(cl-prettyexpand '(caddr (cl-member 'a list)) t) 4411(cl-prettyexpand '(caddr (cl-member 'a list)) t)
4424 @print{} (car (cdr (cdr (memq 'a list)))) 4412 @print{} (car (cdr (cdr (memq 'a list))))
4425@end example 4413@end example
4414@end ignore
4426 4415
4427Note that @code{cl-adjoin}, @code{cl-caddr}, and @code{cl-member} all 4416Note that @code{cl-adjoin}, @code{cl-caddr}, and @code{cl-member} all
4428have built-in compiler macros to optimize them in common cases. 4417have built-in compiler macros to optimize them in common cases.
4429@end defun 4418@end defun
4430 4419
4431@ifinfo
4432@example
4433
4434@end example
4435@end ifinfo
4436@appendixsec Error Checking 4420@appendixsec Error Checking
4437 4421
4438@noindent 4422@noindent
@@ -4442,7 +4426,7 @@ where substantial gains were possible at the expense of marginal
4442incompatibility. 4426incompatibility.
4443 4427
4444The Common Lisp standard (as embodied in Steele's book) uses the 4428The Common Lisp standard (as embodied in Steele's book) uses the
4445phrase ``it is an error if'' to indicate a situation which is not 4429phrase ``it is an error if'' to indicate a situation that is not
4446supposed to arise in complying programs; implementations are strongly 4430supposed to arise in complying programs; implementations are strongly
4447encouraged but not required to signal an error in these situations. 4431encouraged but not required to signal an error in these situations.
4448This package sometimes omits such error checking in the interest of 4432This package sometimes omits such error checking in the interest of
@@ -4464,46 +4448,36 @@ you can use @code{&allow-other-keys} to omit this check. Functions
4464defined in this package such as @code{cl-find} and @code{cl-member} 4448defined in this package such as @code{cl-find} and @code{cl-member}
4465do check their keyword arguments for validity. 4449do check their keyword arguments for validity.
4466 4450
4467@ifinfo 4451@appendixsec Compiler Optimizations
4468@example
4469
4470@end example
4471@end ifinfo
4472@appendixsec Optimizing Compiler
4473 4452
4474@noindent 4453@noindent
4475Use of the optimizing Emacs compiler is highly recommended; many of the Common 4454Changing the value of @code{byte-optimize} from the default @code{t}
4455is highly discouraged; many of the Common
4476Lisp macros emit 4456Lisp macros emit
4477code which can be improved by optimization. In particular, 4457code that can be improved by optimization. In particular,
4478@code{cl-block}s (whether explicit or implicit in constructs like 4458@code{cl-block}s (whether explicit or implicit in constructs like
4479@code{cl-defun} and @code{cl-loop}) carry a fair run-time penalty; the 4459@code{cl-defun} and @code{cl-loop}) carry a fair run-time penalty; the
4480optimizing compiler removes @code{cl-block}s which are not actually 4460byte-compiler removes @code{cl-block}s that are not actually
4481referenced by @code{cl-return} or @code{cl-return-from} inside the block. 4461referenced by @code{cl-return} or @code{cl-return-from} inside the block.
4482 4462
4483@node Common Lisp Compatibility 4463@node Common Lisp Compatibility
4484@appendix Common Lisp Compatibility 4464@appendix Common Lisp Compatibility
4485 4465
4486@noindent 4466@noindent
4487Following is a list of all known incompatibilities between this 4467The following is a list of all known incompatibilities between this
4488package and Common Lisp as documented in Steele (2nd edition). 4468package and Common Lisp as documented in Steele (2nd edition).
4489 4469
4490The word @code{cl-defun} is required instead of @code{defun} in order 4470The word @code{cl-defun} is required instead of @code{defun} in order
4491to use extended Common Lisp argument lists in a function. Likewise, 4471to use extended Common Lisp argument lists in a function. Likewise,
4492@code{cl-defmacro} and @code{cl-function} are versions of those forms 4472@code{cl-defmacro} and @code{cl-function} are versions of those forms
4493which understand full-featured argument lists. The @code{&whole} 4473which understand full-featured argument lists. The @code{&whole}
4494keyword does not work in @code{defmacro} argument lists (except 4474keyword does not work in @code{cl-defmacro} argument lists (except
4495inside recursive argument lists). 4475inside recursive argument lists).
4496 4476
4497The @code{equal} predicate does not distinguish 4477The @code{equal} predicate does not distinguish
4498between IEEE floating-point plus and minus zero. The @code{cl-equalp} 4478between IEEE floating-point plus and minus zero. The @code{cl-equalp}
4499predicate has several differences with Common Lisp; @pxref{Predicates}. 4479predicate has several differences with Common Lisp; @pxref{Predicates}.
4500 4480
4501@c FIXME no longer provided by cl.
4502The @code{setf} mechanism is entirely compatible, except that
4503setf-methods return a list of five values rather than five
4504values directly. Also, the new ``@code{setf} function'' concept
4505(typified by @code{(defun (setf foo) @dots{})}) is not implemented.
4506
4507The @code{cl-do-all-symbols} form is the same as @code{cl-do-symbols} 4481The @code{cl-do-all-symbols} form is the same as @code{cl-do-symbols}
4508with no @var{obarray} argument. In Common Lisp, this form would 4482with no @var{obarray} argument. In Common Lisp, this form would
4509iterate over all symbols in all packages. Since Emacs obarrays 4483iterate over all symbols in all packages. Since Emacs obarrays
@@ -4635,7 +4609,7 @@ However, the Emacs parser does not understand colons and just
4635treats them as part of the symbol name. Thus, while @code{mapcar} 4609treats them as part of the symbol name. Thus, while @code{mapcar}
4636and @code{lisp:mapcar} may refer to the same symbol in Common 4610and @code{lisp:mapcar} may refer to the same symbol in Common
4637Lisp, they are totally distinct in Emacs Lisp. Common Lisp 4611Lisp, they are totally distinct in Emacs Lisp. Common Lisp
4638programs which refer to a symbol by the full name sometimes 4612programs that refer to a symbol by the full name sometimes
4639and the short name other times will not port cleanly to Emacs. 4613and the short name other times will not port cleanly to Emacs.
4640 4614
4641Emacs Lisp does have a concept of ``obarrays'', which are 4615Emacs Lisp does have a concept of ``obarrays'', which are
@@ -4923,13 +4897,16 @@ Common Lisp defines three macros, @code{define-modify-macro},
4923user to extend generalized variables in various ways. 4897user to extend generalized variables in various ways.
4924In Emacs, these are obsolete, replaced by various features of 4898In Emacs, these are obsolete, replaced by various features of
4925@file{gv.el} in Emacs 24.3. 4899@file{gv.el} in Emacs 24.3.
4926@c FIXME details. 4900@xref{Adding Generalized Variables,,,elisp,GNU Emacs Lisp Reference Manual}.
4901
4927 4902
4928@defmac define-modify-macro name arglist function [doc-string] 4903@defmac define-modify-macro name arglist function [doc-string]
4929This macro defines a ``read-modify-write'' macro similar to 4904This macro defines a ``read-modify-write'' macro similar to
4930@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
4931to take a @var{place} argument followed by additional arguments 4906with @code{gv-letplace}.
4932described by @var{arglist}. The call 4907
4908The macro @var{name} is defined to take a @var{place} argument
4909followed by additional arguments described by @var{arglist}. The call
4933 4910
4934@example 4911@example
4935(@var{name} @var{place} @var{args}@dots{}) 4912(@var{name} @var{place} @var{args}@dots{})
@@ -4952,8 +4929,8 @@ which in turn is roughly equivalent to
4952For example: 4929For example:
4953 4930
4954@example 4931@example
4955(define-modify-macro cl-incf (&optional (n 1)) +) 4932(define-modify-macro incf (&optional (n 1)) +)
4956(define-modify-macro cl-concatf (&rest args) concat) 4933(define-modify-macro concatf (&rest args) concat)
4957@end example 4934@end example
4958 4935
4959Note that @code{&key} is not allowed in @var{arglist}, but 4936Note that @code{&key} is not allowed in @var{arglist}, but
@@ -4962,16 +4939,31 @@ Note that @code{&key} is not allowed in @var{arglist}, but
4962Most of the modify macros defined by Common Lisp do not exactly 4939Most of the modify macros defined by Common Lisp do not exactly
4963follow the pattern of @code{define-modify-macro}. For example, 4940follow the pattern of @code{define-modify-macro}. For example,
4964@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}
4965is completely irregular. You can define these macros ``by hand'' 4942is completely irregular.
4966using @code{get-setf-method}, or consult the source 4943
4967to see how to use the internal @code{setf} building blocks. 4944The 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
4968@end defmac 4958@end defmac
4969 4959
4970@defmac defsetf access-fn update-fn 4960@defmac defsetf access-fn update-fn
4971This is the simpler of two @code{defsetf} forms. Where 4961This is the simpler of two @code{defsetf} forms, and is
4972@var{access-fn} is the name of a function which accesses a place, 4962replaced by @code{gv-define-simple-setter}.
4973this declares @var{update-fn} to be the corresponding store 4963
4974function. From now on, 4964With @var{access-fn} the name of a function that accesses a place,
4965this declares @var{update-fn} to be the corresponding store function.
4966From now on,
4975 4967
4976@example 4968@example
4977(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})
@@ -4986,13 +4978,13 @@ will be expanded to
4986 4978
4987@noindent 4979@noindent
4988The @var{update-fn} is required to be either a true function, or 4980The @var{update-fn} is required to be either a true function, or
4989a macro which evaluates its arguments in a function-like way. Also, 4981a macro that evaluates its arguments in a function-like way. Also,
4990the @var{update-fn} is expected to return @var{value} as its result. 4982the @var{update-fn} is expected to return @var{value} as its result.
4991Otherwise, the above expansion would not obey the rules for the way 4983Otherwise, the above expansion would not obey the rules for the way
4992@code{setf} is supposed to behave. 4984@code{setf} is supposed to behave.
4993 4985
4994As a special (non-Common-Lisp) extension, a third argument of @code{t} 4986As a special (non-Common-Lisp) extension, a third argument of @code{t}
4995to @code{defsetf} says that the @code{update-fn}'s return value is 4987to @code{defsetf} says that the return value of @code{update-fn} is
4996not suitable, so that the above @code{setf} should be expanded to 4988not suitable, so that the above @code{setf} should be expanded to
4997something more like 4989something more like
4998 4990
@@ -5002,25 +4994,32 @@ something more like
5002 temp) 4994 temp)
5003@end example 4995@end example
5004 4996
5005Some examples of the use of @code{defsetf}, drawn from the standard 4997Some examples are:
5006suite of setf methods, are:
5007 4998
5008@example 4999@example
5009(defsetf car setcar) 5000(defsetf car setcar)
5010(defsetf symbol-value set)
5011(defsetf buffer-name rename-buffer t) 5001(defsetf buffer-name rename-buffer t)
5012@end example 5002@end example
5003
5004These 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
5013@end defmac 5010@end defmac
5014 5011
5015@defmac defsetf access-fn arglist (store-var) forms@dots{} 5012@defmac defsetf access-fn arglist (store-var) forms@dots{}
5016This is the second, more complex, form of @code{defsetf}. It is 5013This is the second, more complex, form of @code{defsetf}.
5017rather like @code{defmacro} except for the additional @var{store-var} 5014It can be replaced by @code{gv-define-setter}.
5018argument. The @var{forms} should return a Lisp form which stores 5015
5019the value of @var{store-var} into the generalized variable formed 5016This form of @code{defsetf} is rather like @code{defmacro} except for
5020by a call to @var{access-fn} with arguments described by @var{arglist}. 5017the additional @var{store-var} argument. The @var{forms} should
5021The @var{forms} may begin with a string which documents the @code{setf} 5018return a Lisp form that stores the value of @var{store-var} into the
5022method (analogous to the doc string that appears at the front of a 5019generalized variable formed by a call to @var{access-fn} with
5023function). 5020arguments described by @var{arglist}. The @var{forms} may begin with
5021a string which documents the @code{setf} method (analogous to the doc
5022string that appears at the front of a function).
5024 5023
5025For example, the simple form of @code{defsetf} is shorthand for 5024For example, the simple form of @code{defsetf} is shorthand for
5026 5025
@@ -5031,23 +5030,32 @@ For example, the simple form of @code{defsetf} is shorthand for
5031 5030
5032The Lisp form that is returned can access the arguments from 5031The Lisp form that is returned can access the arguments from
5033@var{arglist} and @var{store-var} in an unrestricted fashion; 5032@var{arglist} and @var{store-var} in an unrestricted fashion;
5034macros like @code{setf} and @code{cl-incf} which invoke this 5033macros like @code{cl-incf} that invoke this
5035setf-method will insert temporary variables as needed to make 5034setf-method will insert temporary variables as needed to make
5036sure the apparent order of evaluation is preserved. 5035sure the apparent order of evaluation is preserved.
5037 5036
5038Another example drawn from the standard package: 5037Another standard example:
5039 5038
5040@example 5039@example
5041(defsetf nth (n x) (store) 5040(defsetf nth (n x) (store)
5042 (list 'setcar (list 'nthcdr n x) store)) 5041 `(setcar (nthcdr ,n ,x) ,store))
5042@end example
5043
5044You 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))
5043@end example 5049@end example
5044@end defmac 5050@end defmac
5045 5051
5046@defmac define-setf-method access-fn arglist forms@dots{} 5052@defmac define-setf-method access-fn arglist forms@dots{}
5047This is the most general way to create new place forms. When 5053This is the most general way to create new place forms. You can
5048a @code{setf} to @var{access-fn} with arguments described by 5054replace this by @code{gv-define-setter} or @code{gv-define-expander}.
5049@var{arglist} is expanded, the @var{forms} are evaluated and 5055
5050must return a list of five items: 5056When a @code{setf} to @var{access-fn} with arguments described by
5057@var{arglist} is expanded, the @var{forms} are evaluated and must
5058return a list of five items:
5051 5059
5052@enumerate 5060@enumerate
5053@item 5061@item
@@ -5063,12 +5071,12 @@ A list of exactly one @dfn{store variable} (generally obtained
5063from a call to @code{gensym}). 5071from a call to @code{gensym}).
5064 5072
5065@item 5073@item
5066A Lisp form which stores the contents of the store variable into 5074A Lisp form that stores the contents of the store variable into
5067the generalized variable, assuming the temporaries have been 5075the generalized variable, assuming the temporaries have been
5068bound as described above. 5076bound as described above.
5069 5077
5070@item 5078@item
5071A Lisp form which accesses the contents of the generalized variable, 5079A Lisp form that accesses the contents of the generalized variable,
5072assuming the temporaries have been bound. 5080assuming the temporaries have been bound.
5073@end enumerate 5081@end enumerate
5074 5082
@@ -5076,6 +5084,9 @@ This is exactly like the Common Lisp macro of the same name,
5076except that the method returns a list of five values rather 5084except that the method returns a list of five values rather
5077than the five values themselves, since Emacs Lisp does not 5085than the five values themselves, since Emacs Lisp does not
5078support Common Lisp's notion of multiple return values. 5086support Common Lisp's notion of multiple return values.
5087(Note that the @code{setf} implementation provided by @file{gv.el}
5088does not use this five item format. Its use here is only for
5089backwards compatibility.)
5079 5090
5080Once again, the @var{forms} may begin with a documentation string. 5091Once again, the @var{forms} may begin with a documentation string.
5081 5092
@@ -5084,47 +5095,29 @@ temporary variables. In the setf-methods generated by
5084@code{defsetf}, the second return value is simply the list of 5095@code{defsetf}, the second return value is simply the list of
5085arguments in the place form, and the first return value is a 5096arguments in the place form, and the first return value is a
5086list of a corresponding number of temporary variables generated 5097list of a corresponding number of temporary variables generated
5087by @code{cl-gensym}. Macros like @code{setf} and @code{cl-incf} which 5098@c FIXME I don't think this is true anymore.
5099by @code{cl-gensym}. Macros like @code{cl-incf} that
5088use this setf-method will optimize away most temporaries that 5100use this setf-method will optimize away most temporaries that
5089turn out to be unnecessary, so there is little reason for the 5101turn out to be unnecessary, so there is little reason for the
5090setf-method itself to optimize. 5102setf-method itself to optimize.
5091@end defmac 5103@end defmac
5092 5104
5105@c Removed in Emacs 24.3, not possible to make a compatible replacement.
5106@ignore
5093@defun get-setf-method place &optional env 5107@defun get-setf-method place &optional env
5094This function returns the setf-method for @var{place}, by 5108This function returns the setf-method for @var{place}, by
5095invoking the definition previously recorded by @code{defsetf} 5109invoking the definition previously recorded by @code{defsetf}
5096or @code{define-setf-method}. The result is a list of five 5110or @code{define-setf-method}. The result is a list of five
5097values as described above. You can use this function to build 5111values as described above. You can use this function to build
5098your own @code{cl-incf}-like modify macros. (Actually, it is 5112your own @code{cl-incf}-like modify macros.
5099@c FIXME?
5100better to use the internal functions @code{cl-setf-do-modify}
5101and @code{cl-setf-do-store}, which are a bit easier to use and
5102which also do a number of optimizations; consult the source
5103code for the @code{cl-incf} function for a simple example.)
5104 5113
5105The argument @var{env} specifies the ``environment'' to be 5114The argument @var{env} specifies the ``environment'' to be
5106passed on to @code{macroexpand} if @code{get-setf-method} should 5115passed on to @code{macroexpand} if @code{get-setf-method} should
5107need to expand a macro in @var{place}. It should come from 5116need to expand a macro in @var{place}. It should come from
5108an @code{&environment} argument to the macro or setf-method 5117an @code{&environment} argument to the macro or setf-method
5109that called @code{get-setf-method}. 5118that called @code{get-setf-method}.
5110
5111See also the source code for the setf-method for
5112@c Also @code{apply}, but that is commented out.
5113@code{substring}, which works by calling @code{get-setf-method} on a
5114simpler case, then massaging the result.
5115@end defun 5119@end defun
5116 5120@end ignore
5117Modern Common Lisp defines a second, independent way to specify
5118the @code{setf} behavior of a function, namely ``@code{setf}
5119functions'' whose names are lists @code{(setf @var{name})}
5120rather than symbols. For example, @code{(defun (setf foo) @dots{})}
5121defines the function that is used when @code{setf} is applied to
5122@code{foo}. This package does not currently support @code{setf}
5123functions. In particular, it is a compile-time error to use
5124@code{setf} on a form which has not already been @code{defsetf}'d
5125or otherwise declared; in newer Common Lisps, this would not be
5126an error since the function @code{(setf @var{func})} might be
5127defined later.
5128 5121
5129 5122
5130@node GNU Free Documentation License 5123@node GNU Free Documentation License
diff --git a/doc/misc/flymake.texi b/doc/misc/flymake.texi
index 28fb7864f06..4a873490e86 100644
--- a/doc/misc/flymake.texi
+++ b/doc/misc/flymake.texi
@@ -337,6 +337,17 @@ been reported.
337A custom face for highlighting lines for which at least one warning 337A custom face for highlighting lines for which at least one warning
338and no errors have been reported. 338and no errors have been reported.
339 339
340@item flymake-error-bitmap
341A bitmap used in the fringe to mark lines for which an error has
342been reported.
343
344@item flymake-warning-bitmap
345A bitmap used in the fringe to mark lines for which a warning has
346been reported.
347
348@item flymake-fringe-indicator-position
349Which fringe (if any) should show the warning/error bitmaps.
350
340@end table 351@end table
341 352
342@node Adding support for a new syntax check tool 353@node Adding support for a new syntax check tool
@@ -718,6 +729,15 @@ are used: @code{flymake-errline} and
718@code{flymake-warnline}. Errors belonging outside the current 729@code{flymake-warnline}. Errors belonging outside the current
719buffer are considered to belong to line 1 of the current buffer. 730buffer are considered to belong to line 1 of the current buffer.
720 731
732@c This manual does not use vindex.
733@c @vindex flymake-fringe-indicator-position
734@c @vindex flymake-error-bitmap
735@c @vindex flymake-warning-bitmap
736If the option @code{flymake-fringe-indicator-position} is non-@code{nil},
737errors and warnings are also highlighted in the left or right fringe,
738using the bitmaps specified by @code{flymake-error-bitmap}
739and @code{flymake-warning-bitmap}.
740
721@node Interaction with other modes 741@node Interaction with other modes
722@section Interaction with other modes 742@section Interaction with other modes
723@cindex Interaction with other modes 743@cindex Interaction with other modes
diff --git a/doc/misc/gnus.texi b/doc/misc/gnus.texi
index a9cd0d3567c..47ff355d946 100644
--- a/doc/misc/gnus.texi
+++ b/doc/misc/gnus.texi
@@ -14759,20 +14759,37 @@ This can be either the symbol @code{password} or the symbol @code{apop}
14759and says what authentication scheme to use. The default is 14759and says what authentication scheme to use. The default is
14760@code{password}. 14760@code{password}.
14761 14761
14762@item :leave
14763Non-@code{nil} if the mail is to be left on the @acronym{POP} server
14764after fetching. Mails once fetched will never be fetched again by the
14765@acronym{UIDL} control. Only the built-in @code{pop3-movemail} program
14766(the default) supports this keyword.
14767
14768If this is neither @code{nil} nor a number, all mails will be left on
14769the server. If this is a number, leave mails on the server for this
14770many days since you first checked new mails. If this is @code{nil}
14771(the default), mails will be deleted on the server right after fetching.
14772
14773@vindex pop3-uidl-file
14774The @code{pop3-uidl-file} variable specifies the file to which the
14775@acronym{UIDL} data are locally stored. The default value is
14776@file{~/.pop3-uidl}.
14777
14778Note that @acronym{POP} servers maintain no state information between
14779sessions, so what the client believes is there and what is actually
14780there may not match up. If they do not, then you may get duplicate
14781mails or the whole thing can fall apart and leave you with a corrupt
14782mailbox.
14783
14762@end table 14784@end table
14763 14785
14764@vindex pop3-movemail 14786@findex pop3-movemail
14765@vindex pop3-leave-mail-on-server 14787@vindex pop3-leave-mail-on-server
14766If the @code{:program} and @code{:function} keywords aren't specified, 14788If the @code{:program} and @code{:function} keywords aren't specified,
14767@code{pop3-movemail} will be used. If @code{pop3-leave-mail-on-server} 14789@code{pop3-movemail} will be used.
14768is non-@code{nil} the mail is to be left on the @acronym{POP} server
14769after fetching when using @code{pop3-movemail}. Note that POP servers
14770maintain no state information between sessions, so what the client
14771believes is there and what is actually there may not match up. If they
14772do not, then you may get duplicate mails or the whole thing can fall
14773apart and leave you with a corrupt mailbox.
14774 14790
14775Here are some examples for getting mail from a @acronym{POP} server. 14791Here are some examples for getting mail from a @acronym{POP} server.
14792
14776Fetch from the default @acronym{POP} server, using the default user 14793Fetch from the default @acronym{POP} server, using the default user
14777name, and default fetcher: 14794name, and default fetcher:
14778 14795
@@ -14787,6 +14804,14 @@ Fetch from a named server with a named user and password:
14787 :user "user-name" :password "secret") 14804 :user "user-name" :password "secret")
14788@end lisp 14805@end lisp
14789 14806
14807Leave mails on the server for 14 days:
14808
14809@lisp
14810(pop :server "my.pop.server"
14811 :user "user-name" :password "secret"
14812 :leave 14)
14813@end lisp
14814
14790Use @samp{movemail} to move the mail: 14815Use @samp{movemail} to move the mail:
14791 14816
14792@lisp 14817@lisp
diff --git a/doc/misc/ses.texi b/doc/misc/ses.texi
index a70bb9c407e..5de87a2f1c7 100644
--- a/doc/misc/ses.texi
+++ b/doc/misc/ses.texi
@@ -1,7 +1,7 @@
1\input texinfo @c -*-texinfo-*- 1\input texinfo @c -*-texinfo-*-
2@c %**start of header 2@c %**start of header
3@setfilename ../../info/ses 3@setfilename ../../info/ses
4@settitle SES: Simple Emacs Spreadsheet 4@settitle @acronym{SES}: Simple Emacs Spreadsheet
5@setchapternewpage off 5@setchapternewpage off
6@syncodeindex fn cp 6@syncodeindex fn cp
7@syncodeindex vr cp 7@syncodeindex vr cp
@@ -9,7 +9,7 @@
9@c %**end of header 9@c %**end of header
10 10
11@copying 11@copying
12This file documents SES: the Simple Emacs Spreadsheet. 12This file documents @acronym{SES}: the Simple Emacs Spreadsheet.
13 13
14Copyright @copyright{} 2002-2012 Free Software Foundation, Inc. 14Copyright @copyright{} 2002-2012 Free Software Foundation, Inc.
15 15
@@ -29,13 +29,13 @@ developing GNU and promoting software freedom.''
29 29
30@dircategory Emacs misc features 30@dircategory Emacs misc features
31@direntry 31@direntry
32* SES: (ses). Simple Emacs Spreadsheet. 32* @acronym{SES}: (ses). Simple Emacs Spreadsheet.
33@end direntry 33@end direntry
34 34
35@finalout 35@finalout
36 36
37@titlepage 37@titlepage
38@title SES 38@title @acronym{SES}
39@subtitle Simple Emacs Spreadsheet 39@subtitle Simple Emacs Spreadsheet
40@author Jonathan A. Yavner 40@author Jonathan A. Yavner
41@author @email{jyavner@@member.fsf.org} 41@author @email{jyavner@@member.fsf.org}
@@ -52,10 +52,10 @@ developing GNU and promoting software freedom.''
52@ifnottex 52@ifnottex
53@node Top, Sales Pitch, (dir), (dir) 53@node Top, Sales Pitch, (dir), (dir)
54@comment node-name, next, previous, up 54@comment node-name, next, previous, up
55@top SES: Simple Emacs Spreadsheet 55@top @acronym{SES}: Simple Emacs Spreadsheet
56 56
57@display 57@display
58SES is a major mode for GNU Emacs to edit spreadsheet files, which 58@acronym{SES} is a major mode for GNU Emacs to edit spreadsheet files, which
59contain a rectangular grid of cells. The cells' values are specified 59contain a rectangular grid of cells. The cells' values are specified
60by formulas that can refer to the values of other cells. 60by formulas that can refer to the values of other cells.
61@end display 61@end display
@@ -66,7 +66,7 @@ To report bugs, send email to @email{jyavner@@member.fsf.org}.
66@insertcopying 66@insertcopying
67 67
68@menu 68@menu
69* Sales Pitch:: Why use SES? 69* Sales Pitch:: Why use @acronym{SES}?
70* The Basics:: Basic spreadsheet commands 70* The Basics:: Basic spreadsheet commands
71* Advanced Features:: Want to know more? 71* Advanced Features:: Want to know more?
72* For Gurus:: Want to know @emph{even more}? 72* For Gurus:: Want to know @emph{even more}?
@@ -126,9 +126,9 @@ Moves point to cell, specified by identifier (@code{ses-jump}).
126 126
127Point is always at the left edge of a cell, or at the empty endline. 127Point is always at the left edge of a cell, or at the empty endline.
128When mark is inactive, the current cell is underlined. When mark is 128When mark is inactive, the current cell is underlined. When mark is
129active, the range is the highlighted rectangle of cells (SES always 129active, the range is the highlighted rectangle of cells (@acronym{SES} always
130uses transient mark mode). Drag the mouse from A1 to A3 to create the 130uses transient mark mode). Drag the mouse from A1 to A3 to create the
131range A1-A2. Many SES commands operate only on single cells, not 131range A1-A2. Many @acronym{SES} commands operate only on single cells, not
132ranges. 132ranges.
133 133
134@table @kbd 134@table @kbd
@@ -155,7 +155,7 @@ Highlight all cells (@code{mark-whole-buffer}).
155* Printer functions:: 155* Printer functions::
156* Clearing cells:: 156* Clearing cells::
157* Copy/cut/paste:: 157* Copy/cut/paste::
158* Customizing SES:: 158* Customizing @acronym{SES}::
159@end menu 159@end menu
160 160
161@node Formulas, Resizing, The Basics, The Basics 161@node Formulas, Resizing, The Basics, The Basics
@@ -192,7 +192,7 @@ this cell's formula will be reevaluated. While typing in the
192expression, you can use @kbd{M-@key{TAB}} to complete symbol names. 192expression, you can use @kbd{M-@key{TAB}} to complete symbol names.
193 193
194@item ' @r{(apostrophe)} 194@item ' @r{(apostrophe)}
195Enter a symbol (ses-read-symbol). SES remembers all symbols that have 195Enter a symbol (ses-read-symbol). @acronym{SES} remembers all symbols that have
196been used as formulas, so you can type just the beginning of a symbol 196been used as formulas, so you can type just the beginning of a symbol
197and use @kbd{@key{SPC}}, @kbd{@key{TAB}}, and @kbd{?} to complete it. 197and use @kbd{@key{SPC}}, @kbd{@key{TAB}}, and @kbd{?} to complete it.
198@end table 198@end table
@@ -349,7 +349,7 @@ Clear cell and move right (@code{ses-clear-cell-forward}).
349@end table 349@end table
350 350
351 351
352@node Copy/cut/paste, Customizing SES, Clearing cells, The Basics 352@node Copy/cut/paste, Customizing @acronym{SES}, Clearing cells, The Basics
353@section Copy, cut, and paste 353@section Copy, cut, and paste
354@cindex copy 354@cindex copy
355@cindex cut 355@cindex cut
@@ -365,7 +365,7 @@ Clear cell and move right (@code{ses-clear-cell-forward}).
365@findex ses-yank-pop 365@findex ses-yank-pop
366 366
367The copy functions work on rectangular regions of cells. You can paste the 367The copy functions work on rectangular regions of cells. You can paste the
368copies into non-SES buffers to export the print text. 368copies into non-@acronym{SES} buffers to export the print text.
369 369
370@table @kbd 370@table @kbd
371@item M-w 371@item M-w
@@ -394,7 +394,7 @@ Paste from kill ring (@code{yank}). The paste functions behave
394differently depending on the format of the text being inserted: 394differently depending on the format of the text being inserted:
395@itemize @bullet 395@itemize @bullet
396@item 396@item
397When pasting cells that were cut from a SES buffer, the print text is 397When pasting cells that were cut from a @acronym{SES} buffer, the print text is
398ignored and only the attached formula and printer are inserted; cell 398ignored and only the attached formula and printer are inserted; cell
399references in the formula are relocated unless you use @kbd{C-u}. 399references in the formula are relocated unless you use @kbd{C-u}.
400@item 400@item
@@ -402,7 +402,7 @@ The pasted text overwrites a rectangle of cells whose top left corner
402is the current cell. If part of the rectangle is beyond the edges of 402is the current cell. If part of the rectangle is beyond the edges of
403the spreadsheet, you must confirm the increase in spreadsheet size. 403the spreadsheet, you must confirm the increase in spreadsheet size.
404@item 404@item
405Non-SES text is usually inserted as a replacement formula for the 405Non-@acronym{SES} text is usually inserted as a replacement formula for the
406current cell. If the formula would be a symbol, it's treated as a 406current cell. If the formula would be a symbol, it's treated as a
407string unless you use @kbd{C-u}. Pasted formulas with syntax errors 407string unless you use @kbd{C-u}. Pasted formulas with syntax errors
408are always treated as strings. 408are always treated as strings.
@@ -420,12 +420,12 @@ Set point and paste from secondary clipboard (@code{mouse-yank-secondary}).
420@item M-y 420@item M-y
421Immediately after a paste, you can replace the text with a preceding 421Immediately after a paste, you can replace the text with a preceding
422element from the kill ring (@code{ses-yank-pop}). Unlike the standard 422element from the kill ring (@code{ses-yank-pop}). Unlike the standard
423Emacs yank-pop, the SES version uses @code{undo} to delete the old 423Emacs yank-pop, the @acronym{SES} version uses @code{undo} to delete the old
424yank. This doesn't make any difference? 424yank. This doesn't make any difference?
425@end table 425@end table
426 426
427@node Customizing SES, , Copy/cut/paste, The Basics 427@node Customizing @acronym{SES}, , Copy/cut/paste, The Basics
428@section Customizing SES 428@section Customizing @acronym{SES}
429@cindex customizing 429@cindex customizing
430@vindex enable-local-eval 430@vindex enable-local-eval
431@vindex ses-mode-hook 431@vindex ses-mode-hook
@@ -443,7 +443,7 @@ up or down. For diagonal movement, select two functions from the
443list. 443list.
444 444
445@code{ses-mode-hook} is a normal mode hook (list of functions to 445@code{ses-mode-hook} is a normal mode hook (list of functions to
446execute when starting SES mode for a buffer). 446execute when starting @acronym{SES} mode for a buffer).
447 447
448The variable @code{safe-functions} is a list of possibly-unsafe 448The variable @code{safe-functions} is a list of possibly-unsafe
449functions to be treated as safe when analyzing formulas and printers. 449functions to be treated as safe when analyzing formulas and printers.
@@ -469,7 +469,10 @@ safety belts!
469 469
470@table @kbd 470@table @kbd
471@item C-c M-C-h 471@item C-c M-C-h
472(@code{ses-set-header-row}). The header line at the top of the SES 472(@code{ses-set-header-row}).
473@findex ses-set-header-row
474@kindex C-c M-C-h
475The header line at the top of the @acronym{SES}
473window normally shows the column letter for each column. You can set 476window normally shows the column letter for each column. You can set
474it to show a copy of some row, such as a row of column titles, so that 477it to show a copy of some row, such as a row of column titles, so that
475row will always be visible. Default is to set the current row as the 478row will always be visible. Default is to set the current row as the
@@ -478,6 +481,16 @@ show column letters again.
478@item [header-line mouse-3] 481@item [header-line mouse-3]
479Pops up a menu to set the current row as the header, or revert to 482Pops up a menu to set the current row as the header, or revert to
480column letters. 483column letters.
484@item M-x ses-rename-cell
485@findex ses-rename-cell
486Rename a cell from a standard A1-like name to any
487string.
488@item M-x ses-repair-cell-reference-all
489@findex ses-repair-cell-reference-all
490When you interrupt a cell formula update by clicking @kbd{C-g}, then
491the cell reference link may be broken, which will jeopardize automatic
492cell update when any other cell on which it depends is changed. To
493repair that use function @code{ses-repair-cell-reference-all}
481@end table 494@end table
482 495
483@menu 496@menu
@@ -498,9 +511,9 @@ column letters.
498@findex ses-renarrow-buffer 511@findex ses-renarrow-buffer
499@findex ses-reprint-all 512@findex ses-reprint-all
500 513
501A SES file consists of a print area and a data area. Normally the 514A @acronym{SES} file consists of a print area and a data area. Normally the
502buffer is narrowed to show only the print area. The print area is 515buffer is narrowed to show only the print area. The print area is
503read-only except for special SES commands; it contains cell values 516read-only except for special @acronym{SES} commands; it contains cell values
504formatted by printer functions. The data area records the formula and 517formatted by printer functions. The data area records the formula and
505printer functions, etc. 518printer functions, etc.
506 519
@@ -576,6 +589,52 @@ If you insert a new row just beyond the end of a one-column range, or
576a new column just beyond a one-row range, the new cell is included in 589a new column just beyond a one-row range, the new cell is included in
577the range. New cells inserted just before a range are not included. 590the range. New cells inserted just before a range are not included.
578 591
592Flags can be added to @code{ses-range} immediately after the @var{to}
593cell.
594@table @code
595@item !
596Empty cells in range can be removed by adding the @code{!} flag. An
597empty cell is a cell the value of which is one of symbols @code{nil}
598or @code{*skip*}. For instance @code{(ses-range A1 A4 !)} will do the
599same as @code{(list A1 A3)} when cells @code{A2} and @code{A4} are
600empty.
601@item _
602Empty cell values are replaced by the argument following flag
603@code{_}, or @code{0} when flag @code{_} is last in argument list. For
604instance @code{(ses-range A1 A4 _ "empty")} will do the same as
605@code{(list A1 "empty" A3 "empty")} when cells @code{A2} and @code{A4}
606are empty. Similarly, @code{(ses-range A1 A4 _ )} will do the same as
607@code{(list A1 0 A3 0)}.
608@item >v
609When order matters, list cells by reading cells rowwise from top left
610to bottom right. This flag is provided for completeness only as it is
611the default reading order.
612@item <v
613List cells by reading cells rowwise from top right to bottom left.
614@item v>
615List cells by reading cells columnwise from top left to bottom right.
616@item v<
617List cells by reading cells columnwise from top right to bottom left.
618@item v
619A short hand for @code{v>}.
620@item ^
621A short hand for @code{^>}.
622@item >
623A short hand for @code{>v}.
624@item <
625A short hand for @code{>^}.
626@item *
627Instead of listing cells, it makes a Calc vector or matrix of it
628(@pxref{Top,,,calc,GNU Emacs Calc Manual}). If the range contains only
629one row or one column a vector is made, otherwise a matrix is made.
630@item *2
631Same as @code{*} except that a matrix is always made even when there
632is only one row or column in the range.
633@item *1
634Same as @code{*} except that a vector is always made even when there
635is only one row or column in the range, that is to say the
636corresponding matrix is flattened.
637@end table
579 638
580@node Sorting by column, Standard formula functions, Ranges in formulas, Advanced Features 639@node Sorting by column, Standard formula functions, Ranges in formulas, Advanced Features
581@section Sorting by column 640@section Sorting by column
@@ -653,7 +712,7 @@ the result is too wide for the available space (up to the end of the
653row or the next non-@code{nil} cell), the result is truncated if the cell's 712row or the next non-@code{nil} cell), the result is truncated if the cell's
654value is a string, or replaced with hash marks otherwise. 713value is a string, or replaced with hash marks otherwise.
655 714
656SES could get confused by printer results that contain newlines or 715@acronym{SES} could get confused by printer results that contain newlines or
657tabs, so these are replaced with question marks. 716tabs, so these are replaced with question marks.
658 717
659@table @kbd 718@table @kbd
@@ -734,7 +793,7 @@ for more info on how Lisp forms are classified as safe or unsafe.
734A common organization for spreadsheets is to have a bunch of ``detail'' 793A common organization for spreadsheets is to have a bunch of ``detail''
735rows, each perhaps describing a transaction, and then a set of 794rows, each perhaps describing a transaction, and then a set of
736``summary'' rows that each show reduced data for some subset of the 795``summary'' rows that each show reduced data for some subset of the
737details. SES supports this organization via the @code{ses-select} 796details. @acronym{SES} supports this organization via the @code{ses-select}
738function. 797function.
739 798
740@table @code 799@table @code
@@ -771,7 +830,7 @@ details-and-summary spreadsheet.
771* Nonrelocatable references:: 830* Nonrelocatable references::
772* The data area:: 831* The data area::
773* Buffer-local variables in spreadsheets:: 832* Buffer-local variables in spreadsheets::
774* Uses of defadvice in SES:: 833* Uses of defadvice in @acronym{SES}::
775@end menu 834@end menu
776 835
777@node Deferred updates, Nonrelocatable references, For Gurus, For Gurus 836@node Deferred updates, Nonrelocatable references, For Gurus, For Gurus
@@ -799,7 +858,7 @@ progress message of the form ``Writing... (@var{nnn} cells left)''.
799These deferred cell-writes cannot be interrupted by @kbd{C-g}, so 858These deferred cell-writes cannot be interrupted by @kbd{C-g}, so
800you'll just have to wait. 859you'll just have to wait.
801 860
802SES uses @code{run-with-idle-timer} to move the cell underline when 861@acronym{SES} uses @code{run-with-idle-timer} to move the cell underline when
803Emacs will be scrolling the buffer after the end of a command, and 862Emacs will be scrolling the buffer after the end of a command, and
804also to narrow and underline after @kbd{C-x C-v}. This is visible as 863also to narrow and underline after @kbd{C-x C-v}. This is visible as
805a momentary glitch after C-x C-v and certain scrolling commands. You 864a momentary glitch after C-x C-v and certain scrolling commands. You
@@ -843,14 +902,14 @@ Begins with an 014 character, followed by sets of cell-definition
843macros for each row, followed by column-widths, column-printers, 902macros for each row, followed by column-widths, column-printers,
844default-printer, and header-row. Then there's the global parameters 903default-printer, and header-row. Then there's the global parameters
845(file-format ID, numrows, numcols) and the local variables (specifying 904(file-format ID, numrows, numcols) and the local variables (specifying
846SES mode for the buffer, etc.) 905@acronym{SES} mode for the buffer, etc.)
847 906
848When a SES file is loaded, first the numrows and numcols values are 907When a @acronym{SES} file is loaded, first the numrows and numcols values are
849loaded, then the entire data area is @code{eval}ed, and finally the local 908loaded, then the entire data area is @code{eval}ed, and finally the local
850variables are processed. 909variables are processed.
851 910
852You can edit the data area, but don't insert or delete any newlines 911You can edit the data area, but don't insert or delete any newlines
853except in the local-variables part, since SES locates things by 912except in the local-variables part, since @acronym{SES} locates things by
854counting newlines. Use @kbd{C-x C-e} at the end of a line to install 913counting newlines. Use @kbd{C-x C-e} at the end of a line to install
855your edits into the spreadsheet data structures (this does not update 914your edits into the spreadsheet data structures (this does not update
856the print area, use e.g. @kbd{C-c C-l} for that). 915the print area, use e.g. @kbd{C-c C-l} for that).
@@ -866,7 +925,7 @@ data structures:
866@end table 925@end table
867 926
868 927
869@node Buffer-local variables in spreadsheets, Uses of defadvice in SES, The data area, For Gurus 928@node Buffer-local variables in spreadsheets, Uses of defadvice in @acronym{SES}, The data area, For Gurus
870@section Buffer-local variables in spreadsheets 929@section Buffer-local variables in spreadsheets
871@cindex buffer-local variables 930@cindex buffer-local variables
872@cindex variables, buffer-local 931@cindex variables, buffer-local
@@ -900,8 +959,8 @@ avoid virus warnings, each function used in a formula needs
900(put 'your-function-name 'safe-function t) 959(put 'your-function-name 'safe-function t)
901@end lisp 960@end lisp
902 961
903@node Uses of defadvice in SES, , Buffer-local variables in spreadsheets, For Gurus 962@node Uses of defadvice in @acronym{SES}, , Buffer-local variables in spreadsheets, For Gurus
904@section Uses of defadvice in SES 963@section Uses of defadvice in @acronym{SES}
905@cindex defadvice 964@cindex defadvice
906@cindex undo-more 965@cindex undo-more
907@cindex copy-region-as-kill 966@cindex copy-region-as-kill
diff --git a/doc/misc/texinfo.tex b/doc/misc/texinfo.tex
index f3093d0853f..b5f31415771 100644
--- a/doc/misc/texinfo.tex
+++ b/doc/misc/texinfo.tex
@@ -3,7 +3,7 @@
3% Load plain if necessary, i.e., if running under initex. 3% Load plain if necessary, i.e., if running under initex.
4\expandafter\ifx\csname fmtname\endcsname\relax\input plain\fi 4\expandafter\ifx\csname fmtname\endcsname\relax\input plain\fi
5% 5%
6\def\texinfoversion{2012-09-12.16} 6\def\texinfoversion{2012-11-08.11}
7% 7%
8% Copyright 1985, 1986, 1988, 1990, 1991, 1992, 1993, 1994, 1995, 8% Copyright 1985, 1986, 1988, 1990, 1991, 1992, 1993, 1994, 1995,
9% 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 9% 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006,
@@ -6559,16 +6559,9 @@ end
6559\makedispenvdef{quotation}{\quotationstart} 6559\makedispenvdef{quotation}{\quotationstart}
6560% 6560%
6561\def\quotationstart{% 6561\def\quotationstart{%
6562 {\parskip=0pt \aboveenvbreak}% because \aboveenvbreak inserts \parskip 6562 \indentedblockstart % same as \indentedblock, but increase right margin too.
6563 \parindent=0pt
6564 %
6565 % @cartouche defines \nonarrowing to inhibit narrowing at next level down.
6566 \ifx\nonarrowing\relax 6563 \ifx\nonarrowing\relax
6567 \advance\leftskip by \lispnarrowing
6568 \advance\rightskip by \lispnarrowing 6564 \advance\rightskip by \lispnarrowing
6569 \exdentamount = \lispnarrowing
6570 \else
6571 \let\nonarrowing = \relax
6572 \fi 6565 \fi
6573 \parsearg\quotationlabel 6566 \parsearg\quotationlabel
6574} 6567}
@@ -6594,6 +6587,32 @@ end
6594 \fi 6587 \fi
6595} 6588}
6596 6589
6590% @indentedblock is like @quotation, but indents only on the left and
6591% has no optional argument.
6592%
6593\makedispenvdef{indentedblock}{\indentedblockstart}
6594%
6595\def\indentedblockstart{%
6596 {\parskip=0pt \aboveenvbreak}% because \aboveenvbreak inserts \parskip
6597 \parindent=0pt
6598 %
6599 % @cartouche defines \nonarrowing to inhibit narrowing at next level down.
6600 \ifx\nonarrowing\relax
6601 \advance\leftskip by \lispnarrowing
6602 \exdentamount = \lispnarrowing
6603 \else
6604 \let\nonarrowing = \relax
6605 \fi
6606}
6607
6608% Keep a nonzero parskip for the environment, since we're doing normal filling.
6609%
6610\def\Eindentedblock{%
6611 \par
6612 {\parskip=0pt \afterenvbreak}%
6613}
6614\def\Esmallindentedblock{\Eindentedblock}
6615
6597 6616
6598% LaTeX-like @verbatim...@end verbatim and @verb{<char>...<char>} 6617% LaTeX-like @verbatim...@end verbatim and @verb{<char>...<char>}
6599% If we want to allow any <char> as delimiter, 6618% If we want to allow any <char> as delimiter,
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
21This file documents the Emacs Lisp URL loading package. 21This is the manual for the @code{url} Emacs Lisp library.
22 22
23Copyright @copyright{} 1993-1999, 2002, 2004-2012 Free Software Foundation, Inc. 23Copyright @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 80A @dfn{Uniform Resource Identifier} (URI) is a specially-formatted
79@dfn{Uniform Resource Identifiers} (URI) described in RFC 2396 which 81name, such as an Internet address, that identifies some name or
80updates RFC 1738 and RFC 1808. RFC 2016 defines uniform resource 82resource. The format of URIs is described in RFC 3986, which updates
81agents. 83and replaces the earlier RFCs 2732, 2396, 1808, and 1738. A
84@dfn{Uniform Resource Locator} (URL) is an older but still-common
85term, which basically refers to a URI corresponding to a resource that
86can be accessed (usually over a network) in a specific way.
82 87
83URIs 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
87FTP, NFS, HTTP, HTTPS, @code{rlogin}, @code{telnet}, tn3270, 90@example
88IRC and gopher URLs all have the form 91ftp://ftp.is.co.za/rfc/rfc1808.txt
92http://www.ietf.org/rfc/rfc2396.txt
93ldap://[2001:db8::7]/c=GB?objectClass?one
94mailto:John.Doe@@example.com
95news:comp.infosystems.www.servers.unix
96tel:+1-816-555-1212
97telnet://192.0.2.16:80/
98urn: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
102for parsing URIs and retrieving the resources to which they refer.
103(The library is so-named for historical reasons; nowadays, the ``URI''
104terminology is regarded as the more general one, and ``URL'' is
105technically 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
111meaning. 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{]} 114http://www.gnu.org/software/emacs/
92@end example 115@end example
116
93@noindent 117@noindent
94where @samp{@r{[}} and @samp{@r{]}} delimit optional parts. 118specifies 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/}.
96but you should beware of the security risks of sending cleartext 120
97passwords. @var{hostname} may be a domain name or a dotted decimal 121@cindex parsed URIs
98address. 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
99use the ``well known'' port for that service when accessing URLs. With 123provides the Lisp function @code{url-generic-parse-url}, a (mostly)
100the possible exception of @code{telnet}, it is rare for ports to be 124standard-compliant URI parser, as well as function
101specified, 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
102undesired consequences if a different service is listening on that 126string.
103port (e.g., an HTTP URL specifying the SMTP port can cause mail to be 127
104sent). @c , but @xref{Other Variables, url-bad-port-list}. 128@defun url-generic-parse-url uri-string
105The meaning of the @var{path} component depends on the service. 129This 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. 134Given 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
139expected by @code{url-recreate-url}, is a @dfn{parsed URI}: a CL
140structure whose slots hold the various components of the URI.
141@xref{top,the CL Manual,,cl,GNU Emacs Common Lisp Emulation}, for
142details 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.
118The directory in which URL configuration files, the cache etc., 148@end menu
119reside. The old default was @file{~/.url}, and this directory
120is still used if it exists. The new default is a @file{url/}
121directory 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
128The library functions typically operate on @dfn{parsed} versions of
129URLs. 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
138is the type of the URL scheme, e.g., @code{http} 157The URI scheme (a string, e.g.@: @code{http}). @xref{Supported URL
158Types}, for a list of schemes that the @code{url} library knows how to
159process. This slot can also be @code{nil}, if the URI is not fully
160specified.
161
139@item user 162@item user
140is the username associated with it, or @code{nil}; 163The user name (a string), or @code{nil}.
164
141@item password 165@item password
142is the user password associated with it, or @code{nil}; 166The user password (a string), or @code{nil}. The use of this URI
167component is strongly discouraged; nowadays, passwords are transmitted
168by other means, not as part of a URI.
169
143@item host 170@item host
144is the host name associated with it, or @code{nil}; 171The host name (a string), or @code{nil}. If present, this is
172typically a domain name or IP address.
173
145@item port 174@item port
146is the port number associated with it, or @code{nil}; 175The port number (an integer), or @code{nil}. Omitting this component
176usually means to use the ``standard'' port associated with the URI
177scheme.
178
147@item filename 179@item filename
148is the ``file'' part of it, or @code{nil}. This doesn't necessarily 180The combination of the ``path'' and ``query'' components of the URI (a
149actually refer to a file; 181string), or @code{nil}. If the query component is present, it is the
182substring following the first @samp{?} character, and the path
183component is the substring before the @samp{?}. The meaning of these
184components is scheme-dependent; they do not necessarily refer to a
185file on a disk.
186
150@item target 187@item target
151is the target part, or @code{nil}; 188The fragment component (a string), or @code{nil}. The fragment
152@item attributes 189component specifies a ``secondary resource'', such as a section of a
153is the attributes associated with it, or @code{nil}; 190webpage.
191
154@item fullness 192@item fullness
155is @code{t} for a fully-specified URL, with a host part indicated by 193This is @code{t} if the URI is fully specified, i.e.@: the
156@samp{//} after the scheme part. 194hierarchical components of the URI (the hostname and/or username
157@item use-cookies 195and/or password) are preceded by @samp{//}.
158is @code{nil} to neither send or store cookies to the server, @code{t}
159otherwise.
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
171These attributes have accessors named @code{url-@var{part}}, where 207These 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}
174using @code{setf}: 210accessor returns the default port for the URI scheme if the parsed
211URI'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
180If @var{port} is @var{nil}, @code{url-port} returns the default port 219@node URI Encoding
181of the protocol. 220@section URI Encoding
182 221
183There are functions for parsing and unparsing between the string and 222@cindex percent encoding
184vector forms. 223 The @code{url-generic-parse-url} parser does not obey RFC 3986 in
224one 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
228represented by converting them to UTF-8 byte sequences, and performing
229@dfn{percent encoding} on the bytes. For example, the o-umlaut
230character is converted to the UTF-8 byte sequence @samp{\xD3\xA7},
231then percent encoded to @samp{%D3%A7}. (Certain ``reserved''
232@acronym{ASCII} characters must also be percent encoded when they
233appear in URI components.)
234
235 The function @code{url-encode-url} can be used to convert a URI
236string containing arbitrary characters to one that is properly
237percent-encoded in accordance with RFC 3986.
238
239@defun url-encode-url url-string
240This function return a properly URI-encoded version of
241@var{url-string}. It also performs @dfn{URI normalization},
242e.g.@: converting the scheme component to lowercase if it was
243previously uppercase.
244@end defun
185 245
186@defun url-generic-parse-url url 246 To convert between a string containing arbitrary characters and a
187Return a parsed version of the string @var{url}. 247percent-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
251This function performs percent-encoding on @var{string}, and returns
252the result.
253
254If @var{string} is multibyte, it is first converted to a UTF-8 byte
255string. Each byte corresponding to an allowed character is left
256as-is, while all other bytes are converted to a three-character
257sequence: @samp{%} followed by two upper-case hex digits.
258
259@vindex url-unreserved-chars
260@cindex unreserved characters
261The allowed characters are specified by @var{allowed-chars}. If this
262argument 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
265be 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 270This function replaces percent-encoding sequences in @var{string} with
192Recreates a URL string from the parsed @var{url}. 271their character equivalents, and returns the resulting string.
272
273If @var{allow-newlines} is non-@code{nil}, it allows the decoding of
274carriage 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
281retrieving the data specified by a URL. The actual retrieval protocol
282depends on the URL's URI scheme, and is performed by lower-level
283scheme-specific functions. (Those lower-level functions are not
284documented here, and generally should not be called directly.)
285
286 In each of these functions, the @var{url} argument can be either a
287string or a parsed URL structure. If it is a string, that string is
288passed through @code{url-encode-url} before using it, to ensure that
289it is properly URI-encoded (@pxref{URI Encoding}).
290
198@defun url-retrieve-synchronously url 291@defun url-retrieve-synchronously url
199Retrieve @var{url} synchronously and return a buffer containing the 292This function synchronously retrieves the data specified by @var{url},
200data. @var{url} is either a string or a parsed URL structure. Return 293and 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
202info, or mailto URLs that need no further processing). 295for @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
206Retrieve @var{url} asynchronously and call @var{callback} with args 299This 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
208has been completely retrieved, with the current buffer containing the 301return value is the buffer into which the data will be inserted, or
209object and any MIME headers associated with it. @var{url} is either a 302@code{nil} if the process has already completed.
210string or a parsed URL structure. Returns the buffer @var{url} will 303
211load into, or @code{nil} if the process has already completed. 304The callback function is called this way:
212If the optional argument @var{silent} is non-@code{nil}, suppress 305
213progress messages. If the optional argument @var{no-cookies} is 306@example
214non-@code{nil}, do not store or send cookies. 307(apply @var{callback} @var{status} @var{cbargs})
308@end example
309
310@noindent
311where @var{status} is a plist representing what happened during the
312retrieval, with most recent events first, or an empty list if no
313events have occurred. Each pair in the plist is one of:
314
315@table @code
316@item (:redirect @var{redirected-to})
317This means that the request was redirected to the URL
318@var{redirected-to}.
319
320@item (:error (@var{error-symbol} . @var{data}))
321This means that an error occurred. If so desired, the error can be
322signaled with @code{(signal @var{error-symbol} @var{data})}.
323@end table
324
325When the callback function is called, the current buffer is the one
326containing the retrieved data (if any). The buffer also contains any
327MIME headers associated with the data retrieval.
328
329If the optional argument @var{silent} is non-@code{nil}, progress
330messages are suppressed. If the optional argument @var{no-cookies} is
331non-@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
220This acts like the @code{url-retrieve} function, but with limits on 335This function acts like @code{url-retrieve}, but with limits on the
221the degree of parallelism. The option @code{url-queue-parallel-processes} 336number of concurrently-running network processes. The option
222controls 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. 338processes, and the option @code{url-queue-timeout} sets a timeout in
339seconds.
340
341To 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
346The value of this option is an integer specifying the maximum number
347of concurrent @code{url-queue-retrieve} network processes. If the
348number of @code{url-queue-retrieve} calls is larger than this number,
349later ones are queued until ealier ones are finished.
350@end defopt
351
352@vindex url-queue-timeout
353@defopt url-queue-timeout
354The value of this option is a number specifying the maximum lifetime
355of a @code{url-queue-retrieve} network process, once it is started.
356If a process is not finished by then, it is killed and removed from
357the 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
363This chapter describes functions and variables affecting URL retrieval
364for 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
253The scheme @code{http} is Hypertext Transfer Protocol. The library 383The @code{http} scheme refers to the Hypertext Transfer Protocol. The
254supports version 1.1, specified in RFC 2616. (This supersedes 1.0, 384@code{url} library supports HTTP version 1.1, specified in RFC 2616.
255defined in RFC 1945) HTTP URLs have the following form, where most of 385Its default port is 80.
256the parts are optional: 386
257@example 387 The @code{https} scheme is a secure version of @code{http}, with
258http://@var{user}:@var{password}@@@var{host}:@var{port}/@var{path}?@var{searchpart}#@var{fragment} 388transmission via SSL. It is defined in RFC 2069, and its default port
259@end example 389is 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 390encryption via the @code{ssl} library, by forcing the @code{ssl}
261@c 80. The @code{/@var{path}} part, if present, is a slash-separated 391gateway 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
266The scheme @code{https} is a secure version of @code{http}, with
267transmission via SSL. It is defined in RFC 2069. Its default port is
268443. 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
273This controls honoring of HTTP @samp{Refresh} headers by which 394If this option is non-@code{nil} (the default), the @code{url} library
274servers can direct clients to reload documents from the same URL or a 395honors the HTTP @samp{Refresh} header, which is used by servers to
275or different one. @code{nil} means they will not be honored, 396direct clients to reload documents from the same URL or a or different
276@code{t} (the default) means they will always be honored, and 397one. If the value is @code{nil}, the @samp{Refresh} header is
277otherwise the user will be asked on each request. 398ignored; 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
532The @code{ftp} and @code{file} schemes are defined in RFC 1808. The
533@code{url} library treats @samp{ftp:} and @samp{file:} as synonymous.
534Such URLs have the form
535
412@example 536@example
413ftp://@var{user}:@var{password}@@@var{host}:@var{port}/@var{file} 537ftp://@var{user}:@var{password}@@@var{host}:@var{port}/@var{file}
414file://@var{user}:@var{password}@@@var{host}:@var{port}/@var{file} 538file://@var{user}:@var{password}@@@var{host}:@var{port}/@var{file}
415@end example 539@end example
416 540
417These schemes are defined in RFC 1808. 541@noindent
418@samp{ftp:} and @samp{file:} are synonymous in this library. They 542If the URL specifies a local file, it is retrieved by reading the file
419allow reading arbitrary files from hosts. Either @samp{ange-ftp} 543contents 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 544retrieved using the Ange-FTP package. @xref{Remote Files,,, emacs,
421hosts. Local files are accessed directly. 545The GNU Emacs Manual}.
422 546
423Compressed 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. 548if it has the file suffix @file{.z}, @file{.gz}, @file{.Z},
425Suffixes recognized are @samp{.z}, @samp{.gz}, @samp{.Z} and 549@file{.bz2}, or @file{.xz}. (The list of supported suffixes is
426@samp{.bz2}. 550hard-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
429The filename to look for when indexing a directory, default 554This 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
431will 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.
557Otherwise, 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
566The @code{info} scheme is non-standard. Such URLs have the form
567
440@example 568@example
441info:@var{file}#@var{node} 569info:@var{file}#@var{node}
442@end example 570@end example
443 571
444Info URLs are not officially defined. They invoke 572@noindent
445@code{Info-goto-node} with argument @samp{(@var{file})@var{node}}. 573and 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
453A mailto URL will send an email message to the address in the 582A @code{mailto} URL specifies an email message to be sent to a given
454URL, for example @samp{mailto:foo@@bar.com} would compose a 583email address. For example, @samp{mailto:foo@@bar.com} specifies
455message to @samp{foo@@bar.com}. 584sending a message to @samp{foo@@bar.com}. The ``retrieval method''
456 585for such URLs is to open a mail composition buffer in which the
457@defopt url-mail-command 586appropriate content (e.g.@: the recipient address) has been filled in.
458@vindex mail-user-agent
459The function called whenever url needs to send mail. This should
460normally be left to default from @var{mail-user-agent}. @xref{Mail
461Methods, , Mail-Composition Methods, emacs, The GNU Emacs Manual}.
462@end defopt
463 587
464An @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
465that contained the mailto URL is added if that URL is known.
466 589
467RFC 2368 extends the definition of mailto URLs in RFC 1738.
468The 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
474otherwise a @var{header} header field is created with @var{contents}
475as its contents. Note that the URL library does not consider any
476headers ``dangerous'' so you should check them before sending the
477message.
478 593
479@c Fixme: update 594@noindent
480Email messages are defined in @sc{rfc}822. 595where 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
597body; otherwise, a @var{header} header field is created with
598@var{contents} as its contents. Note that the @code{url} library does
599not perform any checking of @var{header} or @var{contents}, so you
600should check them before sending the message.
601
602@defopt url-mail-command
603@vindex mail-user-agent
604The value of this variable is the function called whenever url needs
605to send mail. This should normally be left its default, which is the
606standard mail-composition command @code{compose-mail}. @xref{Sending
607Mail,,, emacs, The GNU Emacs Manual}.
608@end defopt
609
610 If the document containing the @code{mailto} URL itself possessed a
611known URL, Emacs automatically inserts an @samp{X-Url-From} header
612field 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 622The @code{news}, @code{nntp}, and @code{snews} schemes, defined in RFC
491The network news URL scheme take the following forms following RFC 6231738, are used for reading Usenet newsgroups. For compatibility with
4921738 except that for compatibility with other clients, host and port 624non-standard-compliant news clients, the @code{url} library allows
493fields may be included in news URLs though they are properly only 625host and port fields to be included in @code{news} URLs, even though
494allowed for nntp an snews. 626they 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;
506Similar to the @samp{news} versions. 640Similar 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 644difference 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
512is :563. 646@samp{snews} scheme is the same as @samp{nntp}, except that it is
513@cindex SSL 647tunneled through SSL and has default port 563.
514(It is tunneled through SSL.)
515 648
516An @samp{nntp} URL is the same as a news URL, except that the URL may 649 These URLs are retrieved via the Gnus package.
517specify an article by its number.
518 650
519@defopt url-news-server
520This variable can be used to override the default news server.
521Usually this will be set by the Gnus package, which is used to fetch
522news.
523@cindex environment variable 651@cindex environment variable
524@vindex NNTPSERVER 652@vindex NNTPSERVER
525It may be set from the conventional environment variable 653@defopt url-news-server
526@code{NNTPSERVER}. 654This variable specifies the default news server from which to fetch
655news, if no server was specified in the URL. The default value,
656@code{nil}, means to use the server specified by the standard
657environment variable @samp{NNTPSERVER}, or @samp{news} if that
658environment 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
537These URL schemes from RFC 1738 for logon via a terminal emulator have 669These URL schemes are defined in RFC 1738, and are used for logging in
538the form 670via a terminal emulator. They have the form
671
539@example 672@example
540telnet://@var{user}:@var{password}@@@var{host}:@var{port} 673telnet://@var{user}:@var{password}@@@var{host}:@var{port}
541@end example 674@end example
542but the @code{:@var{password}} component is ignored. 675
676@noindent
677but the @var{password} component is ignored.
543 678
544To handle rlogin, telnet and tn3270 URLs, a @code{rlogin}, 679To 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
558session to a function named in @code{url-irc-function}. 693@url{http://www.w3.org/Addressing/draft-mirashi-url-irc-01.txt} (which
694was never approved as an RFC). Such URLs have the form
695
696@example
697irc://@var{host}:@var{port}/@var{target},@var{needpass}
698@end example
699
700@noindent
701and are retrieved by opening an @acronym{IRC} session using the
702function specified by @code{url-irc-function}.
559 703
560@defopt url-irc-function 704@defopt url-irc-function
561A function to actually open an IRC connection. 705The value of this option is a function, which is called to open an IRC
562This function 706connection for @code{irc} URLs. This function must take five
563must take five arguments, @var{host}, @var{port}, @var{channel}, 707arguments, @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
565channel to join immediately, this can be @code{nil}. By default this is 709join immediately, and may be @code{nil}.
566@code{url-irc-rcirc}. 710
711The default is @code{url-irc-rcirc}, which uses the Rcirc package.
712Other 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
569Processes the arguments and lets @code{rcirc} handle the session.
570@end defun
571@defun url-irc-erc host port channel user password
572Processes the arguments and lets @code{ERC} handle the session.
573@end defun
574@defun url-irc-zenirc host port channel user password
575Processes 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
721the URL itself. Such URLs have the form
722
582@example 723@example
583data:@r{[}@var{media-type}@r{]}@r{[};@var{base64}@r{]},@var{data} 724data:@r{[}@var{media-type}@r{]}@r{[};@var{base64}@r{]},@var{data}
584@end example 725@end example
585 726
586Data URLs contain MIME data in the URL itself. They are defined in 727@noindent
587RFC 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
590including parameters. It defaults to 729including 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
740The @code{nfs} scheme, defined in RFC 2224, is similar to @code{ftp}
741except that it points to a file on a remote host that is handled by an
742NFS automounter on the local host. Such URLs have the form
743
601@example 744@example
602nfs://@var{user}:@var{password}@@@var{host}:@var{port}/@var{file} 745nfs://@var{user}:@var{password}@@@var{host}:@var{port}/@var{file}
603@end example 746@end example
604 747
605The @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
607handled 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
611A string saying how to invoke the NFS automounter. Certain @samp{%} 750A string saying how to invoke the NFS automounter. Certain @samp{%}
@@ -628,15 +767,6 @@ A literal @samp{%}.
628 767
629Each can be used any number of times. 768Each can be used any number of times.
630 769
631@node cid
632@section cid
633@cindex Content-ID
634
635RFC 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
645The LDAP scheme is defined in RFC 2255. 775The LDAP scheme is defined in RFC 2255.
646 776
647@node imap
648@section imap
649@cindex IMAP
650
651RFC 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
783The @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
663This is a non-standard scheme. @var{page-spec} is passed directly to 789@noindent
664the Lisp @code{man} function. 790and 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
1114The following environment variables affect the library's operation at 1213 The following environment variables affect the @code{url} library's
1115startup. 1214operation 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
1122it. 1221it.
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
1127The following user options, settable with Customize, affect the 1227@defopt url-configuration-directory
1128general operation of the package. 1228@cindex configuration files
1229The value of this variable specifies the name of the directory where
1230the @code{url} library stores its various configuration files, cache
1231files, etc.
1232
1233The default value specifies a subdirectory named @file{url/} in the
1234standard Emacs user data directory specified by the variable
1235@code{user-emacs-directory} (normally @file{~/.emacs.d}). However,
1236the old default was @file{~/.url}, and this directory is used instead
1237if it exists.
1238@end defopt
1129 1239
1130@defopt url-debug 1240@defopt url-debug
1131@cindex debugging 1241@cindex debugging