aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoakim Verona2011-10-14 11:00:50 +0200
committerJoakim Verona2011-10-14 11:00:50 +0200
commitdab7e06ab78b5aa2b747ded874bbef8b6667a28d (patch)
tree60e8a4d369258032e70dfbc5533027367e69997f
parent3d9b00348ff3d3c70e1cad0b4804170a6a24779d (diff)
parent466a320edc8304632373066a61ee9f5903aa82a1 (diff)
downloademacs-dab7e06ab78b5aa2b747ded874bbef8b6667a28d.tar.gz
emacs-dab7e06ab78b5aa2b747ded874bbef8b6667a28d.zip
upstream
-rw-r--r--doc/emacs/ChangeLog15
-rw-r--r--doc/emacs/dired.texi2
-rw-r--r--doc/emacs/emacs.texi4
-rw-r--r--doc/emacs/frames.texi6
-rw-r--r--doc/emacs/killing.texi397
-rw-r--r--doc/emacs/mark.texi60
-rw-r--r--doc/emacs/mule.texi4
-rw-r--r--doc/lispref/ChangeLog7
-rw-r--r--doc/lispref/package.texi3
-rw-r--r--doc/lispref/text.texi18
-rw-r--r--doc/misc/ChangeLog13
-rw-r--r--doc/misc/ert.texi126
-rw-r--r--etc/NEWS8
-rw-r--r--lisp/ChangeLog5
-rw-r--r--lisp/textmodes/flyspell.el8
-rw-r--r--lwlib/ChangeLog10
-rw-r--r--lwlib/lwlib-Xaw.c4
-rw-r--r--lwlib/lwlib-Xm.c12
-rw-r--r--lwlib/lwlib-utils.c2
-rw-r--r--lwlib/lwlib.c16
-rw-r--r--lwlib/xlwmenu.c2
-rw-r--r--src/ChangeLog5
-rw-r--r--src/editfns.c2
23 files changed, 421 insertions, 308 deletions
diff --git a/doc/emacs/ChangeLog b/doc/emacs/ChangeLog
index 3089d2b3d5d..3fa8eece141 100644
--- a/doc/emacs/ChangeLog
+++ b/doc/emacs/ChangeLog
@@ -1,3 +1,18 @@
12011-10-13 Chong Yidong <cyd@stupidchicken.com>
2
3 * killing.texi (Deletion): Add xref to Using Region. Document
4 delete-forward-char.
5 (Yanking): Move yank-excluded-properties to Lisp manual. Move C-y
6 description here. Recommend C-u C-SPC for jumping to mark.
7 (Kill Ring): Move kill ring variable documentation here.
8 (Primary Selection): Copyedits.
9 (Rectangles): Document new command rectangle-number-lines.
10 (CUA Bindings): Note that this disables the mark-even-if-inactive
11 behavior for C-x and C-c.
12
13 * mark.texi (Mark): Mention "active region" terminology.
14 (Using Region): Document delete-active-region.
15
12011-10-12 Chong Yidong <cyd@stupidchicken.com> 162011-10-12 Chong Yidong <cyd@stupidchicken.com>
2 17
3 * mark.texi (Mark): Clarify description of disabled Transient Mark 18 * mark.texi (Mark): Clarify description of disabled Transient Mark
diff --git a/doc/emacs/dired.texi b/doc/emacs/dired.texi
index eb2bcc109e8..b6ed47fdb3f 100644
--- a/doc/emacs/dired.texi
+++ b/doc/emacs/dired.texi
@@ -1403,7 +1403,7 @@ directory than in this one. It also marks files with no counterpart,
1403in both directories, as always. 1403in both directories, as always.
1404 1404
1405@cindex drag and drop, Dired 1405@cindex drag and drop, Dired
1406 On the X window system, Emacs supports the ``drag and drop'' 1406 On the X Window System, Emacs supports the ``drag and drop''
1407protocol. You can drag a file object from another program, and drop 1407protocol. You can drag a file object from another program, and drop
1408it onto a Dired buffer; this either moves, copies, or creates a link 1408it onto a Dired buffer; this either moves, copies, or creates a link
1409to the file in that directory. Precisely which action is taken is 1409to the file in that directory. Precisely which action is taken is
diff --git a/doc/emacs/emacs.texi b/doc/emacs/emacs.texi
index d34ecb01ad6..8a15c783fc0 100644
--- a/doc/emacs/emacs.texi
+++ b/doc/emacs/emacs.texi
@@ -319,9 +319,9 @@ Killing and Moving Text
319 319
320Yanking 320Yanking
321 321
322* Kill Ring:: Where killed text is stored. Basic yanking. 322* Kill Ring:: Where killed text is stored.
323* Appending Kills:: Several kills in a row all yank together.
324* Earlier Kills:: Yanking something killed some time ago. 323* Earlier Kills:: Yanking something killed some time ago.
324* Appending Kills:: Several kills in a row all yank together.
325 325
326Killing and Yanking on Graphical Displays 326Killing and Yanking on Graphical Displays
327 327
diff --git a/doc/emacs/frames.texi b/doc/emacs/frames.texi
index fc78f90db15..14fdb3121a4 100644
--- a/doc/emacs/frames.texi
+++ b/doc/emacs/frames.texi
@@ -93,7 +93,7 @@ clicked.
93 Normally, Emacs does not distinguish between ordinary mouse clicks 93 Normally, Emacs does not distinguish between ordinary mouse clicks
94and clicks that select a frame. When you click on a frame to select 94and clicks that select a frame. When you click on a frame to select
95it, that also changes the selected window and cursor position 95it, that also changes the selected window and cursor position
96according to the mouse click position. On the X window system, you 96according to the mouse click position. On the X Window System, you
97can change this behavior by setting the variable 97can change this behavior by setting the variable
98@code{x-mouse-click-focus-ignore-position} to @code{t}. Then the 98@code{x-mouse-click-focus-ignore-position} to @code{t}. Then the
99first click selects the frame, but does not affect the selected window 99first click selects the frame, but does not affect the selected window
@@ -961,7 +961,7 @@ the left of each Emacs window, running the height of the
961window.@footnote{Placing it at the left is usually more useful with 961window.@footnote{Placing it at the left is usually more useful with
962overlapping frames with text starting at the left margin.} 962overlapping frames with text starting at the left margin.}
963 963
964 When Emacs is compiled with GTK+ support on the X window system, or 964 When Emacs is compiled with GTK+ support on the X Window System, or
965in operating systems such as Microsoft Windows or Mac OS, you can use 965in operating systems such as Microsoft Windows or Mac OS, you can use
966the scroll bar as you do in other graphical applications. If you 966the scroll bar as you do in other graphical applications. If you
967click @kbd{Mouse-1} on the scroll bar's up and down buttons, that 967click @kbd{Mouse-1} on the scroll bar's up and down buttons, that
@@ -971,7 +971,7 @@ the entire height of the window, like @kbd{M-v} and @kbd{C-v}
971respectively (@pxref{Moving Point}). Dragging the inner box with 971respectively (@pxref{Moving Point}). Dragging the inner box with
972@kbd{Mouse-1} scrolls the window continuously. 972@kbd{Mouse-1} scrolls the window continuously.
973 973
974 If Emacs is compiled without GTK+ support on the X window system, 974 If Emacs is compiled without GTK+ support on the X Window System,
975the scroll bar behaves differently. The scroll bar's inner box is 975the scroll bar behaves differently. The scroll bar's inner box is
976drawn to represent the portion of the buffer currently displayed, with 976drawn to represent the portion of the buffer currently displayed, with
977the entire height of the scroll bar representing the entire length of 977the entire height of the scroll bar representing the entire length of
diff --git a/doc/emacs/killing.texi b/doc/emacs/killing.texi
index 06839ce5187..493316daa52 100644
--- a/doc/emacs/killing.texi
+++ b/doc/emacs/killing.texi
@@ -77,12 +77,18 @@ the most part, the Emacs commands that delete text are those that
77erase just one character or only whitespace. 77erase just one character or only whitespace.
78 78
79@table @kbd 79@table @kbd
80@item C-d
81@itemx @key{Delete}
82Delete next character (@code{delete-char}).
83@item @key{DEL} 80@item @key{DEL}
84@itemx @key{Backspace} 81@itemx @key{Backspace}
85Delete previous character (@code{delete-backward-char}). 82Delete the previous character, or the text in the region if it is
83active (@code{delete-backward-char}).
84
85@item @key{Delete}
86Delete the next character, or the text in the region if it is active
87(@code{delete-forward-char}).
88
89@item C-d
90Delete the next character (@code{delete-char}).
91
86@item M-\ 92@item M-\
87Delete spaces and tabs around point (@code{delete-horizontal-space}). 93Delete spaces and tabs around point (@code{delete-horizontal-space}).
88@item M-@key{SPC} 94@item M-@key{SPC}
@@ -95,9 +101,13 @@ Join two lines by deleting the intervening newline, along with any
95indentation following it (@code{delete-indentation}). 101indentation following it (@code{delete-indentation}).
96@end table 102@end table
97 103
98 We have already described the basic deletion commands @kbd{C-d} 104 We have already described the basic deletion commands @key{DEL}
99(@code{delete-char}) and @key{DEL} (@code{delete-backward-char}). 105(@code{delete-backward-char}), @key{delete}
100@xref{Erasing}. 106(@code{delete-forward-char}), and @kbd{C-d} (@code{delete-char}).
107@xref{Erasing}. With a numeric argument, they delete the specified
108number of characters. If the numeric argument is omitted or one, they
109delete all the text in the region if it is active (@pxref{Using
110Region}).
101 111
102@kindex M-\ 112@kindex M-\
103@findex delete-horizontal-space 113@findex delete-horizontal-space
@@ -177,35 +187,35 @@ key sequence @kbd{C-S-backspace}.
177 187
178@table @kbd 188@table @kbd
179@item C-w 189@item C-w
180Kill region (@code{kill-region}). @xref{Mark}. 190Kill the region (@code{kill-region}).
181@item M-w 191@item M-w
182Save region as last killed text without actually killing it 192Copy the region into the kill ring (@code{kill-ring-save}).
183(@code{kill-ring-save}). Some programs call this ``copying.''
184@item M-d 193@item M-d
185Kill word (@code{kill-word}). @xref{Words}. 194Kill the next word (@code{kill-word}). @xref{Words}.
186@item M-@key{DEL} 195@item M-@key{DEL}
187Kill word backwards (@code{backward-kill-word}). 196Kill one word backwards (@code{backward-kill-word}).
188@item C-x @key{DEL} 197@item C-x @key{DEL}
189Kill back to beginning of sentence (@code{backward-kill-sentence}). 198Kill back to beginning of sentence (@code{backward-kill-sentence}).
190@xref{Sentences}. 199@xref{Sentences}.
191@item M-k 200@item M-k
192Kill to end of sentence (@code{kill-sentence}). 201Kill to the end of the sentence (@code{kill-sentence}).
193@item C-M-k 202@item C-M-k
194Kill the following balanced expression (@code{kill-sexp}). @xref{Expressions}. 203Kill the following balanced expression (@code{kill-sexp}). @xref{Expressions}.
195@item M-z @var{char} 204@item M-z @var{char}
196Kill through the next occurrence of @var{char} (@code{zap-to-char}). 205Kill through the next occurrence of @var{char} (@code{zap-to-char}).
197@end table 206@end table
198 207
199 Apart from @kbd{C-k}, the most commonly-used kill command is 208@kindex C-w
200@kbd{C-w} (@code{kill-region}), which kills the text in the region 209@findex kill-region
201(i.e., between point and mark). @xref{Mark}. If the mark is inactive
202when you type @kbd{C-w}, it first reactivates the mark where it was
203last set. The mark is deactivated at the end of the command.
204
205@kindex M-w 210@kindex M-w
206@findex kill-ring-save 211@findex kill-ring-save
207 @kbd{M-w} (@code{kill-ring-save}) copies the region into the kill 212 One of the commonly-used kill commands is @kbd{C-w}
208ring without removing it from the buffer. 213(@code{kill-region}), which kills the text in the region
214(@pxref{Mark}). Similarly, @kbd{M-w} (@code{kill-ring-save}) copies
215the text in the region into the kill ring without removing it from the
216buffer. If the mark is inactive when you type @kbd{C-w} or @kbd{M-w},
217the command acts on the text between point and where you last set the
218mark (@pxref{Using Region}).
209 219
210 Emacs also provides commands to kill specific syntactic units: 220 Emacs also provides commands to kill specific syntactic units:
211words, with @kbd{M-@key{DEL}} and @kbd{M-d} (@pxref{Words}); balanced 221words, with @kbd{M-@key{DEL}} and @kbd{M-d} (@pxref{Words}); balanced
@@ -248,34 +258,45 @@ kill-ring entry, without duplication.
248@cindex pasting 258@cindex pasting
249 259
250 @dfn{Yanking} means reinserting text previously killed. The usual 260 @dfn{Yanking} means reinserting text previously killed. The usual
251way to move or copy text is to kill it and then yank it elsewhere one 261way to move or copy text is to kill it and then yank it elsewhere.
252or more times.
253 262
254@table @kbd 263@table @kbd
255@item C-y 264@item C-y
256Yank last killed text (@code{yank}). 265Yank the last kill into the buffer, at point (@code{yank}).
257@item M-y 266@item M-y
258Replace text just yanked with an earlier batch of killed text 267Replace the text just yanked with an earlier batch of killed text
259(@code{yank-pop}). 268(@code{yank-pop}). @xref{Earlier Kills}.
260@item C-M-w 269@item C-M-w
261Append next kill to last batch of killed text (@code{append-next-kill}). 270Cause the following command, if it is a kill command, to append to the
271previous kill (@code{append-next-kill}). @xref{Appending Kills}.
262@end table 272@end table
263 273
264@cindex yanking and text properties 274@kindex C-y
265@vindex yank-excluded-properties 275@findex yank
266 The yank commands discard certain properties from the yanked text. 276 The basic yanking command is @kbd{C-y} (@code{yank}). It inserts
267These are properties that might lead to annoying results, such as 277the most recent kill, leaving the cursor at the end of the inserted
268causing the text to respond to the mouse or specifying key bindings. 278text. It also sets the mark at the beginning of the inserted text,
269The list of properties to discard is stored in the variable 279without activating the mark; this lets you jump easily to that
270@code{yank-excluded-properties}. These properties are also discarded 280position, if you wish, with @kbd{C-u C-@key{SPC}} (@pxref{Mark Ring}).
271when yanking register contents and rectangles. @xref{Text 281
272Properties,,, elisp, the Emacs Lisp Reference Manual}, for more 282 With a plain prefix argument (@kbd{C-u C-y}), the command instead
273information about text properties. 283leaves the cursor in front of the inserted text, and sets the mark at
284the end. Using any other prefix argument specifies an earlier kill;
285e.g. @kbd{C-u 4 C-y} reinserts the fourth most recent kill.
286@xref{Earlier Kills}.
287
288 On graphical displays, @kbd{C-y} first checks if another application
289has placed any text in the system clipboard more recently than the
290last Emacs kill. If so, it inserts the text in the clipboard instead.
291Thus, Emacs effectively treats ``cut'' or ``copy'' clipboard
292operations performed in other applications like Emacs kills, except
293that they are not recorded in the kill ring. @xref{Cut and Paste},
294for details.
274 295
275@menu 296@menu
276* Kill Ring:: Where killed text is stored. Basic yanking. 297* Kill Ring:: Where killed text is stored.
277* Appending Kills:: Several kills in a row all yank together.
278* Earlier Kills:: Yanking something killed some time ago. 298* Earlier Kills:: Yanking something killed some time ago.
299* Appending Kills:: Several kills in a row all yank together.
279@end menu 300@end menu
280 301
281@node Kill Ring 302@node Kill Ring
@@ -284,31 +305,69 @@ information about text properties.
284 The @dfn{kill ring} is a list of blocks of text that were previously 305 The @dfn{kill ring} is a list of blocks of text that were previously
285killed. There is only one kill ring, shared by all buffers, so you 306killed. There is only one kill ring, shared by all buffers, so you
286can kill text in one buffer and yank it in another buffer. This is 307can kill text in one buffer and yank it in another buffer. This is
287the usual way to move text from one file to another. (There are 308the usual way to move text from one buffer to another. (There are
288several other methods: for instance, you could store the text in a 309several other methods: for instance, you could store the text in a
289register; see @ref{Registers}. @xref{Accumulating Text}, for some 310register; see @ref{Registers}. @xref{Accumulating Text}, for some
290other ways to move text around.) 311other ways to move text around.)
291 312
292@kindex C-y 313@vindex kill-ring-max
293@findex yank 314 The maximum number of entries in the kill ring is controlled by the
294 @kbd{C-y} (@code{yank}) reinserts the text of the most recent kill, 315variable @code{kill-ring-max}. The default is 60. If you make a new
295leaving the cursor at the end of the text. It also adds the position 316kill when this limit has been reached, Emacs makes room by deleting
296of the beginning of the text to the mark ring, without activating the 317the oldest entry in the kill ring.
297mark; this allows you to jump easily to that position with @kbd{C-x
298C-x} (@pxref{Setting Mark}).
299 318
300 On graphical displays, @kbd{C-y} first checks if another application 319@vindex kill-ring
301has placed any text in the system clipboard more recently than the 320 The actual contents of the kill ring are stored in a variable named
302last Emacs kill. If so, it inserts from the clipboard instead of the 321@code{kill-ring}; you can view the entire contents of the kill ring
303kill ring. Conceptually, you can think of the clipboard as an 322with @kbd{C-h v kill-ring}.
304``extra'' entry in the kill ring, which is present if you recently cut 323
305or copied some text in another application. @xref{Cut and Paste}. 324@node Earlier Kills
325@subsection Yanking Earlier Kills
326@cindex yanking previous kills
327
328 As explained in @ref{Yanking}, you can use a numeric argument to
329@kbd{C-y} to yank text that is no longer the most recent kill. This
330is useful if you remember which kill ring entry you want. If you
331don't, you can use the @kbd{M-y} (@code{yank-pop}) command to cycle
332through the possibilities.
333
334@kindex M-y
335@findex yank-pop
336 If the previous command was a yank command, @kbd{M-y} takes the text
337that was yanked and replaces it with the text from an earlier kill.
338So, to recover the text of the next-to-the-last kill, first use
339@kbd{C-y} to yank the last kill, and then use @kbd{M-y} to replace it
340with the previous kill. @kbd{M-y} is allowed only after a @kbd{C-y}
341or another @kbd{M-y}.
342
343 You can understand @kbd{M-y} in terms of a ``last yank'' pointer which
344points at an entry in the kill ring. Each time you kill, the ``last
345yank'' pointer moves to the newly made entry at the front of the ring.
346@kbd{C-y} yanks the entry which the ``last yank'' pointer points to.
347@kbd{M-y} moves the ``last yank'' pointer to a different entry, and the
348text in the buffer changes to match. Enough @kbd{M-y} commands can move
349the pointer to any entry in the ring, so you can get any entry into the
350buffer. Eventually the pointer reaches the end of the ring; the next
351@kbd{M-y} loops back around to the first entry again.
352
353 @kbd{M-y} moves the ``last yank'' pointer around the ring, but it does
354not change the order of the entries in the ring, which always runs from
355the most recent kill at the front to the oldest one still remembered.
356
357 @kbd{M-y} can take a numeric argument, which tells it how many entries
358to advance the ``last yank'' pointer by. A negative argument moves the
359pointer toward the front of the ring; from the front of the ring, it
360moves ``around'' to the last entry and continues forward from there.
361
362 Once the text you are looking for is brought into the buffer, you can
363stop doing @kbd{M-y} commands and it will stay there. It's just a copy
364of the kill ring entry, so editing it in the buffer does not change
365what's in the ring. As long as no new killing is done, the ``last
366yank'' pointer remains at the same place in the kill ring, so repeating
367@kbd{C-y} will yank another copy of the same previous kill.
306 368
307 With a plain prefix argument (@kbd{C-u C-y}), the @code{yank} 369 When you call @kbd{C-y} with a numeric argument, that also sets the
308command instead leaves the cursor in front of the text, and adds the 370``last yank'' pointer to the entry that it yanks.
309position of the end of the text to the mark ring. Using any other
310prefix argument specifies an earlier kill; for example, @kbd{C-u 4
311C-y} reinserts the fourth most recent kill. @xref{Earlier Kills}.
312 371
313@node Appending Kills 372@node Appending Kills
314@subsection Appending Kills 373@subsection Appending Kills
@@ -365,65 +424,6 @@ accumulate them to be yanked back in one place.@refill
365 A kill command following @kbd{M-w} (@code{kill-ring-save}) does not 424 A kill command following @kbd{M-w} (@code{kill-ring-save}) does not
366append to the text that @kbd{M-w} copied into the kill ring. 425append to the text that @kbd{M-w} copied into the kill ring.
367 426
368@node Earlier Kills
369@subsection Yanking Earlier Kills
370
371@cindex yanking previous kills
372@kindex M-y
373@findex yank-pop
374 To recover killed text that is no longer the most recent kill, use the
375@kbd{M-y} command (@code{yank-pop}). It takes the text previously
376yanked and replaces it with the text from an earlier kill. So, to
377recover the text of the next-to-the-last kill, first use @kbd{C-y} to
378yank the last kill, and then use @kbd{M-y} to replace it with the
379previous kill. @kbd{M-y} is allowed only after a @kbd{C-y} or another
380@kbd{M-y}.
381
382 You can understand @kbd{M-y} in terms of a ``last yank'' pointer which
383points at an entry in the kill ring. Each time you kill, the ``last
384yank'' pointer moves to the newly made entry at the front of the ring.
385@kbd{C-y} yanks the entry which the ``last yank'' pointer points to.
386@kbd{M-y} moves the ``last yank'' pointer to a different entry, and the
387text in the buffer changes to match. Enough @kbd{M-y} commands can move
388the pointer to any entry in the ring, so you can get any entry into the
389buffer. Eventually the pointer reaches the end of the ring; the next
390@kbd{M-y} loops back around to the first entry again.
391
392 @kbd{M-y} moves the ``last yank'' pointer around the ring, but it does
393not change the order of the entries in the ring, which always runs from
394the most recent kill at the front to the oldest one still remembered.
395
396 @kbd{M-y} can take a numeric argument, which tells it how many entries
397to advance the ``last yank'' pointer by. A negative argument moves the
398pointer toward the front of the ring; from the front of the ring, it
399moves ``around'' to the last entry and continues forward from there.
400
401 Once the text you are looking for is brought into the buffer, you can
402stop doing @kbd{M-y} commands and it will stay there. It's just a copy
403of the kill ring entry, so editing it in the buffer does not change
404what's in the ring. As long as no new killing is done, the ``last
405yank'' pointer remains at the same place in the kill ring, so repeating
406@kbd{C-y} will yank another copy of the same previous kill.
407
408 If you know how many @kbd{M-y} commands it would take to find the
409text you want, you can yank that text in one step using @kbd{C-y} with
410a numeric argument. @kbd{C-y} with an argument restores the text from
411the specified kill ring entry, counting back from the most recent as
4121. Thus, @kbd{C-u 2 C-y} gets the next-to-the-last block of killed
413text---it is equivalent to @kbd{C-y M-y}. @kbd{C-y} with a numeric
414argument starts counting from the ``last yank'' pointer, and sets the
415``last yank'' pointer to the entry that it yanks.
416
417@vindex kill-ring-max
418 The length of the kill ring is controlled by the variable
419@code{kill-ring-max}; no more than that many blocks of killed text are
420saved.
421
422@vindex kill-ring
423 The actual contents of the kill ring are stored in a variable named
424@code{kill-ring}; you can view the entire contents of the kill ring with
425the command @kbd{C-h v kill-ring}.
426
427@node Cut and Paste 427@node Cut and Paste
428@section ``Cut and Paste'' Operations on Graphical Displays 428@section ``Cut and Paste'' Operations on Graphical Displays
429@cindex cut 429@cindex cut
@@ -462,7 +462,7 @@ and yank commands in Emacs make use of it.
462 When you kill some text with a command such as @kbd{C-w} 462 When you kill some text with a command such as @kbd{C-w}
463(@code{kill-region}), or copy it to the kill ring with a command such 463(@code{kill-region}), or copy it to the kill ring with a command such
464as @kbd{M-w} (@code{kill-ring-save}), that text is also put in the 464as @kbd{M-w} (@code{kill-ring-save}), that text is also put in the
465clipboard. @xref{Killing}. 465clipboard.
466 466
467@vindex save-interprogram-paste-before-kill 467@vindex save-interprogram-paste-before-kill
468 When an Emacs kill command puts text in the clipboard, the existing 468 When an Emacs kill command puts text in the clipboard, the existing
@@ -472,12 +472,11 @@ will first save the clipboard to its kill ring, preventing you from
472losing the old clipboard data---at the risk of high memory consumption 472losing the old clipboard data---at the risk of high memory consumption
473if that data turns out to be large. 473if that data turns out to be large.
474 474
475 The usual yank commands, such as @kbd{C-y} (@code{yank}), also use 475 Yank commands, such as @kbd{C-y} (@code{yank}), also use the
476the clipboard. If another application ``owns'' the clipboard---i.e., 476clipboard. If another application ``owns'' the clipboard---i.e., if
477if you cut or copied text there more recently than your last kill 477you cut or copied text there more recently than your last kill command
478command in Emacs---then Emacs yanks from the clipboard instead of the 478in Emacs---then Emacs yanks from the clipboard instead of the kill
479kill ring. Otherwise, it yanks from the kill ring, as described in 479ring.
480@ref{Yanking}.
481 480
482@vindex yank-pop-change-selection 481@vindex yank-pop-change-selection
483 Normally, rotating the kill ring with @kbd{M-y} (@code{yank-pop}) 482 Normally, rotating the kill ring with @kbd{M-y} (@code{yank-pop})
@@ -511,20 +510,20 @@ yanks the contents of the clipboard at point.
511@cindex primary selection 510@cindex primary selection
512@cindex selection, primary 511@cindex selection, primary
513 512
514 Under the X window system, there exists a @dfn{primary selection} 513 Under the X Window System, there exists a @dfn{primary selection}
515containing the last stretch of text selected in an X application 514containing the last stretch of text selected in an X application
516(usually by dragging the mouse). Typically, this text can be inserted 515(usually by dragging the mouse). Typically, this text can be inserted
517into other X applications by @kbd{mouse-2} clicks. The primary 516into other X applications by @kbd{mouse-2} clicks. The primary
518selection is separate from the clipboard (@pxref{Clipboard}). Its 517selection is separate from the clipboard. Its contents are more
519contents are more ``fragile''; they are overwritten by any mouse 518``fragile''; they are overwritten each time you select text with the
520selection, whereas the clipboard is only overwritten by explicit 519mouse, whereas the clipboard is only overwritten by explicit ``cut''
521``cut'' or ``copy'' commands. 520or ``copy'' commands.
522 521
523 Under X, whenever you set an active region (@pxref{Mark}), Emacs 522 Under X, whenever the region is active (@pxref{Mark}), the text in
524saves the text in the active region to the primary selection. This 523the region is saved in the primary selection. This applies regardless
525applies to active regions made by dragging or clicking the mouse 524of whether the region was made by dragging or clicking the mouse
526(@pxref{Mouse Commands}), and those made by keyboard commands (e.g. by 525(@pxref{Mouse Commands}), or by keyboard commands (e.g. by typing
527typing @kbd{C-@key{SPC}} and moving point; see @ref{Setting Mark}). 526@kbd{C-@key{SPC}} and moving point; @pxref{Setting Mark}).
528 527
529@vindex select-active-regions 528@vindex select-active-regions
530 If you change the variable @code{select-active-regions} to 529 If you change the variable @code{select-active-regions} to
@@ -636,9 +635,9 @@ starting from wherever point happens to be at that moment.
636successive uses of @code{append-to-buffer} accumulate the text in the 635successive uses of @code{append-to-buffer} accumulate the text in the
637specified buffer in the same order as they were copied. Strictly 636specified buffer in the same order as they were copied. Strictly
638speaking, @code{append-to-buffer} does not always append to the text 637speaking, @code{append-to-buffer} does not always append to the text
639already in the buffer---it appends only if point in that buffer is at the end. 638already in the buffer---it appends only if point in that buffer is at
640However, if @code{append-to-buffer} is the only command you use to alter 639the end. However, if @code{append-to-buffer} is the only command you
641a buffer, then point is always at the end. 640use to alter a buffer, then point is always at the end.
642 641
643 @kbd{M-x prepend-to-buffer} is just like @code{append-to-buffer} 642 @kbd{M-x prepend-to-buffer} is just like @code{append-to-buffer}
644except that point in the other buffer is left before the copied text, so 643except that point in the other buffer is left before the copied text, so
@@ -682,19 +681,16 @@ them. Rectangle commands are useful with text in multicolumn formats,
682and for changing text into or out of such formats. 681and for changing text into or out of such formats.
683 682
684@cindex mark rectangle 683@cindex mark rectangle
685 When you must specify a rectangle for a command to work on, you do it 684 To specify a rectangle for a command to work on, set the mark at one
686by putting the mark at one corner and point at the opposite corner. The 685corner and point at the opposite corner. The rectangle thus specified
687rectangle thus specified is called the @dfn{region-rectangle} because 686is called the @dfn{region-rectangle}. If point and the mark are in
688you control it in much the same way as the region is controlled. But 687the same column, the region-rectangle is empty. If they are in the
689remember that a given combination of point and mark values can be 688same line, the region-rectangle is one line high.
690interpreted either as a region or as a rectangle, depending on the 689
691command that uses them. 690 The region-rectangle is controlled in much the same way as the
692 691region is controlled. But remember that a given combination of point
693 If point and the mark are in the same column, the rectangle they 692and mark values can be interpreted either as a region or as a
694delimit is empty. If they are in the same line, the rectangle is one 693rectangle, depending on the command that uses them.
695line high. This asymmetry between lines and columns comes about
696because point (and likewise the mark) is between two columns, but within
697a line.
698 694
699@table @kbd 695@table @kbd
700@item C-x r k 696@item C-x r k
@@ -708,7 +704,11 @@ Yank the last killed rectangle with its upper left corner at point
708@item C-x r o 704@item C-x r o
709Insert blank space to fill the space of the region-rectangle 705Insert blank space to fill the space of the region-rectangle
710(@code{open-rectangle}). This pushes the previous contents of the 706(@code{open-rectangle}). This pushes the previous contents of the
711region-rectangle rightward. 707region-rectangle to the right.
708@item C-x r N
709Insert line numbers along the left edge of the region-rectangle
710(@code{rectangle-number-lines}). This pushes the previous contents of
711the region-rectangle to the right.
712@item C-x r c 712@item C-x r c
713Clear the region-rectangle by replacing all of its contents with spaces 713Clear the region-rectangle by replacing all of its contents with spaces
714(@code{clear-rectangle}). 714(@code{clear-rectangle}).
@@ -722,42 +722,39 @@ Replace rectangle contents with @var{string} on each line
722Insert @var{string} on each line of the rectangle. 722Insert @var{string} on each line of the rectangle.
723@end table 723@end table
724 724
725 The rectangle operations fall into two classes: commands for 725 The rectangle operations fall into two classes: commands to erase or
726deleting and inserting rectangles, and commands for blank rectangles. 726insert rectangles, and commands to make blank rectangles.
727 727
728@kindex C-x r k 728@kindex C-x r k
729@kindex C-x r d 729@kindex C-x r d
730@findex kill-rectangle 730@findex kill-rectangle
731@findex delete-rectangle 731@findex delete-rectangle
732 There are two ways to get rid of the text in a rectangle: you can 732 There are two ways to erase the text in a rectangle: @kbd{C-x r d}
733discard the text (delete it) or save it as the ``last killed'' 733(@code{delete-rectangle}) to delete the text outright, or @kbd{C-x r
734rectangle. The commands for these two ways are @kbd{C-x r d} 734k} (@code{kill-rectangle}) to remove the text and and save it as the
735(@code{delete-rectangle}) and @kbd{C-x r k} (@code{kill-rectangle}). In 735@dfn{last killed rectangle}. In both cases, erasing the
736either case, the portion of each line that falls inside the rectangle's 736region-rectangle is like erasing the specified text on each line of
737boundaries is deleted, causing any following text on the line to 737the rectange; if there is any following text on the line, it moves
738move left into the gap. 738backwards to fill the gap.
739 739
740 Note that ``killing'' a rectangle is not killing in the usual sense; the 740 ``Killing'' a rectangle is not killing in the usual sense; the
741rectangle is not stored in the kill ring, but in a special place that 741rectangle is not stored in the kill ring, but in a special place that
742can only record the most recent rectangle killed. This is because yanking 742only records the most recent rectangle killed. This is because
743a rectangle is so different from yanking linear text that different yank 743yanking a rectangle is so different from yanking linear text that
744commands have to be used. It is hard to define yank-popping for rectangles, 744different yank commands have to be used. Yank-popping is not defined
745so we do not try. 745for rectangles.
746 746
747@kindex C-x r y 747@kindex C-x r y
748@findex yank-rectangle 748@findex yank-rectangle
749 To yank the last killed rectangle, type @kbd{C-x r y} 749 To yank the last killed rectangle, type @kbd{C-x r y}
750(@code{yank-rectangle}). Yanking a rectangle is the opposite of killing 750(@code{yank-rectangle}). The rectangle's first line is inserted at
751one. Point specifies where to put the rectangle's upper left corner. 751point, the rectangle's second line is inserted at the same horizontal
752The rectangle's first line is inserted there, the rectangle's second 752position one line vertically below, and so on. The number of lines
753line is inserted at the same horizontal position, but one line 753affected is determined by the height of the saved rectangle.
754vertically down, and so on. The number of lines affected is determined 754
755by the height of the saved rectangle. 755 For example, you can convert two single-column lists into a
756 756double-column list by killing one of the single-column lists as a
757 You can convert single-column lists into double-column lists using 757rectangle, and then yanking it beside the other list.
758rectangle killing and yanking; kill the second half of the list as a
759rectangle and then yank it beside the first line of the list.
760@xref{Two-Column}, for another way to edit multi-column text.
761 758
762 You can also copy rectangles into and out of registers with @kbd{C-x r 759 You can also copy rectangles into and out of registers with @kbd{C-x r
763r @var{r}} and @kbd{C-x r i @var{r}}. @xref{Rectangle Registers}. 760r @var{r}} and @kbd{C-x r i @var{r}}. @xref{Rectangle Registers}.
@@ -767,17 +764,26 @@ r @var{r}} and @kbd{C-x r i @var{r}}. @xref{Rectangle Registers}.
767@kindex C-x r c 764@kindex C-x r c
768@findex clear-rectangle 765@findex clear-rectangle
769 There are two commands you can use for making blank rectangles: 766 There are two commands you can use for making blank rectangles:
770@kbd{C-x r c} (@code{clear-rectangle}) which blanks out existing text, 767@kbd{C-x r c} (@code{clear-rectangle}) blanks out existing text in the
771and @kbd{C-x r o} (@code{open-rectangle}) which inserts a blank 768region-rectangle, and @kbd{C-x r o} (@code{open-rectangle}) inserts a
772rectangle. Clearing a rectangle is equivalent to deleting it and then 769blank rectangle.
773inserting a blank rectangle of the same size.
774 770
775@findex delete-whitespace-rectangle 771@findex delete-whitespace-rectangle
776 The command @kbd{M-x delete-whitespace-rectangle} deletes horizontal 772 @kbd{M-x delete-whitespace-rectangle} deletes horizontal whitespace
777whitespace starting from a particular column. This applies to each of 773starting from a particular column. This applies to each of the lines
778the lines in the rectangle, and the column is specified by the left 774in the rectangle, and the column is specified by the left edge of the
779edge of the rectangle. The right edge of the rectangle does not make 775rectangle. The right edge of the rectangle does not make any
780any difference to this command. 776difference to this command.
777
778@kindex C-x r N
779@findex rectangle
780 The command @kbd{C-x r N} (@code{rectangle-number-lines}) inserts
781line numbers along the left edge of the region-rectangle. Normally,
782the numbering begins from 1 (for the first line of the rectangle).
783With a prefix argument, the command prompts for a number to begin
784from, and for a format string with which to print the numbers
785(@pxref{Formatting Strings,,, elisp, The Emacs Lisp Reference
786Manual}).
781 787
782@kindex C-x r t 788@kindex C-x r t
783@findex string-rectangle 789@findex string-rectangle
@@ -801,18 +807,25 @@ shifting the original text to the right.
801@vindex cua-enable-cua-keys 807@vindex cua-enable-cua-keys
802 The command @kbd{M-x cua-mode} sets up key bindings that are 808 The command @kbd{M-x cua-mode} sets up key bindings that are
803compatible with the Common User Access (CUA) system used in many other 809compatible with the Common User Access (CUA) system used in many other
804applications. @kbd{C-x} means cut (kill), @kbd{C-c} copy, @kbd{C-v} 810applications.
805paste (yank), and @kbd{C-z} undo. Standard Emacs commands like 811
806@kbd{C-x C-c} still work, because @kbd{C-x} and @kbd{C-c} only take 812 When CUA mode is enabled, the keys @kbd{C-x}, @kbd{C-c}, @kbd{C-v},
807effect when the mark is active (and the region is highlighted). 813and @kbd{C-z} invoke commands that cut (kill), copy, paste (yank), and
808However, if you don't want to override these bindings in Emacs at all, 814undo respectively. The @kbd{C-x} and @kbd{C-c} keys perform cut and
809set @code{cua-enable-cua-keys} to @code{nil}. 815copy only if the region is active. Otherwise, they still act as
816prefix keys, so that standard Emacs commands like @kbd{C-x C-c} still
817work. Note that this means the variable @code{mark-even-if-inactive}
818has no effect for @kbd{C-x} and @kbd{C-c} (@pxref{Using Region}).
810 819
811 To enter an Emacs command like @kbd{C-x C-f} while the mark is 820 To enter an Emacs command like @kbd{C-x C-f} while the mark is
812active, use one of the following methods: either hold @kbd{Shift} 821active, use one of the following methods: either hold @kbd{Shift}
813together with the prefix key, e.g. @kbd{S-C-x C-f}, or quickly type 822together with the prefix key, e.g. @kbd{S-C-x C-f}, or quickly type
814the prefix key twice, e.g. @kbd{C-x C-x C-f}. 823the prefix key twice, e.g. @kbd{C-x C-x C-f}.
815 824
825 To disable the overriding of standard Emacs binding by CUA mode,
826while retaining the other features of CUA mode described below, set
827the variable @code{cua-enable-cua-keys} to @code{nil}.
828
816 In CUA mode, typed text replaces the active region as in 829 In CUA mode, typed text replaces the active region as in
817Delete-Selection mode (@pxref{Mouse Commands}). 830Delete-Selection mode (@pxref{Mouse Commands}).
818 831
diff --git a/doc/emacs/mark.texi b/doc/emacs/mark.texi
index 21d90a3fc79..0eccef41711 100644
--- a/doc/emacs/mark.texi
+++ b/doc/emacs/mark.texi
@@ -16,18 +16,22 @@ The region always extends between point and the mark, no matter which
16one comes earlier in the text; each time you move point, the region 16one comes earlier in the text; each time you move point, the region
17changes. 17changes.
18 18
19@cindex active region
19 Setting the mark at a position in the text also @dfn{activates} it. 20 Setting the mark at a position in the text also @dfn{activates} it.
20When the mark is active, Emacs indicates the extent of the region by 21When the mark is active, we say also that the region is active; Emacs
21highlighting the text within it, using the @code{region} face 22indicates its extent by highlighting the text within it, using the
22(@pxref{Face Customization}). After certain non-motion commands, 23@code{region} face (@pxref{Face Customization}).
23including any command that changes the text in the buffer, Emacs 24
24automatically @dfn{deactivates} the mark; this turns off the 25 After certain non-motion commands, including any command that
25highlighting. You can also explicitly deactivate the mark at any 26changes the text in the buffer, Emacs automatically @dfn{deactivates}
26time, by typing @kbd{C-g} (@pxref{Quitting}). 27the mark; this turns off the highlighting. You can also explicitly
27 28deactivate the mark at any time, by typing @kbd{C-g}
28 This default behavior is known as Transient Mark mode. Disabling 29(@pxref{Quitting}).
29Transient Mark mode switches Emacs to an alternative behavior, in 30
30which the region is usually not highlighted. @xref{Disabled Transient Mark}. 31 The above default behavior is known as Transient Mark mode.
32Disabling Transient Mark mode switches Emacs to an alternative
33behavior, in which the region is usually not highlighted.
34@xref{Disabled Transient Mark}.
31 35
32@vindex highlight-nonselected-windows 36@vindex highlight-nonselected-windows
33 Setting the mark in one buffer has no effect on the marks in other 37 Setting the mark in one buffer has no effect on the marks in other
@@ -141,10 +145,10 @@ can tell that a command does this when it shows @samp{Mark set} in the
141echo area. 145echo area.
142 146
143@cindex primary selection 147@cindex primary selection
144 Under X, every time the region changes while the mark is active, 148 Under X, every time the active region changes, Emacs saves the text
145Emacs saves the text in the region to the @dfn{primary selection}. 149in the region to the @dfn{primary selection}. This lets you insert
146This lets you insert that text into other X applications with 150that text into other X applications with @kbd{mouse-2} clicks.
147@kbd{mouse-2} clicks. @xref{Primary Selection}. 151@xref{Primary Selection}.
148 152
149@node Marking Objects 153@node Marking Objects
150@section Commands to Mark Textual Objects 154@section Commands to Mark Textual Objects
@@ -243,18 +247,30 @@ Save it in a buffer or a file (@pxref{Accumulating Text}).
243@end itemize 247@end itemize
244 248
245 Some commands have a default behavior when the mark is inactive, but 249 Some commands have a default behavior when the mark is inactive, but
246operate on the text in the region if the mark is active. For example, 250operate on the region if the mark is active. For example, @kbd{M-$}
247@kbd{M-$} (@code{ispell-word}) normally checks the spelling of the 251(@code{ispell-word}) normally checks the spelling of the word at
248word at point, but it checks the text in the region if the region is 252point, but it checks the text in the region if the mark is active
249active (@pxref{Spelling}). Normally, such commands use their default 253(@pxref{Spelling}). Normally, such commands use their default
250behavior if the region is empty (i.e., if mark and point are at the 254behavior if the region is empty (i.e., if mark and point are at the
251same position). If you want them to operate on the empty region, 255same position). If you want them to operate on the empty region,
252change the variable @code{use-empty-active-region} to @code{t}. 256change the variable @code{use-empty-active-region} to @code{t}.
253 257
258@vindex delete-active-region
259 As described in @ref{Erasing}, the @key{DEL}
260(@code{backward-delete-char}) and @key{delete}
261(@code{delete-forward-char}) commands also act this way. If the mark
262is active, they delete the text in the region. (As an exception, if
263you supply a numeric argument @var{n}, where @var{n} is not one, these
264commands delete @var{n} characters regardless of whether the mark is
265active). If you change the variable @code{delete-active-region} to
266@code{nil}, then these commands don't act differently when the mark is
267active. If you change the value to @code{kill}, these commands
268@dfn{kill} the region instead of deleting it (@pxref{Killing}).
269
254@vindex mark-even-if-inactive 270@vindex mark-even-if-inactive
255 Other commands always operate on the text in the region, and have no 271 Other commands always operate on the region, and have no default
256default behavior. Such commands usually have the word @code{region} 272behavior. Such commands usually have the word @code{region} in their
257in their names, like @kbd{C-w} (@code{kill-region}) and @code{C-x C-u} 273names, like @kbd{C-w} (@code{kill-region}) and @code{C-x C-u}
258(@code{upcase-region}). If the mark is inactive, they operate on the 274(@code{upcase-region}). If the mark is inactive, they operate on the
259``inactive region''---that is, on the text between point and the 275``inactive region''---that is, on the text between point and the
260position at which the mark was last set (@pxref{Mark Ring}). To 276position at which the mark was last set (@pxref{Mark Ring}). To
diff --git a/doc/emacs/mule.texi b/doc/emacs/mule.texi
index 29b6c69e38f..f676f0b96ce 100644
--- a/doc/emacs/mule.texi
+++ b/doc/emacs/mule.texi
@@ -81,8 +81,8 @@ appropriate keyboard coding system (@pxref{Terminal Coding}), and Emacs
81will accept those characters. Latin-1 characters can also be input by 81will accept those characters. Latin-1 characters can also be input by
82using the @kbd{C-x 8} prefix, see @ref{Unibyte Mode}. 82using the @kbd{C-x 8} prefix, see @ref{Unibyte Mode}.
83 83
84On X Window systems, your locale should be set to an appropriate value 84On the X Window System, your locale should be set to an appropriate
85to make sure Emacs interprets keyboard input correctly; see 85value to make sure Emacs interprets keyboard input correctly; see
86@ref{Language Environments, locales}. 86@ref{Language Environments, locales}.
87@end itemize 87@end itemize
88 88
diff --git a/doc/lispref/ChangeLog b/doc/lispref/ChangeLog
index fa5aac6e9ec..345e69e6989 100644
--- a/doc/lispref/ChangeLog
+++ b/doc/lispref/ChangeLog
@@ -1,3 +1,10 @@
12011-10-13 Chong Yidong <cyd@stupidchicken.com>
2
3 * text.texi (Yanking): Document yank-excluded-properties.
4
5 * package.texi (Packaging Basics): The commentary should say how
6 to begin using the package.
7
12011-10-11 Martin Rudalics <rudalics@gmx.at> 82011-10-11 Martin Rudalics <rudalics@gmx.at>
2 9
3 * windows.texi (Deleting Windows): Mention which window gets 10 * windows.texi (Deleting Windows): Mention which window gets
diff --git a/doc/lispref/package.texi b/doc/lispref/package.texi
index 62fbc2a9a07..5533f8ab5fa 100644
--- a/doc/lispref/package.texi
+++ b/doc/lispref/package.texi
@@ -63,7 +63,8 @@ should occupy a single line, ideally in 36 characters or less.
63This is shown in the buffer created by @kbd{C-h P} 63This is shown in the buffer created by @kbd{C-h P}
64(@code{describe-package}), following the package's brief description 64(@code{describe-package}), following the package's brief description
65and installation status. It normally spans multiple lines, and should 65and installation status. It normally spans multiple lines, and should
66fully describe the package and its capabilities. 66fully describe the package's capabilities and how to begin using it
67once it is installed.
67 68
68@item Dependencies 69@item Dependencies
69A list of other packages (possibly including minimal acceptable 70A list of other packages (possibly including minimal acceptable
diff --git a/doc/lispref/text.texi b/doc/lispref/text.texi
index 2348e3706dc..3a081dddc61 100644
--- a/doc/lispref/text.texi
+++ b/doc/lispref/text.texi
@@ -907,10 +907,11 @@ text that they copy into the buffer.
907 907
908@defun insert-for-yank string 908@defun insert-for-yank string
909This function normally works like @code{insert} except that it doesn't 909This function normally works like @code{insert} except that it doesn't
910insert the text properties in the @code{yank-excluded-properties} 910insert the text properties (@pxref{Text Properties}) in the list
911list. However, if any part of @var{string} has a non-@code{nil} 911variable @code{yank-excluded-properties}. However, if any part of
912@code{yank-handler} text property, that property can do various 912@var{string} has a non-@code{nil} @code{yank-handler} text property,
913special processing on that part of the text being inserted. 913that property can do various special processing on that part of the
914text being inserted.
914@end defun 915@end defun
915 916
916@defun insert-buffer-substring-as-yank buf &optional start end 917@defun insert-buffer-substring-as-yank buf &optional start end
@@ -958,6 +959,15 @@ region. @var{function} can set @code{yank-undo-function} to override
958the @var{undo} value. 959the @var{undo} value.
959@end table 960@end table
960 961
962@cindex yanking and text properties
963@defopt yank-excluded-properties
964Yanking discards certain text properties from the yanked text, as
965described above. The value of this variable is the list of properties
966to discard. Its default value contains properties that might lead to
967annoying results, such as causing the text to respond to the mouse or
968specifying key bindings.
969@end defopt
970
961@node Yank Commands 971@node Yank Commands
962@comment node-name, next, previous, up 972@comment node-name, next, previous, up
963@subsection Functions for Yanking 973@subsection Functions for Yanking
diff --git a/doc/misc/ChangeLog b/doc/misc/ChangeLog
index 294c6472000..02c2d2b8750 100644
--- a/doc/misc/ChangeLog
+++ b/doc/misc/ChangeLog
@@ -1,3 +1,16 @@
12011-10-14 Glenn Morris <rgm@gnu.org>
2
3 * ert.texi (Introduction, How to Run Tests)
4 (Running Tests Interactively, Expected Failures)
5 (Tests and Their Environment, Useful Techniques)
6 (Interactive Debugging, Fixtures and Test Suites):
7 Minor rephrasings.
8 (Running Tests Interactively, The @code{should} Macro): Add xrefs.
9 (Running Tests in Batch Mode): Simplify loading instructions.
10 (Test Selectors): Clarify some selectors.
11 (Expected Failures, Useful Techniques):
12 Make examples fit in 80 columns.
13
12011-10-13 Jay Belanger <jay.p.belanger@gmail.com> 142011-10-13 Jay Belanger <jay.p.belanger@gmail.com>
2 15
3 * calc.texi (Basic Operations on Units): Discuss temperature 16 * calc.texi (Basic Operations on Units): Discuss temperature
diff --git a/doc/misc/ert.texi b/doc/misc/ert.texi
index c9b624c6767..d1cecf1347a 100644
--- a/doc/misc/ert.texi
+++ b/doc/misc/ert.texi
@@ -82,8 +82,8 @@ Extending ERT
82 82
83Other Testing Concepts 83Other Testing Concepts
84 84
85* Mocks and Stubs:: Stubbing out code that is irrelevant to the test. 85* Mocks and Stubs:: Stubbing out code that is irrelevant to the test.
86* Fixtures and Test Suites:: How ERT differs from tools for other languages. 86* Fixtures and Test Suites:: How ERT differs from tools for other languages.
87 87
88@end detailmenu 88@end detailmenu
89@end menu 89@end menu
@@ -133,8 +133,8 @@ will pass if the three calls to @code{equal} all return true
133@code{should} is a macro with the same meaning as @code{assert} but 133@code{should} is a macro with the same meaning as @code{assert} but
134better error reporting. @xref{The @code{should} Macro}. 134better error reporting. @xref{The @code{should} Macro}.
135 135
136Each test should have a name that describes what functionality the 136Each test should have a name that describes what functionality it tests.
137test tests. Test names can be chosen arbitrarily --- they are in a 137Test names can be chosen arbitrarily --- they are in a
138namespace separate from functions and variables --- but should follow 138namespace separate from functions and variables --- but should follow
139the usual Emacs Lisp convention of having a prefix that indicates 139the usual Emacs Lisp convention of having a prefix that indicates
140which package they belong to. Test names are displayed by ERT when 140which package they belong to. Test names are displayed by ERT when
@@ -142,7 +142,7 @@ reporting failures and can be used when selecting which tests to run.
142 142
143The empty parentheses @code{()} in the first line don't currently have 143The empty parentheses @code{()} in the first line don't currently have
144any meaning and are reserved for future extension. They also make 144any meaning and are reserved for future extension. They also make
145@code{ert-deftest}'s syntax more similar to @code{defun}. 145the syntax of @code{ert-deftest} more similar to that of @code{defun}.
146 146
147The docstring describes what feature this test tests. When running 147The docstring describes what feature this test tests. When running
148tests interactively, the first line of the docstring is displayed for 148tests interactively, the first line of the docstring is displayed for
@@ -163,14 +163,14 @@ You can run tests either in the Emacs you are working in, or on the
163command line in a separate Emacs process in batch mode (i.e., with no 163command line in a separate Emacs process in batch mode (i.e., with no
164user interface). The former mode is convenient during interactive 164user interface). The former mode is convenient during interactive
165development, the latter is useful to make sure that tests pass 165development, the latter is useful to make sure that tests pass
166independently of your customizations, allows tests to be invoked from 166independently of your customizations; and it allows you to invoke
167makefiles and scripts to be written that run tests in several 167tests from makefiles, and to write scripts that run tests in several
168different Emacs versions. 168different Emacs versions.
169 169
170@menu 170@menu
171* Running Tests Interactively:: Run tests in your current Emacs. 171* Running Tests Interactively:: Run tests in your current Emacs.
172* Running Tests in Batch Mode:: Run tests in emacs -Q. 172* Running Tests in Batch Mode:: Run tests in emacs -Q.
173* Test Selectors:: Choose which tests to run. 173* Test Selectors:: Choose which tests to run.
174@end menu 174@end menu
175 175
176 176
@@ -178,7 +178,8 @@ different Emacs versions.
178@section Running Tests Interactively 178@section Running Tests Interactively
179 179
180You can run the tests that are currently defined in your Emacs with 180You can run the tests that are currently defined in your Emacs with
181the command @kbd{@kbd{M-x} ert @kbd{RET} t @kbd{RET}}. ERT will pop 181the command @kbd{@kbd{M-x} ert @kbd{RET} t @kbd{RET}}. (For an
182explanation of the @code{t} argument, @pxref{Test Selectors}.) ERT will pop
182up a new buffer, the ERT results buffer, showing the results of the 183up a new buffer, the ERT results buffer, showing the results of the
183tests run. It looks like this: 184tests run. It looks like this:
184 185
@@ -219,10 +220,10 @@ F list-test
219 (different-atoms c d)))) 220 (different-atoms c d))))
220@end example 221@end example
221 222
222At the top, there is a summary of the results: We ran all tests in the 223At the top, there is a summary of the results: we ran all tests defined
223current Emacs (@code{Selector: t}), 31 of them passed, and 2 failed 224in the current Emacs (@code{Selector: t}), 31 of them passed, and 2
224unexpectedly. @xref{Expected Failures}, for an explanation of the 225failed unexpectedly. @xref{Expected Failures}, for an explanation of
225term @emph{unexpected} in this context. 226the term @emph{unexpected} in this context.
226 227
227The line of dots and @code{F}s is a progress bar where each character 228The line of dots and @code{F}s is a progress bar where each character
228represents one test; it fills while the tests are running. A dot 229represents one test; it fills while the tests are running. A dot
@@ -261,7 +262,7 @@ scripts or makefiles. There are two functions for this purpose,
261They can be used like this: 262They can be used like this:
262 263
263@example 264@example
264emacs -batch -L /path/to/ert -l ert.el -l my-tests.el -f ert-run-tests-batch-and-exit 265emacs -batch -l ert -l my-tests.el -f ert-run-tests-batch-and-exit
265@end example 266@end example
266 267
267This command will start up Emacs in batch mode, load ERT, load 268This command will start up Emacs in batch mode, load ERT, load
@@ -270,9 +271,10 @@ with a zero exit status if all tests passed, or nonzero if any tests
270failed or if anything else went wrong. It will also print progress 271failed or if anything else went wrong. It will also print progress
271messages and error diagnostics to standard output. 272messages and error diagnostics to standard output.
272 273
273You may need additional @code{-L} flags to ensure that 274If ERT is not part of your Emacs distribution, you may need to use
274@code{my-tests.el} and all the files that it requires are on your 275@code{-L /path/to/ert/} so that Emacs can find it. You may need
275@code{load-path}. 276additional @code{-L} flags to ensure that @code{my-tests.el} and all the
277files that it requires are on your @code{load-path}.
276 278
277 279
278@node Test Selectors, , Running Tests in Batch Mode, How to Run Tests 280@node Test Selectors, , Running Tests in Batch Mode, How to Run Tests
@@ -288,23 +290,26 @@ to Common Lisp's type specifier syntax:
288@item @code{:new} selects all tests that have not been run yet. 290@item @code{:new} selects all tests that have not been run yet.
289@item @code{:failed} and @code{:passed} select tests according to their most recent result. 291@item @code{:failed} and @code{:passed} select tests according to their most recent result.
290@item @code{:expected}, @code{:unexpected} select tests according to their most recent result. 292@item @code{:expected}, @code{:unexpected} select tests according to their most recent result.
291@item A string selects all tests that have a name that matches the string, a regexp. 293@item A string is a regular expression that selects all tests with matching names.
292@item A test selects that test. 294@item A test (i.e., an object of @code{ert-test} data type) selects that test.
293@item A symbol selects the test that the symbol names. 295@item A symbol selects the test that the symbol names.
294@item @code{(member TESTS...)} selects TESTS, a list of tests or symbols naming tests. 296@item @code{(member TESTS...)} selects the elements of TESTS, a list of
297tests or symbols naming tests.
295@item @code{(eql TEST)} selects TEST, a test or a symbol naming a test. 298@item @code{(eql TEST)} selects TEST, a test or a symbol naming a test.
296@item @code{(and SELECTORS...)} selects the tests that match all SELECTORS. 299@item @code{(and SELECTORS...)} selects the tests that match all SELECTORS.
297@item @code{(or SELECTORS...)} selects the tests that match any SELECTOR. 300@item @code{(or SELECTORS...)} selects the tests that match any SELECTOR.
298@item @code{(not SELECTOR)} selects all tests that do not match SELECTOR. 301@item @code{(not SELECTOR)} selects all tests that do not match SELECTOR.
299@item @code{(tag TAG)} selects all tests that have TAG on their tags list. 302@item @code{(tag TAG)} selects all tests that have TAG on their tags list.
300@item @code{(satisfies PREDICATE)} Selects all tests that satisfy PREDICATE. 303(Tags are optional labels you can apply to tests when you define them.)
304@item @code{(satisfies PREDICATE)} selects all tests that satisfy PREDICATE,
305a function that takes a test as argument and returns non-nil if it is selected.
301@end itemize 306@end itemize
302 307
303Selectors that are frequently useful when selecting tests to run 308Selectors that are frequently useful when selecting tests to run
304include @code{t} to run all tests that are currently defined in Emacs, 309include @code{t} to run all tests that are currently defined in Emacs,
305@code{"^foo-"} to run all tests in package @code{foo} --- this assumes 310@code{"^foo-"} to run all tests in package @code{foo} (this assumes
306that package @code{foo} uses the prefix @code{foo-} for its test names 311that package @code{foo} uses the prefix @code{foo-} for its test names),
307---, result-based selectors such as @code{(or :new :unexpected)} to 312result-based selectors such as @code{(or :new :unexpected)} to
308run all tests that have either not run yet or that had an unexpected 313run all tests that have either not run yet or that had an unexpected
309result in the last run, and tag-based selectors such as @code{(not 314result in the last run, and tag-based selectors such as @code{(not
310(tag :causes-redisplay))} to run all tests that are not tagged 315(tag :causes-redisplay))} to run all tests that are not tagged
@@ -325,9 +330,9 @@ to find where a test was defined if the test was loaded from a file.
325 330
326 331
327@menu 332@menu
328* The @code{should} Macro:: A powerful way to express assertions. 333* The @code{should} Macro:: A powerful way to express assertions.
329* Expected Failures:: Tests for known bugs. 334* Expected Failures:: Tests for known bugs.
330* Tests and Their Environment:: Don't depend on customizations; no side effects. 335* Tests and Their Environment:: Don't depend on customizations; no side effects.
331* Useful Techniques:: Some examples. 336* Useful Techniques:: Some examples.
332@end menu 337@end menu
333 338
@@ -335,10 +340,12 @@ to find where a test was defined if the test was loaded from a file.
335@section The @code{should} Macro 340@section The @code{should} Macro
336 341
337Test bodies can include arbitrary code; but to be useful, they need to 342Test bodies can include arbitrary code; but to be useful, they need to
338have checks whether the code being tested (or @emph{code under test}) 343check whether the code being tested (or @emph{code under test})
339does what it is supposed to do. The macro @code{should} is similar to 344does what it is supposed to do. The macro @code{should} is similar to
340@code{assert} from the cl package, but analyzes its argument form and 345@code{assert} from the cl package
341records information that ERT can display to help debugging. 346(@pxref{Assertions,,, cl, Common Lisp Extensions}),
347but analyzes its argument form and records information that ERT can
348display to help debugging.
342 349
343This test definition 350This test definition
344 351
@@ -396,7 +403,7 @@ default.
396@node Expected Failures, Tests and Their Environment, The @code{should} Macro, How to Write Tests 403@node Expected Failures, Tests and Their Environment, The @code{should} Macro, How to Write Tests
397@section Expected Failures 404@section Expected Failures
398 405
399Some bugs are complicated to fix or not very important and are left as 406Some bugs are complicated to fix, or not very important, and are left as
400@emph{known bugs}. If there is a test case that triggers the bug and 407@emph{known bugs}. If there is a test case that triggers the bug and
401fails, ERT will alert you of this failure every time you run all 408fails, ERT will alert you of this failure every time you run all
402tests. For known bugs, this alert is a distraction. The way to 409tests. For known bugs, this alert is a distraction. The way to
@@ -406,7 +413,7 @@ definition:
406@lisp 413@lisp
407(ert-deftest future-bug () 414(ert-deftest future-bug ()
408 "Test `time-forward' with negative arguments. 415 "Test `time-forward' with negative arguments.
409Since this functionality isn't implemented yet, the test is known to fail." 416Since this functionality isn't implemented, the test is known to fail."
410 :expected-result :failed 417 :expected-result :failed
411 (time-forward -1)) 418 (time-forward -1))
412@end lisp 419@end lisp
@@ -427,7 +434,7 @@ makes it much easier to fix the bug, demonstrate that it is fixed, and
427prevent future regressions. 434prevent future regressions.
428 435
429ERT displays the same kind of alerts for tests that pass unexpectedly 436ERT displays the same kind of alerts for tests that pass unexpectedly
430that it displays for unexpected failures. This way, if you make code 437as it displays for unexpected failures. This way, if you make code
431changes that happen to fix a bug that you weren't aware of, you will 438changes that happen to fix a bug that you weren't aware of, you will
432know to remove the @code{:expected-result} clause of that test and 439know to remove the @code{:expected-result} clause of that test and
433close the corresponding bug report, if any. 440close the corresponding bug report, if any.
@@ -453,8 +460,8 @@ The outcome of running a test should not depend on the current state
453of the environment, and each test should leave its environment in the 460of the environment, and each test should leave its environment in the
454same state it found it in. In particular, a test should not depend on 461same state it found it in. In particular, a test should not depend on
455any Emacs customization variables or hooks, and if it has to make any 462any Emacs customization variables or hooks, and if it has to make any
456changes to Emacs' state or state external to Emacs such as the file 463changes to Emacs's state or state external to Emacs (such as the file
457system, it should undo these changes before it returns, regardless of 464system), it should undo these changes before it returns, regardless of
458whether it passed or failed. 465whether it passed or failed.
459 466
460Tests should not depend on the environment because any such 467Tests should not depend on the environment because any such
@@ -462,14 +469,14 @@ dependencies can make the test brittle or lead to failures that occur
462only under certain circumstances and are hard to reproduce. Of 469only under certain circumstances and are hard to reproduce. Of
463course, the code under test may have settings that affect its 470course, the code under test may have settings that affect its
464behavior. In that case, it is best to make the test @code{let}-bind 471behavior. In that case, it is best to make the test @code{let}-bind
465all such settings variables to set up a specific configuration for the 472all such setting variables to set up a specific configuration for the
466duration of the test. The test can also set up a number of different 473duration of the test. The test can also set up a number of different
467configurations and run the code under test with each. 474configurations and run the code under test with each.
468 475
469Tests that have side effects on their environment should restore it to 476Tests that have side effects on their environment should restore it to
470its original state because any side effects that persist after the 477its original state because any side effects that persist after the
471test can disrupt the workflow of the programmer running the tests. If 478test can disrupt the workflow of the programmer running the tests. If
472the code under test has side effects on Emacs' current state, such as 479the code under test has side effects on Emacs's current state, such as
473on the current buffer or window configuration, the test should create 480on the current buffer or window configuration, the test should create
474a temporary buffer for the code to manipulate (using 481a temporary buffer for the code to manipulate (using
475@code{with-temp-buffer}), or save and restore the window configuration 482@code{with-temp-buffer}), or save and restore the window configuration
@@ -490,13 +497,13 @@ such commands are what they want to test. The exact behavior of
490@code{auto-mode-alist}. It is difficult to write a meaningful test if 497@code{auto-mode-alist}. It is difficult to write a meaningful test if
491its behavior can be affected by so many external factors. Also, 498its behavior can be affected by so many external factors. Also,
492@code{find-file} has side effects that are hard to predict and thus 499@code{find-file} has side effects that are hard to predict and thus
493hard to undo: It may create a new buffer or may reuse an existing 500hard to undo: It may create a new buffer or reuse an existing
494buffer if one is already visiting the requested file; and it runs 501buffer if one is already visiting the requested file; and it runs
495@code{find-file-hook}, which can have arbitrary side effects. 502@code{find-file-hook}, which can have arbitrary side effects.
496 503
497Instead, it is better to use lower-level mechanisms with simple and 504Instead, it is better to use lower-level mechanisms with simple and
498predictable semantics like @code{with-temp-buffer}, @code{insert} or 505predictable semantics like @code{with-temp-buffer}, @code{insert} or
499@code{insert-file-contents-literally}, and activating the desired mode 506@code{insert-file-contents-literally}, and to activate any desired mode
500by calling the corresponding function directly --- after binding the 507by calling the corresponding function directly --- after binding the
501hook variables to nil. This avoids the above problems. 508hook variables to nil. This avoids the above problems.
502 509
@@ -534,8 +541,10 @@ Here's a more complicated test:
534 (ert--print-backtrace (ert-test-failed-backtrace result)) 541 (ert--print-backtrace (ert-test-failed-backtrace result))
535 (goto-char (point-min)) 542 (goto-char (point-min))
536 (end-of-line) 543 (end-of-line)
537 (let ((first-line (buffer-substring-no-properties (point-min) (point)))) 544 (let ((first-line (buffer-substring-no-properties
538 (should (equal first-line " signal(ert-test-failed (\"foo\"))"))))))) 545 (point-min) (point))))
546 (should (equal first-line
547 " signal(ert-test-failed (\"foo\"))")))))))
539@end lisp 548@end lisp
540 549
541This test creates a test object using @code{make-ert-test} whose body 550This test creates a test object using @code{make-ert-test} whose body
@@ -562,7 +571,7 @@ under test was structured with testing in mind.
562For example, if @code{ert-run-test} accepted only symbols that name 571For example, if @code{ert-run-test} accepted only symbols that name
563tests rather than test objects, the test would need a name for the 572tests rather than test objects, the test would need a name for the
564failing test, which would have to be a temporary symbol generated with 573failing test, which would have to be a temporary symbol generated with
565@code{make-symbol}, to avoid side effects on Emacs' state. Choosing 574@code{make-symbol}, to avoid side effects on Emacs's state. Choosing
566the right interface for @code{ert-run-tests} allows the test to be 575the right interface for @code{ert-run-tests} allows the test to be
567simpler. 576simpler.
568 577
@@ -663,7 +672,7 @@ function registered. @xref{Defining Explanation Functions}.
663@node Interactive Debugging, , Understanding Explanations, How to Debug Tests 672@node Interactive Debugging, , Understanding Explanations, How to Debug Tests
664@section Interactive Debugging 673@section Interactive Debugging
665 674
666Debugging failed tests works essentially the same way as debugging any 675Debugging failed tests essentially works the same way as debugging any
667other problems with Lisp code. Here are a few tricks specific to 676other problems with Lisp code. Here are a few tricks specific to
668tests: 677tests:
669 678
@@ -673,8 +682,8 @@ each time. It's good to find out whether the behavior is
673deterministic before spending any time looking for a cause. In the 682deterministic before spending any time looking for a cause. In the
674ERT results buffer, @kbd{r} re-runs the selected test. 683ERT results buffer, @kbd{r} re-runs the selected test.
675 684
676@item Use @kbd{.} to jump to the source code of the test to find out what 685@item Use @kbd{.} to jump to the source code of the test to find out exactly
677exactly it does. Perhaps the test is broken rather than the code 686what it does. Perhaps the test is broken rather than the code
678under test. 687under test.
679 688
680@item If the test contains a series of @code{should} forms and you can't 689@item If the test contains a series of @code{should} forms and you can't
@@ -699,8 +708,8 @@ re-run the test with @kbd{r} or @kbd{d}.
699@item If you have been editing and rearranging tests, it is possible that 708@item If you have been editing and rearranging tests, it is possible that
700ERT remembers an old test that you have since renamed or removed --- 709ERT remembers an old test that you have since renamed or removed ---
701renamings or removals of definitions in the source code leave around a 710renamings or removals of definitions in the source code leave around a
702stray definition under the old name in the running process, this is a 711stray definition under the old name in the running process (this is a
703common problem in Lisp. In such a situation, hit @kbd{D} to let ERT 712common problem in Lisp). In such a situation, hit @kbd{D} to let ERT
704forget about the obsolete test. 713forget about the obsolete test.
705@end itemize 714@end itemize
706 715
@@ -739,14 +748,13 @@ explanation function.
739 748
740Both @code{ert-run-tests-interactively} and @code{ert-run-tests-batch} 749Both @code{ert-run-tests-interactively} and @code{ert-run-tests-batch}
741are implemented on top of the lower-level test handling code in the 750are implemented on top of the lower-level test handling code in the
742sections named ``Facilities for running a single test'', ``Test 751sections of @file{ert.el} labelled ``Facilities for running a single test'',
743selectors'', and ``Facilities for running a whole set of tests''. 752``Test selectors'', and ``Facilities for running a whole set of tests''.
744 753
745If you want to write code that works with ERT tests, you should take a 754If you want to write code that works with ERT tests, you should take a
746look at this lower-level code. Symbols that start with @code{ert--} 755look at this lower-level code. Symbols that start with @code{ert--}
747are internal to ERT, those that start with @code{ert-} but not 756are internal to ERT, whereas those that start with @code{ert-} are
748@code{ert--} are meant to be usable by other code. But there is no 757meant to be usable by other code. But there is no mature API yet.
749mature API yet.
750 758
751Contributions to ERT are welcome. 759Contributions to ERT are welcome.
752 760
@@ -758,8 +766,8 @@ For information on mocks, stubs, fixtures, or test suites, see below.
758 766
759 767
760@menu 768@menu
761* Mocks and Stubs:: Stubbing out code that is irrelevant to the test. 769* Mocks and Stubs:: Stubbing out code that is irrelevant to the test.
762* Fixtures and Test Suites:: How ERT differs from tools for other languages. 770* Fixtures and Test Suites:: How ERT differs from tools for other languages.
763@end menu 771@end menu
764 772
765@node Mocks and Stubs, Fixtures and Test Suites, Other Testing Concepts, Other Testing Concepts 773@node Mocks and Stubs, Fixtures and Test Suites, Other Testing Concepts, Other Testing Concepts
@@ -782,8 +790,8 @@ In many ways, ERT is similar to frameworks for other languages like
782SUnit or JUnit. However, two features commonly found in such 790SUnit or JUnit. However, two features commonly found in such
783frameworks are notably absent from ERT: fixtures and test suites. 791frameworks are notably absent from ERT: fixtures and test suites.
784 792
785Fixtures, as used e.g. in SUnit or JUnit, are mainly used to provide 793Fixtures are mainly used (e.g., in SUnit or JUnit) to provide an
786an environment for a set of tests, and consist of set-up and tear-down 794environment for a set of tests, and consist of set-up and tear-down
787functions. 795functions.
788 796
789While fixtures are a useful syntactic simplification in other 797While fixtures are a useful syntactic simplification in other
@@ -829,13 +837,13 @@ separating module namespaces in Emacs Lisp, test selectors already
829solve this by allowing regexp matching on test names; e.g., the 837solve this by allowing regexp matching on test names; e.g., the
830selector "^ert-" selects ERT's self-tests. 838selector "^ert-" selects ERT's self-tests.
831 839
832Other uses include grouping tests by their expected execution time to 840Other uses include grouping tests by their expected execution time,
833run quick tests during interactive development and slow tests less 841e.g. to run quick tests during interactive development and slow tests less
834frequently. This can be achieved with the @code{:tag} argument to 842often. This can be achieved with the @code{:tag} argument to
835@code{ert-deftest} and @code{tag} test selectors. 843@code{ert-deftest} and @code{tag} test selectors.
836 844
837@bye 845@bye
838 846
839@c LocalWords: ERT Hagelberg Ohler JUnit namespace docstring ERT's 847@c LocalWords: ERT JUnit namespace docstring ERT's
840@c LocalWords: backtrace makefiles workflow backtraces API SUnit 848@c LocalWords: backtrace makefiles workflow backtraces API SUnit
841@c LocalWords: subexpressions 849@c LocalWords: subexpressions
diff --git a/etc/NEWS b/etc/NEWS
index b9fed18355d..386462fe92e 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -459,16 +459,16 @@ bound to M-=, which shows the number of lines, words, and characters.
459also deletes newlines around point. 459also deletes newlines around point.
460 460
461** Deletion changes 461** Deletion changes
462 462+++
463*** New option `delete-active-region'. 463*** New option `delete-active-region'.
464If non-nil, [delete] and DEL delete the region if it is active and no 464If non-nil, [delete] and DEL delete the region if it is active and no
465prefix argument is given. If set to `kill', these commands kill 465prefix argument is given. If set to `kill', these commands kill
466instead. 466instead.
467 467+++
468*** New command `delete-forward-char', bound to [delete]. 468*** New command `delete-forward-char', bound to [delete].
469This is meant for interactive use, and obeys `delete-active-region'. 469This is meant for interactive use, and obeys `delete-active-region'.
470The command `delete-char' does not obey `delete-active-region'. 470The command `delete-char' does not obey `delete-active-region'.
471 471---
472*** `delete-backward-char' is now a Lisp function. 472*** `delete-backward-char' is now a Lisp function.
473Apart from obeying `delete-active-region', its behavior is unchanged. 473Apart from obeying `delete-active-region', its behavior is unchanged.
474However, the byte compiler now warns if it is called from Lisp; you 474However, the byte compiler now warns if it is called from Lisp; you
@@ -537,6 +537,7 @@ between applications.
537*** X clipboard managers are now supported. 537*** X clipboard managers are now supported.
538To inhibit this, change `x-select-enable-clipboard-manager' to nil. 538To inhibit this, change `x-select-enable-clipboard-manager' to nil.
539 539
540+++
540** New command `rectangle-number-lines', bound to `C-x r N', numbers 541** New command `rectangle-number-lines', bound to `C-x r N', numbers
541the lines in the current rectangle. With a prefix argument, this 542the lines in the current rectangle. With a prefix argument, this
542prompts for a number to count from and for a format string. 543prompts for a number to count from and for a format string.
@@ -947,6 +948,7 @@ variable `menu-bar-mode'/`tool-bar-mode' to determine whether to create
947a menu-bar or tool-bar, respectively. If the alist entries are added, 948a menu-bar or tool-bar, respectively. If the alist entries are added,
948they override the value of `menu-bar-mode'/`tool-bar-mode'. 949they override the value of `menu-bar-mode'/`tool-bar-mode'.
949 950
951+++
950** Regions created by mouse dragging are now normal active regions, 952** Regions created by mouse dragging are now normal active regions,
951similar to the ones created by shift-selection. In previous Emacs 953similar to the ones created by shift-selection. In previous Emacs
952versions, these regions were delineated by `mouse-drag-overlay', which 954versions, these regions were delineated by `mouse-drag-overlay', which
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 10570c2a878..68a85a43387 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,8 @@
12011-10-13 Agustín Martín Domingo <agustin.martin@hispalinux.es>
2
3 * textmodes/flyspell.el (flyspell-large-region): Make sure
4 extended character mode is used if defined (Bug#1339).
5
12011-10-13 Eli Zaretskii <eliz@gnu.org> 62011-10-13 Eli Zaretskii <eliz@gnu.org>
2 7
3 * simple.el (what-cursor-position): Fix the display of the 8 * simple.el (what-cursor-position): Fix the display of the
diff --git a/lisp/textmodes/flyspell.el b/lisp/textmodes/flyspell.el
index c2af3f7be84..d496298768d 100644
--- a/lisp/textmodes/flyspell.el
+++ b/lisp/textmodes/flyspell.el
@@ -1559,6 +1559,14 @@ The buffer to mark them in is `flyspell-large-region-buffer'."
1559 (list "-p" 1559 (list "-p"
1560 (expand-file-name 1560 (expand-file-name
1561 ispell-current-personal-dictionary))))) 1561 ispell-current-personal-dictionary)))))
1562
1563 ;; Check for extended character mode
1564 (let ((extended-char-mode (ispell-get-extended-character-mode)))
1565 (and extended-char-mode ; ~ extended character mode
1566 (string-match "[^~]+$" extended-char-mode)
1567 (add-to-list 'args (concat "-T" (match-string 0 extended-char-mode)))))
1568
1569 ;; Add ispell-extra-args
1562 (setq args (append args ispell-extra-args)) 1570 (setq args (append args ispell-extra-args))
1563 1571
1564 ;; If we are using recent aspell or hunspell, make sure we use the right encoding 1572 ;; If we are using recent aspell or hunspell, make sure we use the right encoding
diff --git a/lwlib/ChangeLog b/lwlib/ChangeLog
index 7e332a9fd5d..3b494865f0c 100644
--- a/lwlib/ChangeLog
+++ b/lwlib/ChangeLog
@@ -1,3 +1,13 @@
12011-10-13 Dmitry Antipov <dmantipov@yandex.ru>
2
3 * lwlib-Xaw.c (openFont, xaw_destroy_instance): Replace free with
4 xfree to avoid crash when xmalloc overrun checking is enabled.
5 * lwlib-Xm.c (free_destroyed_instance, xm_update_one_value): Ditto.
6 * lwlib-utils.c (XtApplyToWidgets): Ditto.
7 * lwlib.c (safe_free_str, free_widget_value, free_widget_value_tree)
8 (free_widget_info, free_widget_instance, name_to_widget): Ditto.
9 * xlwmenu.c (openXftFont): Ditto.
10
12011-06-27 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> 112011-06-27 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
2 12
3 * Makefile.in (ALL_CFLAGS): Add -I../lib for generated header files 13 * Makefile.in (ALL_CFLAGS): Add -I../lib for generated header files
diff --git a/lwlib/lwlib-Xaw.c b/lwlib/lwlib-Xaw.c
index 9c9a007bc15..0eea0aba7b6 100644
--- a/lwlib/lwlib-Xaw.c
+++ b/lwlib/lwlib-Xaw.c
@@ -136,7 +136,7 @@ openFont (Widget widget, char *name)
136 } 136 }
137 137
138 fn = XftFontOpenName (XtDisplay (widget), screen, fname); 138 fn = XftFontOpenName (XtDisplay (widget), screen, fname);
139 if (fname != name) free (fname); 139 if (fname != name) xfree (fname);
140 140
141 return fn; 141 return fn;
142} 142}
@@ -384,7 +384,7 @@ xaw_destroy_instance (widget_instance *instance)
384 if (instance->xft_data[0].xft_font) 384 if (instance->xft_data[0].xft_font)
385 XftFontClose (XtDisplay (instance->widget), 385 XftFontClose (XtDisplay (instance->widget),
386 instance->xft_data[0].xft_font); 386 instance->xft_data[0].xft_font);
387 free (instance->xft_data); 387 xfree (instance->xft_data);
388 } 388 }
389#endif 389#endif
390 if (XtIsSubclass (instance->widget, dialogWidgetClass)) 390 if (XtIsSubclass (instance->widget, dialogWidgetClass))
diff --git a/lwlib/lwlib-Xm.c b/lwlib/lwlib-Xm.c
index 2b7677a02f5..058e2e779c7 100644
--- a/lwlib/lwlib-Xm.c
+++ b/lwlib/lwlib-Xm.c
@@ -186,9 +186,9 @@ make_destroyed_instance (char* name,
186static void 186static void
187free_destroyed_instance (destroyed_instance* instance) 187free_destroyed_instance (destroyed_instance* instance)
188{ 188{
189 free (instance->name); 189 xfree (instance->name);
190 free (instance->type); 190 xfree (instance->type);
191 free (instance); 191 xfree (instance);
192} 192}
193 193
194 /* motif utility functions */ 194 /* motif utility functions */
@@ -928,13 +928,13 @@ xm_update_one_value (widget_instance* instance,
928 } 928 }
929 else if (class == xmTextWidgetClass) 929 else if (class == xmTextWidgetClass)
930 { 930 {
931 free (val->value); 931 xfree (val->value);
932 val->value = XmTextGetString (widget); 932 val->value = XmTextGetString (widget);
933 val->edited = True; 933 val->edited = True;
934 } 934 }
935 else if (class == xmTextFieldWidgetClass) 935 else if (class == xmTextFieldWidgetClass)
936 { 936 {
937 free (val->value); 937 xfree (val->value);
938 val->value = XmTextFieldGetString (widget); 938 val->value = XmTextFieldGetString (widget);
939 val->edited = True; 939 val->edited = True;
940 } 940 }
@@ -959,7 +959,7 @@ xm_update_one_value (widget_instance* instance,
959 XtVaGetValues (toggle, XmNset, &set, NULL); 959 XtVaGetValues (toggle, XmNset, &set, NULL);
960 if (set) 960 if (set)
961 { 961 {
962 free (val->value); 962 xfree (val->value);
963 val->value = safe_strdup (XtName (toggle)); 963 val->value = safe_strdup (XtName (toggle));
964 } 964 }
965 } 965 }
diff --git a/lwlib/lwlib-utils.c b/lwlib/lwlib-utils.c
index 7a0dd1b264a..fe236a210f3 100644
--- a/lwlib/lwlib-utils.c
+++ b/lwlib/lwlib-utils.c
@@ -80,7 +80,7 @@ XtApplyToWidgets (Widget w, XtApplyToWidgetsProc proc, XtPointer arg)
80 XtApplyToWidgets (kids [i], proc, arg); 80 XtApplyToWidgets (kids [i], proc, arg);
81 proc (kids [i], arg); 81 proc (kids [i], arg);
82 } 82 }
83 free (kids); 83 xfree (kids);
84 } 84 }
85} 85}
86 86
diff --git a/lwlib/lwlib.c b/lwlib/lwlib.c
index 9d8ec3330d3..7e3538aec04 100644
--- a/lwlib/lwlib.c
+++ b/lwlib/lwlib.c
@@ -138,7 +138,7 @@ my_strcasecmp (const char *s1, const char *s2)
138static void 138static void
139safe_free_str (char *s) 139safe_free_str (char *s)
140{ 140{
141 free (s); 141 xfree (s);
142} 142}
143 143
144static widget_value *widget_value_free_list = 0; 144static widget_value *widget_value_free_list = 0;
@@ -176,7 +176,7 @@ free_widget_value (widget_value *wv)
176 { 176 {
177 /* When the number of already allocated cells is too big, 177 /* When the number of already allocated cells is too big,
178 We free it. */ 178 We free it. */
179 free (wv); 179 xfree (wv);
180 malloc_cpt--; 180 malloc_cpt--;
181 } 181 }
182 else 182 else
@@ -192,9 +192,9 @@ free_widget_value_tree (widget_value *wv)
192 if (!wv) 192 if (!wv)
193 return; 193 return;
194 194
195 free (wv->name); 195 xfree (wv->name);
196 free (wv->value); 196 xfree (wv->value);
197 free (wv->key); 197 xfree (wv->key);
198 198
199 wv->name = wv->value = wv->key = (char *) 0xDEADBEEF; 199 wv->name = wv->value = wv->key = (char *) 0xDEADBEEF;
200 200
@@ -281,7 +281,7 @@ free_widget_info (widget_info *info)
281 safe_free_str (info->name); 281 safe_free_str (info->name);
282 free_widget_value_tree (info->val); 282 free_widget_value_tree (info->val);
283 memset ((void*)info, 0xDEADBEEF, sizeof (widget_info)); 283 memset ((void*)info, 0xDEADBEEF, sizeof (widget_info));
284 free (info); 284 xfree (info);
285} 285}
286 286
287static void 287static void
@@ -317,7 +317,7 @@ static void
317free_widget_instance (widget_instance *instance) 317free_widget_instance (widget_instance *instance)
318{ 318{
319 memset ((void*)instance, 0xDEADBEEF, sizeof (widget_instance)); 319 memset ((void*)instance, 0xDEADBEEF, sizeof (widget_instance));
320 free (instance); 320 xfree (instance);
321} 321}
322 322
323static widget_info * 323static widget_info *
@@ -602,7 +602,7 @@ name_to_widget (widget_instance *instance, const char *name)
602 602
603 widget = XtNameToWidget (instance->widget, real_name); 603 widget = XtNameToWidget (instance->widget, real_name);
604 604
605 free (real_name); 605 xfree (real_name);
606 } 606 }
607 return widget; 607 return widget;
608} 608}
diff --git a/lwlib/xlwmenu.c b/lwlib/xlwmenu.c
index e9ec604ae7f..5ed33d5be05 100644
--- a/lwlib/xlwmenu.c
+++ b/lwlib/xlwmenu.c
@@ -1891,7 +1891,7 @@ openXftFont (XlwMenuWidget mw)
1891 } 1891 }
1892 } 1892 }
1893 1893
1894 if (fname != mw->menu.fontName) free (fname); 1894 if (fname != mw->menu.fontName) xfree (fname);
1895 1895
1896 return mw->menu.xft_font != 0; 1896 return mw->menu.xft_font != 0;
1897} 1897}
diff --git a/src/ChangeLog b/src/ChangeLog
index e7cd83305ee..52fe8baa92e 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,8 @@
12011-10-13 Dmitry Antipov <dmantipov@yandex.ru>
2
3 * editfns.c (Fset_time_zone_rule): Replace free with xfree to
4 avoid crash when xmalloc overrun checking is enabled.
5
12011-10-13 Eli Zaretskii <eliz@gnu.org> 62011-10-13 Eli Zaretskii <eliz@gnu.org>
2 7
3 * xdisp.c (Fcurrent_bidi_paragraph_direction): Initialize 8 * xdisp.c (Fcurrent_bidi_paragraph_direction): Initialize
diff --git a/src/editfns.c b/src/editfns.c
index 3dd58377ada..5f89391ce22 100644
--- a/src/editfns.c
+++ b/src/editfns.c
@@ -2079,7 +2079,7 @@ only the former. */)
2079 } 2079 }
2080 2080
2081 set_time_zone_rule (tzstring); 2081 set_time_zone_rule (tzstring);
2082 free (environbuf); 2082 xfree (environbuf);
2083 environbuf = environ; 2083 environbuf = environ;
2084 2084
2085 return Qnil; 2085 return Qnil;