aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Eggert2011-10-14 12:11:46 -0700
committerPaul Eggert2011-10-14 12:11:46 -0700
commit42dbaa0c43d5a6a1d03cdd046de448cf8a671015 (patch)
tree36ccc1cd700a5404983013aa465adc84a1682ca7
parent91107bd98003435fbeead3325ce694248863da39 (diff)
parent3d1337be7b53c158b3b6c4959fa9a7ed8f6f4ed6 (diff)
downloademacs-42dbaa0c43d5a6a1d03cdd046de448cf8a671015.tar.gz
emacs-42dbaa0c43d5a6a1d03cdd046de448cf8a671015.zip
Merge from trunk.
-rw-r--r--doc/misc/ChangeLog13
-rw-r--r--doc/misc/ert.texi126
-rw-r--r--lisp/ChangeLog16
-rw-r--r--lisp/mail/sendmail.el33
-rw-r--r--lisp/mouse.el6
-rw-r--r--lisp/mpc.el6
-rw-r--r--lisp/pcmpl-unix.el2
-rw-r--r--src/ChangeLog38
-rw-r--r--src/xterm.c9
9 files changed, 154 insertions, 95 deletions
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/lisp/ChangeLog b/lisp/ChangeLog
index 68a85a43387..7f4462179ec 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,19 @@
12011-10-14 Stefan Monnier <monnier@iro.umontreal.ca>
2
3 * pcmpl-unix.el (pcomplete/ssh): SSH does allow ganging.
4
5 * mpc.el (mpc-songs-jump-to): Don't burp if the user clicks in an
6 empty buffer.
7
8 * mouse.el (mouse-drag-mode-line-1): Modify the end-event we pushed on
9 unread-command-events rather than pushing yet-another event.
10
112011-10-14 Eli Zaretskii <eliz@gnu.org>
12
13 * mail/sendmail.el (sendmail-query-once): Improve the wording of
14 the explanation of the possible choices. Make the options passed
15 to completing-read shorter.
16
12011-10-13 Agustín Martín Domingo <agustin.martin@hispalinux.es> 172011-10-13 Agustín Martín Domingo <agustin.martin@hispalinux.es>
2 18
3 * textmodes/flyspell.el (flyspell-large-region): Make sure 19 * textmodes/flyspell.el (flyspell-large-region): Make sure
diff --git a/lisp/mail/sendmail.el b/lisp/mail/sendmail.el
index 4557bf0fb3f..d685b8b3e70 100644
--- a/lisp/mail/sendmail.el
+++ b/lisp/mail/sendmail.el
@@ -513,21 +513,34 @@ This also saves the value of `send-mail-function' via Customize."
513 ;; a second time, probably because someone's using an old value 513 ;; a second time, probably because someone's using an old value
514 ;; of send-mail-function. 514 ;; of send-mail-function.
515 (when (eq send-mail-function 'sendmail-query-once) 515 (when (eq send-mail-function 'sendmail-query-once)
516 (let* ((options `(("My favorite mail client" . mailclient-send-it) 516 (let* ((options `(("Mail client" . mailclient-send-it)
517 ("Configuring Emacs's SMTP variables" . smtpmail-send-it)
518 ,@(when (and sendmail-program 517 ,@(when (and sendmail-program
519 (executable-find sendmail-program)) 518 (executable-find sendmail-program))
520 '(("The system's mail transport agent" 519 '(("Mail transport agent" . sendmail-send-it)))
521 . sendmail-send-it))))) 520 ("SMTP server" . smtpmail-send-it)))
522 (choice 521 (choice
523 ;; Query the user. 522 ;; Query the user.
524 (with-temp-buffer 523 (with-temp-buffer
525 (rename-buffer "*Mail Help*" t) 524 (rename-buffer "*Emacs Mail Setup Help*" t)
526 (insert "Emacs has not been set up for sending mail.\n 525 (insert "\
527It can be told to send mail either via your favorite mail client, 526 Emacs is about to send an email message. However, it was not configured
528or via the system's mail transport agent (\"sendmail\"), if any, 527 for sending email. You can instruct Emacs to send email in one of the
529or it can send email on its own by configuring the SMTP parameters.\n 528 following ways:
530To change your decision later, customize `send-mail-function'.\n") 529
530 - Start your default mail client and pass to it the message text.
531 Type \"Mail client\" at the prompt below to select this option.\n\n")
532 (if (and sendmail-program
533 (executable-find sendmail-program))
534 (insert "\
535 - Invoke the system's mail transport agent (\"sendmail\").
536 Type \"Mail transport agent\" at the prompt below to select this option.\n\n"))
537 (insert "\
538 - Send mail directly by communicating with your mail server
539 (this requires setting up SMTP parameters).
540 Type \"SMTP server\" at the prompt below to select this option.
541
542 Emacs will record your selection and will use it thereafter. To change
543 your selection later, customize the option `send-mail-function'.\n")
531 (goto-char (point-min)) 544 (goto-char (point-min))
532 (display-buffer (current-buffer)) 545 (display-buffer (current-buffer))
533 (let ((completion-ignore-case t)) 546 (let ((completion-ignore-case t))
diff --git a/lisp/mouse.el b/lisp/mouse.el
index 8a74782250d..ff175288445 100644
--- a/lisp/mouse.el
+++ b/lisp/mouse.el
@@ -540,11 +540,13 @@ MODE-LINE-P non-nil means dragging a mode line; nil means a header line."
540 ;; be `mouse-1', whereas if this did move the mouse, it should be 540 ;; be `mouse-1', whereas if this did move the mouse, it should be
541 ;; a `drag-mouse-1'. In any case `on-link' would have been nulled 541 ;; a `drag-mouse-1'. In any case `on-link' would have been nulled
542 ;; above if there had been any significant mouse movement. 542 ;; above if there had been any significant mouse movement.
543 (when (and on-link (eq 'mouse-1 (car-safe event))) 543 (when (and on-link
544 (eq 'mouse-1 (car-safe (car unread-command-events))))
544 ;; If mouse-2 has never been done by the user, it doesn't 545 ;; If mouse-2 has never been done by the user, it doesn't
545 ;; have the necessary property to be interpreted correctly. 546 ;; have the necessary property to be interpreted correctly.
546 (put 'mouse-2 'event-kind 'mouse-click) 547 (put 'mouse-2 'event-kind 'mouse-click)
547 (push (cons 'mouse-2 (cdr event)) unread-command-events)))))) 548 (setcar unread-command-events
549 (cons 'mouse-2 (cdar unread-command-events))))))))
548 550
549(defun mouse-drag-mode-line (start-event) 551(defun mouse-drag-mode-line (start-event)
550 "Change the height of a window by dragging on the mode line." 552 "Change the height of a window by dragging on the mode line."
diff --git a/lisp/mpc.el b/lisp/mpc.el
index 251e1864927..40ccb456400 100644
--- a/lisp/mpc.el
+++ b/lisp/mpc.el
@@ -1996,12 +1996,14 @@ This is used so that they can be compared with `eq', which is needed for
1996 (list (get-text-property (point) 'mpc-file) 1996 (list (get-text-property (point) 'mpc-file)
1997 posn)))) 1997 posn))))
1998 (let* ((plbuf (mpc-proc-cmd "playlist")) 1998 (let* ((plbuf (mpc-proc-cmd "playlist"))
1999 (re (concat "^\\([0-9]+\\):" (regexp-quote song-file) "$")) 1999 (re (if song-file
2000 (concat "^\\([0-9]+\\):" (regexp-quote song-file) "$")))
2000 (sn (with-current-buffer plbuf 2001 (sn (with-current-buffer plbuf
2001 (goto-char (point-min)) 2002 (goto-char (point-min))
2002 (when (re-search-forward re nil t) 2003 (when (and re (re-search-forward re nil t))
2003 (match-string 1))))) 2004 (match-string 1)))))
2004 (cond 2005 (cond
2006 ((null re) (posn-set-point posn))
2005 ((null sn) (error "This song is not in the playlist")) 2007 ((null sn) (error "This song is not in the playlist"))
2006 ((null (with-current-buffer plbuf (re-search-forward re nil t))) 2008 ((null (with-current-buffer plbuf (re-search-forward re nil t)))
2007 ;; song-file only appears once in the playlist: no ambiguity, 2009 ;; song-file only appears once in the playlist: no ambiguity,
diff --git a/lisp/pcmpl-unix.el b/lisp/pcmpl-unix.el
index b466c2cd899..a34458506e2 100644
--- a/lisp/pcmpl-unix.el
+++ b/lisp/pcmpl-unix.el
@@ -185,7 +185,7 @@ Uses both `pcmpl-ssh-config-file' and `pcmpl-ssh-known-hosts-file'."
185;;;###autoload 185;;;###autoload
186(defun pcomplete/ssh () 186(defun pcomplete/ssh ()
187 "Completion rules for the `ssh' command." 187 "Completion rules for the `ssh' command."
188 (pcomplete-opt "1246AaCfgKkMNnqsTtVvXxYbcDeFiLlmOopRSw" nil t) 188 (pcomplete-opt "1246AaCfgKkMNnqsTtVvXxYbcDeFiLlmOopRSw")
189 (pcomplete-here (pcmpl-ssh-hosts))) 189 (pcomplete-here (pcmpl-ssh-hosts)))
190 190
191;;;###autoload 191;;;###autoload
diff --git a/src/ChangeLog b/src/ChangeLog
index 11432b45f92..e6416a5a56d 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,4 +1,4 @@
12011-10-13 Paul Eggert <eggert@cs.ucla.edu> 12011-10-14 Paul Eggert <eggert@cs.ucla.edu>
2 2
3 Fix integer width and related bugs. 3 Fix integer width and related bugs.
4 * alloc.c (pure_bytes_used_lisp, pure_bytes_used_non_lisp): 4 * alloc.c (pure_bytes_used_lisp, pure_bytes_used_non_lisp):
@@ -789,6 +789,11 @@
789 rather than rolling our own approximation. 789 rather than rolling our own approximation.
790 (SCROLL_BAR_VEC_SIZE): Remove; not used. 790 (SCROLL_BAR_VEC_SIZE): Remove; not used.
791 791
7922011-10-14 Stefan Monnier <monnier@iro.umontreal.ca>
793
794 * xterm.c (frame_highlight, frame_unhighlight): Ignore unexplained
795 errors in XSetWindowBorder (bug#9310).
796
7922011-10-13 Dmitry Antipov <dmantipov@yandex.ru> 7972011-10-13 Dmitry Antipov <dmantipov@yandex.ru>
793 798
794 * editfns.c (Fset_time_zone_rule): Replace free with xfree to 799 * editfns.c (Fset_time_zone_rule): Replace free with xfree to
@@ -862,8 +867,8 @@
862 867
8632011-10-07 Stefan Monnier <monnier@iro.umontreal.ca> 8682011-10-07 Stefan Monnier <monnier@iro.umontreal.ca>
864 869
865 * buffer.c (syms_of_buffer) <enable-multibyte-characters>: Don't 870 * buffer.c (syms_of_buffer) <enable-multibyte-characters>:
866 advertise functionality which we discourage or doesn't work. 871 Don't advertise functionality which we discourage or doesn't work.
867 872
8682011-10-07 Paul Eggert <eggert@cs.ucla.edu> 8732011-10-07 Paul Eggert <eggert@cs.ucla.edu>
869 874
@@ -1129,8 +1134,7 @@
11292011-09-17 Eli Zaretskii <eliz@gnu.org> 11342011-09-17 Eli Zaretskii <eliz@gnu.org>
1130 1135
1131 * xdisp.c (reseat_at_next_visible_line_start): Keep information 1136 * xdisp.c (reseat_at_next_visible_line_start): Keep information
1132 about the current paragraph and restore it after the call to 1137 about the current paragraph and restore it after the call to reseat.
1133 reseat.
1134 1138
1135 * bidi.c (MAX_PARAGRAPH_SEARCH): New macro. 1139 * bidi.c (MAX_PARAGRAPH_SEARCH): New macro.
1136 (bidi_find_paragraph_start): Search back for paragraph beginning 1140 (bidi_find_paragraph_start): Search back for paragraph beginning
@@ -1350,7 +1354,7 @@
1350 * doprnt.c (doprnt): Support printing ptrdiff_t and intmax_t values. 1354 * doprnt.c (doprnt): Support printing ptrdiff_t and intmax_t values.
1351 (esprintf, exprintf, evxprintf): New functions. 1355 (esprintf, exprintf, evxprintf): New functions.
1352 * keyboard.c (command_loop_level): Now EMACS_INT, not int. 1356 * keyboard.c (command_loop_level): Now EMACS_INT, not int.
1353 (cmd_error): kbd macro iterations count is now EMACS_INT, not int. 1357 (cmd_error): Kbd macro iterations count is now EMACS_INT, not int.
1354 (modify_event_symbol): Do not assume that the length of 1358 (modify_event_symbol): Do not assume that the length of
1355 name_alist_or_stem is safe to alloca and fits in int. 1359 name_alist_or_stem is safe to alloca and fits in int.
1356 (Fexecute_extended_command): Likewise for function name and binding. 1360 (Fexecute_extended_command): Likewise for function name and binding.
@@ -2094,8 +2098,7 @@
2094 2098
20952011-08-18 Andreas Schwab <schwab@linux-m68k.org> 20992011-08-18 Andreas Schwab <schwab@linux-m68k.org>
2096 2100
2097 * process.c (Fnetwork_interface_list): Correctly determine buffer 2101 * process.c (Fnetwork_interface_list): Correctly determine buffer size.
2098 size.
2099 2102
21002011-08-17 Chong Yidong <cyd@stupidchicken.com> 21032011-08-17 Chong Yidong <cyd@stupidchicken.com>
2101 2104
@@ -2140,15 +2143,10 @@
2140 2143
21412011-08-15 Eli Zaretskii <eliz@gnu.org> 21442011-08-15 Eli Zaretskii <eliz@gnu.org>
2142 2145
2143 * biditype.h: File removed. 2146 * bidimirror.h:
2144 2147 * biditype.h: Remove file.
2145 * bidimirror.h: File removed. 2148 * makefile.w32-in ($(BLD)/bidi.$(O)):
2146 2149 * deps.mk (bidi.o): Remove biditype.h and bidimirror.h.
2147 * deps.mk (bidi.o): Remove biditype.h and
2148 bidimirror.h.
2149
2150 * makefile.w32-in ($(BLD)/bidi.$(O)): Remove biditype.h and
2151 bidimirror.h.
2152 2150
2153 * dispextern.h: Fix a typo in the comment to bidi_type_t. 2151 * dispextern.h: Fix a typo in the comment to bidi_type_t.
2154 2152
@@ -2323,8 +2321,7 @@
2323 2321
23242011-08-04 Andreas Schwab <schwab@linux-m68k.org> 23222011-08-04 Andreas Schwab <schwab@linux-m68k.org>
2325 2323
2326 * regex.c (re_iswctype): Remove some redundant boolean 2324 * regex.c (re_iswctype): Remove some redundant boolean conversions.
2327 conversions.
2328 2325
23292011-08-04 Jan Djärv <jan.h.d@swipnet.se> 23262011-08-04 Jan Djärv <jan.h.d@swipnet.se>
2330 2327
@@ -2861,8 +2858,7 @@
28612011-07-15 Eli Zaretskii <eliz@gnu.org> 28582011-07-15 Eli Zaretskii <eliz@gnu.org>
2862 2859
2863 * xdisp.c (move_it_in_display_line_to): Fix vertical motion with 2860 * xdisp.c (move_it_in_display_line_to): Fix vertical motion with
2864 bidi redisplay when a line includes both an image and is 2861 bidi redisplay when a line includes both an image and is truncated.
2865 truncated.
2866 2862
28672011-07-14 Paul Eggert <eggert@cs.ucla.edu> 28632011-07-14 Paul Eggert <eggert@cs.ucla.edu>
2868 2864
diff --git a/src/xterm.c b/src/xterm.c
index f40deca1e88..df83941f0d1 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -3355,8 +3355,14 @@ frame_highlight (struct frame *f)
3355 and border pixel are window attributes which are "private to the 3355 and border pixel are window attributes which are "private to the
3356 client", so we can always change it to whatever we want. */ 3356 client", so we can always change it to whatever we want. */
3357 BLOCK_INPUT; 3357 BLOCK_INPUT;
3358 /* I recently started to get errors in this XSetWindowBorder, depending on
3359 the window-manager in use, tho something more is at play since I've been
3360 using that same window-manager binary for ever. Let's not crash just
3361 because of this (bug#9310). */
3362 x_catch_errors (FRAME_X_DISPLAY (f));
3358 XSetWindowBorder (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), 3363 XSetWindowBorder (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f),
3359 f->output_data.x->border_pixel); 3364 f->output_data.x->border_pixel);
3365 x_uncatch_errors ();
3360 UNBLOCK_INPUT; 3366 UNBLOCK_INPUT;
3361 x_update_cursor (f, 1); 3367 x_update_cursor (f, 1);
3362 x_set_frame_alpha (f); 3368 x_set_frame_alpha (f);
@@ -3370,8 +3376,11 @@ frame_unhighlight (struct frame *f)
3370 and border pixel are window attributes which are "private to the 3376 and border pixel are window attributes which are "private to the
3371 client", so we can always change it to whatever we want. */ 3377 client", so we can always change it to whatever we want. */
3372 BLOCK_INPUT; 3378 BLOCK_INPUT;
3379 /* Same as above for XSetWindowBorder (bug#9310). */
3380 x_catch_errors (FRAME_X_DISPLAY (f));
3373 XSetWindowBorderPixmap (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), 3381 XSetWindowBorderPixmap (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f),
3374 f->output_data.x->border_tile); 3382 f->output_data.x->border_tile);
3383 x_uncatch_errors ();
3375 UNBLOCK_INPUT; 3384 UNBLOCK_INPUT;
3376 x_update_cursor (f, 1); 3385 x_update_cursor (f, 1);
3377 x_set_frame_alpha (f); 3386 x_set_frame_alpha (f);