diff options
| author | Paul Eggert | 2011-10-14 12:11:46 -0700 |
|---|---|---|
| committer | Paul Eggert | 2011-10-14 12:11:46 -0700 |
| commit | 42dbaa0c43d5a6a1d03cdd046de448cf8a671015 (patch) | |
| tree | 36ccc1cd700a5404983013aa465adc84a1682ca7 | |
| parent | 91107bd98003435fbeead3325ce694248863da39 (diff) | |
| parent | 3d1337be7b53c158b3b6c4959fa9a7ed8f6f4ed6 (diff) | |
| download | emacs-42dbaa0c43d5a6a1d03cdd046de448cf8a671015.tar.gz emacs-42dbaa0c43d5a6a1d03cdd046de448cf8a671015.zip | |
Merge from trunk.
| -rw-r--r-- | doc/misc/ChangeLog | 13 | ||||
| -rw-r--r-- | doc/misc/ert.texi | 126 | ||||
| -rw-r--r-- | lisp/ChangeLog | 16 | ||||
| -rw-r--r-- | lisp/mail/sendmail.el | 33 | ||||
| -rw-r--r-- | lisp/mouse.el | 6 | ||||
| -rw-r--r-- | lisp/mpc.el | 6 | ||||
| -rw-r--r-- | lisp/pcmpl-unix.el | 2 | ||||
| -rw-r--r-- | src/ChangeLog | 38 | ||||
| -rw-r--r-- | src/xterm.c | 9 |
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 @@ | |||
| 1 | 2011-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 | |||
| 1 | 2011-10-13 Jay Belanger <jay.p.belanger@gmail.com> | 14 | 2011-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 | ||
| 83 | Other Testing Concepts | 83 | Other 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 |
| 134 | better error reporting. @xref{The @code{should} Macro}. | 134 | better error reporting. @xref{The @code{should} Macro}. |
| 135 | 135 | ||
| 136 | Each test should have a name that describes what functionality the | 136 | Each test should have a name that describes what functionality it tests. |
| 137 | test tests. Test names can be chosen arbitrarily --- they are in a | 137 | Test names can be chosen arbitrarily --- they are in a |
| 138 | namespace separate from functions and variables --- but should follow | 138 | namespace separate from functions and variables --- but should follow |
| 139 | the usual Emacs Lisp convention of having a prefix that indicates | 139 | the usual Emacs Lisp convention of having a prefix that indicates |
| 140 | which package they belong to. Test names are displayed by ERT when | 140 | which 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 | ||
| 143 | The empty parentheses @code{()} in the first line don't currently have | 143 | The empty parentheses @code{()} in the first line don't currently have |
| 144 | any meaning and are reserved for future extension. They also make | 144 | any meaning and are reserved for future extension. They also make |
| 145 | @code{ert-deftest}'s syntax more similar to @code{defun}. | 145 | the syntax of @code{ert-deftest} more similar to that of @code{defun}. |
| 146 | 146 | ||
| 147 | The docstring describes what feature this test tests. When running | 147 | The docstring describes what feature this test tests. When running |
| 148 | tests interactively, the first line of the docstring is displayed for | 148 | tests 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 | |||
| 163 | command line in a separate Emacs process in batch mode (i.e., with no | 163 | command line in a separate Emacs process in batch mode (i.e., with no |
| 164 | user interface). The former mode is convenient during interactive | 164 | user interface). The former mode is convenient during interactive |
| 165 | development, the latter is useful to make sure that tests pass | 165 | development, the latter is useful to make sure that tests pass |
| 166 | independently of your customizations, allows tests to be invoked from | 166 | independently of your customizations; and it allows you to invoke |
| 167 | makefiles and scripts to be written that run tests in several | 167 | tests from makefiles, and to write scripts that run tests in several |
| 168 | different Emacs versions. | 168 | different 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 | ||
| 180 | You can run the tests that are currently defined in your Emacs with | 180 | You can run the tests that are currently defined in your Emacs with |
| 181 | the command @kbd{@kbd{M-x} ert @kbd{RET} t @kbd{RET}}. ERT will pop | 181 | the command @kbd{@kbd{M-x} ert @kbd{RET} t @kbd{RET}}. (For an |
| 182 | explanation of the @code{t} argument, @pxref{Test Selectors}.) ERT will pop | ||
| 182 | up a new buffer, the ERT results buffer, showing the results of the | 183 | up a new buffer, the ERT results buffer, showing the results of the |
| 183 | tests run. It looks like this: | 184 | tests 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 | ||
| 222 | At the top, there is a summary of the results: We ran all tests in the | 223 | At the top, there is a summary of the results: we ran all tests defined |
| 223 | current Emacs (@code{Selector: t}), 31 of them passed, and 2 failed | 224 | in the current Emacs (@code{Selector: t}), 31 of them passed, and 2 |
| 224 | unexpectedly. @xref{Expected Failures}, for an explanation of the | 225 | failed unexpectedly. @xref{Expected Failures}, for an explanation of |
| 225 | term @emph{unexpected} in this context. | 226 | the term @emph{unexpected} in this context. |
| 226 | 227 | ||
| 227 | The line of dots and @code{F}s is a progress bar where each character | 228 | The line of dots and @code{F}s is a progress bar where each character |
| 228 | represents one test; it fills while the tests are running. A dot | 229 | represents 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, | |||
| 261 | They can be used like this: | 262 | They can be used like this: |
| 262 | 263 | ||
| 263 | @example | 264 | @example |
| 264 | emacs -batch -L /path/to/ert -l ert.el -l my-tests.el -f ert-run-tests-batch-and-exit | 265 | emacs -batch -l ert -l my-tests.el -f ert-run-tests-batch-and-exit |
| 265 | @end example | 266 | @end example |
| 266 | 267 | ||
| 267 | This command will start up Emacs in batch mode, load ERT, load | 268 | This 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 | |||
| 270 | failed or if anything else went wrong. It will also print progress | 271 | failed or if anything else went wrong. It will also print progress |
| 271 | messages and error diagnostics to standard output. | 272 | messages and error diagnostics to standard output. |
| 272 | 273 | ||
| 273 | You may need additional @code{-L} flags to ensure that | 274 | If 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}. | 276 | additional @code{-L} flags to ensure that @code{my-tests.el} and all the |
| 277 | files 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 |
| 297 | tests 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, | ||
| 305 | a function that takes a test as argument and returns non-nil if it is selected. | ||
| 301 | @end itemize | 306 | @end itemize |
| 302 | 307 | ||
| 303 | Selectors that are frequently useful when selecting tests to run | 308 | Selectors that are frequently useful when selecting tests to run |
| 304 | include @code{t} to run all tests that are currently defined in Emacs, | 309 | include @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 |
| 306 | that package @code{foo} uses the prefix @code{foo-} for its test names | 311 | that package @code{foo} uses the prefix @code{foo-} for its test names), |
| 307 | ---, result-based selectors such as @code{(or :new :unexpected)} to | 312 | result-based selectors such as @code{(or :new :unexpected)} to |
| 308 | run all tests that have either not run yet or that had an unexpected | 313 | run all tests that have either not run yet or that had an unexpected |
| 309 | result in the last run, and tag-based selectors such as @code{(not | 314 | result 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 | ||
| 337 | Test bodies can include arbitrary code; but to be useful, they need to | 342 | Test bodies can include arbitrary code; but to be useful, they need to |
| 338 | have checks whether the code being tested (or @emph{code under test}) | 343 | check whether the code being tested (or @emph{code under test}) |
| 339 | does what it is supposed to do. The macro @code{should} is similar to | 344 | does 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 |
| 341 | records information that ERT can display to help debugging. | 346 | (@pxref{Assertions,,, cl, Common Lisp Extensions}), |
| 347 | but analyzes its argument form and records information that ERT can | ||
| 348 | display to help debugging. | ||
| 342 | 349 | ||
| 343 | This test definition | 350 | This 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 | ||
| 399 | Some bugs are complicated to fix or not very important and are left as | 406 | Some 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 |
| 401 | fails, ERT will alert you of this failure every time you run all | 408 | fails, ERT will alert you of this failure every time you run all |
| 402 | tests. For known bugs, this alert is a distraction. The way to | 409 | tests. 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. |
| 409 | Since this functionality isn't implemented yet, the test is known to fail." | 416 | Since 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 | |||
| 427 | prevent future regressions. | 434 | prevent future regressions. |
| 428 | 435 | ||
| 429 | ERT displays the same kind of alerts for tests that pass unexpectedly | 436 | ERT displays the same kind of alerts for tests that pass unexpectedly |
| 430 | that it displays for unexpected failures. This way, if you make code | 437 | as it displays for unexpected failures. This way, if you make code |
| 431 | changes that happen to fix a bug that you weren't aware of, you will | 438 | changes that happen to fix a bug that you weren't aware of, you will |
| 432 | know to remove the @code{:expected-result} clause of that test and | 439 | know to remove the @code{:expected-result} clause of that test and |
| 433 | close the corresponding bug report, if any. | 440 | close the corresponding bug report, if any. |
| @@ -453,8 +460,8 @@ The outcome of running a test should not depend on the current state | |||
| 453 | of the environment, and each test should leave its environment in the | 460 | of the environment, and each test should leave its environment in the |
| 454 | same state it found it in. In particular, a test should not depend on | 461 | same state it found it in. In particular, a test should not depend on |
| 455 | any Emacs customization variables or hooks, and if it has to make any | 462 | any Emacs customization variables or hooks, and if it has to make any |
| 456 | changes to Emacs' state or state external to Emacs such as the file | 463 | changes to Emacs's state or state external to Emacs (such as the file |
| 457 | system, it should undo these changes before it returns, regardless of | 464 | system), it should undo these changes before it returns, regardless of |
| 458 | whether it passed or failed. | 465 | whether it passed or failed. |
| 459 | 466 | ||
| 460 | Tests should not depend on the environment because any such | 467 | Tests 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 | |||
| 462 | only under certain circumstances and are hard to reproduce. Of | 469 | only under certain circumstances and are hard to reproduce. Of |
| 463 | course, the code under test may have settings that affect its | 470 | course, the code under test may have settings that affect its |
| 464 | behavior. In that case, it is best to make the test @code{let}-bind | 471 | behavior. In that case, it is best to make the test @code{let}-bind |
| 465 | all such settings variables to set up a specific configuration for the | 472 | all such setting variables to set up a specific configuration for the |
| 466 | duration of the test. The test can also set up a number of different | 473 | duration of the test. The test can also set up a number of different |
| 467 | configurations and run the code under test with each. | 474 | configurations and run the code under test with each. |
| 468 | 475 | ||
| 469 | Tests that have side effects on their environment should restore it to | 476 | Tests that have side effects on their environment should restore it to |
| 470 | its original state because any side effects that persist after the | 477 | its original state because any side effects that persist after the |
| 471 | test can disrupt the workflow of the programmer running the tests. If | 478 | test can disrupt the workflow of the programmer running the tests. If |
| 472 | the code under test has side effects on Emacs' current state, such as | 479 | the code under test has side effects on Emacs's current state, such as |
| 473 | on the current buffer or window configuration, the test should create | 480 | on the current buffer or window configuration, the test should create |
| 474 | a temporary buffer for the code to manipulate (using | 481 | a 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 |
| 491 | its behavior can be affected by so many external factors. Also, | 498 | its 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 |
| 493 | hard to undo: It may create a new buffer or may reuse an existing | 500 | hard to undo: It may create a new buffer or reuse an existing |
| 494 | buffer if one is already visiting the requested file; and it runs | 501 | buffer 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 | ||
| 497 | Instead, it is better to use lower-level mechanisms with simple and | 504 | Instead, it is better to use lower-level mechanisms with simple and |
| 498 | predictable semantics like @code{with-temp-buffer}, @code{insert} or | 505 | predictable 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 |
| 500 | by calling the corresponding function directly --- after binding the | 507 | by calling the corresponding function directly --- after binding the |
| 501 | hook variables to nil. This avoids the above problems. | 508 | hook 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 | ||
| 541 | This test creates a test object using @code{make-ert-test} whose body | 550 | This test creates a test object using @code{make-ert-test} whose body |
| @@ -562,7 +571,7 @@ under test was structured with testing in mind. | |||
| 562 | For example, if @code{ert-run-test} accepted only symbols that name | 571 | For example, if @code{ert-run-test} accepted only symbols that name |
| 563 | tests rather than test objects, the test would need a name for the | 572 | tests rather than test objects, the test would need a name for the |
| 564 | failing test, which would have to be a temporary symbol generated with | 573 | failing 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 |
| 566 | the right interface for @code{ert-run-tests} allows the test to be | 575 | the right interface for @code{ert-run-tests} allows the test to be |
| 567 | simpler. | 576 | simpler. |
| 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 | ||
| 666 | Debugging failed tests works essentially the same way as debugging any | 675 | Debugging failed tests essentially works the same way as debugging any |
| 667 | other problems with Lisp code. Here are a few tricks specific to | 676 | other problems with Lisp code. Here are a few tricks specific to |
| 668 | tests: | 677 | tests: |
| 669 | 678 | ||
| @@ -673,8 +682,8 @@ each time. It's good to find out whether the behavior is | |||
| 673 | deterministic before spending any time looking for a cause. In the | 682 | deterministic before spending any time looking for a cause. In the |
| 674 | ERT results buffer, @kbd{r} re-runs the selected test. | 683 | ERT 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 |
| 677 | exactly it does. Perhaps the test is broken rather than the code | 686 | what it does. Perhaps the test is broken rather than the code |
| 678 | under test. | 687 | under 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 |
| 700 | ERT remembers an old test that you have since renamed or removed --- | 709 | ERT remembers an old test that you have since renamed or removed --- |
| 701 | renamings or removals of definitions in the source code leave around a | 710 | renamings or removals of definitions in the source code leave around a |
| 702 | stray definition under the old name in the running process, this is a | 711 | stray definition under the old name in the running process (this is a |
| 703 | common problem in Lisp. In such a situation, hit @kbd{D} to let ERT | 712 | common problem in Lisp). In such a situation, hit @kbd{D} to let ERT |
| 704 | forget about the obsolete test. | 713 | forget about the obsolete test. |
| 705 | @end itemize | 714 | @end itemize |
| 706 | 715 | ||
| @@ -739,14 +748,13 @@ explanation function. | |||
| 739 | 748 | ||
| 740 | Both @code{ert-run-tests-interactively} and @code{ert-run-tests-batch} | 749 | Both @code{ert-run-tests-interactively} and @code{ert-run-tests-batch} |
| 741 | are implemented on top of the lower-level test handling code in the | 750 | are implemented on top of the lower-level test handling code in the |
| 742 | sections named ``Facilities for running a single test'', ``Test | 751 | sections of @file{ert.el} labelled ``Facilities for running a single test'', |
| 743 | selectors'', and ``Facilities for running a whole set of tests''. | 752 | ``Test selectors'', and ``Facilities for running a whole set of tests''. |
| 744 | 753 | ||
| 745 | If you want to write code that works with ERT tests, you should take a | 754 | If you want to write code that works with ERT tests, you should take a |
| 746 | look at this lower-level code. Symbols that start with @code{ert--} | 755 | look at this lower-level code. Symbols that start with @code{ert--} |
| 747 | are internal to ERT, those that start with @code{ert-} but not | 756 | are 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 | 757 | meant to be usable by other code. But there is no mature API yet. |
| 749 | mature API yet. | ||
| 750 | 758 | ||
| 751 | Contributions to ERT are welcome. | 759 | Contributions 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 | |||
| 782 | SUnit or JUnit. However, two features commonly found in such | 790 | SUnit or JUnit. However, two features commonly found in such |
| 783 | frameworks are notably absent from ERT: fixtures and test suites. | 791 | frameworks are notably absent from ERT: fixtures and test suites. |
| 784 | 792 | ||
| 785 | Fixtures, as used e.g. in SUnit or JUnit, are mainly used to provide | 793 | Fixtures are mainly used (e.g., in SUnit or JUnit) to provide an |
| 786 | an environment for a set of tests, and consist of set-up and tear-down | 794 | environment for a set of tests, and consist of set-up and tear-down |
| 787 | functions. | 795 | functions. |
| 788 | 796 | ||
| 789 | While fixtures are a useful syntactic simplification in other | 797 | While fixtures are a useful syntactic simplification in other |
| @@ -829,13 +837,13 @@ separating module namespaces in Emacs Lisp, test selectors already | |||
| 829 | solve this by allowing regexp matching on test names; e.g., the | 837 | solve this by allowing regexp matching on test names; e.g., the |
| 830 | selector "^ert-" selects ERT's self-tests. | 838 | selector "^ert-" selects ERT's self-tests. |
| 831 | 839 | ||
| 832 | Other uses include grouping tests by their expected execution time to | 840 | Other uses include grouping tests by their expected execution time, |
| 833 | run quick tests during interactive development and slow tests less | 841 | e.g. to run quick tests during interactive development and slow tests less |
| 834 | frequently. This can be achieved with the @code{:tag} argument to | 842 | often. 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 @@ | |||
| 1 | 2011-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 | |||
| 11 | 2011-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 | |||
| 1 | 2011-10-13 Agustín Martín Domingo <agustin.martin@hispalinux.es> | 17 | 2011-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 "\ |
| 527 | It 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 |
| 528 | or 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 |
| 529 | or it can send email on its own by configuring the SMTP parameters.\n | 528 | following ways: |
| 530 | To 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 @@ | |||
| 1 | 2011-10-13 Paul Eggert <eggert@cs.ucla.edu> | 1 | 2011-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 | ||
| 792 | 2011-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 | |||
| 792 | 2011-10-13 Dmitry Antipov <dmantipov@yandex.ru> | 797 | 2011-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 | ||
| 863 | 2011-10-07 Stefan Monnier <monnier@iro.umontreal.ca> | 868 | 2011-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 | ||
| 868 | 2011-10-07 Paul Eggert <eggert@cs.ucla.edu> | 873 | 2011-10-07 Paul Eggert <eggert@cs.ucla.edu> |
| 869 | 874 | ||
| @@ -1129,8 +1134,7 @@ | |||
| 1129 | 2011-09-17 Eli Zaretskii <eliz@gnu.org> | 1134 | 2011-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 | ||
| 2095 | 2011-08-18 Andreas Schwab <schwab@linux-m68k.org> | 2099 | 2011-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 | ||
| 2100 | 2011-08-17 Chong Yidong <cyd@stupidchicken.com> | 2103 | 2011-08-17 Chong Yidong <cyd@stupidchicken.com> |
| 2101 | 2104 | ||
| @@ -2140,15 +2143,10 @@ | |||
| 2140 | 2143 | ||
| 2141 | 2011-08-15 Eli Zaretskii <eliz@gnu.org> | 2144 | 2011-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 | ||
| 2324 | 2011-08-04 Andreas Schwab <schwab@linux-m68k.org> | 2322 | 2011-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 | ||
| 2329 | 2011-08-04 Jan Djärv <jan.h.d@swipnet.se> | 2326 | 2011-08-04 Jan Djärv <jan.h.d@swipnet.se> |
| 2330 | 2327 | ||
| @@ -2861,8 +2858,7 @@ | |||
| 2861 | 2011-07-15 Eli Zaretskii <eliz@gnu.org> | 2858 | 2011-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 | ||
| 2867 | 2011-07-14 Paul Eggert <eggert@cs.ucla.edu> | 2863 | 2011-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); |