diff options
| author | Daniel Colascione | 2014-04-19 13:32:05 -0700 |
|---|---|---|
| committer | Daniel Colascione | 2014-04-19 13:32:05 -0700 |
| commit | 6dfa19c50f75c1892f5c9a48104ddd532796d089 (patch) | |
| tree | 4477c00776774800f4e0a0fdbe0d04173e1f6ba4 | |
| parent | 2123570f1b0b7d3061c4a365555c87e2cfaa4320 (diff) | |
| parent | d7b659bb0615d326f79b2ea96b2acd90b816c3c0 (diff) | |
| download | emacs-6dfa19c50f75c1892f5c9a48104ddd532796d089.tar.gz emacs-6dfa19c50f75c1892f5c9a48104ddd532796d089.zip | |
Merge from emacs-24; up to 2014-04-17T02:05:48Z!eggert@cs.ucla.edu
| -rw-r--r-- | lisp/ChangeLog | 5 | ||||
| -rw-r--r-- | lisp/progmodes/sh-script.el | 7 | ||||
| -rw-r--r-- | src/ChangeLog | 6 | ||||
| -rw-r--r-- | src/intervals.c | 88 | ||||
| -rw-r--r-- | test/ChangeLog | 5 | ||||
| -rw-r--r-- | test/automated/tramp-tests.el | 45 |
6 files changed, 98 insertions, 58 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 9078046f149..648e5f3869e 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,8 @@ | |||
| 1 | 2014-04-19 Stefan Monnier <monnier@iro.umontreal.ca> | ||
| 2 | |||
| 3 | * progmodes/sh-script.el (sh-smie--sh-keyword-p): Handle variable | ||
| 4 | assignments such as "case=hello" (bug#17297). | ||
| 5 | |||
| 1 | 2014-04-18 Michael Albinus <michael.albinus@gmx.de> | 6 | 2014-04-18 Michael Albinus <michael.albinus@gmx.de> |
| 2 | 7 | ||
| 3 | * net/tramp.el (tramp-run-real-handler, tramp-file-name-handler): | 8 | * net/tramp.el (tramp-run-real-handler, tramp-file-name-handler): |
diff --git a/lisp/progmodes/sh-script.el b/lisp/progmodes/sh-script.el index 8ab6a0466d4..06d7a8fdffe 100644 --- a/lisp/progmodes/sh-script.el +++ b/lisp/progmodes/sh-script.el | |||
| @@ -1832,9 +1832,10 @@ Does not preserve point." | |||
| 1832 | 1832 | ||
| 1833 | (defun sh-smie--sh-keyword-p (tok) | 1833 | (defun sh-smie--sh-keyword-p (tok) |
| 1834 | "Non-nil if TOK (at which we're looking) really is a keyword." | 1834 | "Non-nil if TOK (at which we're looking) really is a keyword." |
| 1835 | (if (equal tok "in") | 1835 | (cond |
| 1836 | (sh-smie--sh-keyword-in-p) | 1836 | ((looking-at "[[:alnum:]_]+=") nil) |
| 1837 | (sh-smie--keyword-p))) | 1837 | ((equal tok "in") (sh-smie--sh-keyword-in-p)) |
| 1838 | (t (sh-smie--keyword-p)))) | ||
| 1838 | 1839 | ||
| 1839 | (defun sh-smie-sh-forward-token () | 1840 | (defun sh-smie-sh-forward-token () |
| 1840 | (if (and (looking-at "[ \t]*\\(?:#\\|\\(\\s|\\)\\|$\\)") | 1841 | (if (and (looking-at "[ \t]*\\(?:#\\|\\(\\s|\\)\\|$\\)") |
diff --git a/src/ChangeLog b/src/ChangeLog index 34ae84c788f..bb05be04d3e 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,9 @@ | |||
| 1 | 2014-04-19 Stefan Monnier <monnier@iro.umontreal.ca> | ||
| 2 | |||
| 3 | * intervals.c (rotate_right, rotate_left): Fix up length computation. | ||
| 4 | Also change identifiers to match the comments, and add more assertions | ||
| 5 | (bug#16234). | ||
| 6 | |||
| 1 | 2014-04-18 Paul Eggert <eggert@cs.ucla.edu> | 7 | 2014-04-18 Paul Eggert <eggert@cs.ucla.edu> |
| 2 | 8 | ||
| 3 | * emacs.c (close_output_streams): Don't clear and restore errno. | 9 | * emacs.c (close_output_streams): Don't clear and restore errno. |
diff --git a/src/intervals.c b/src/intervals.c index 703c0cefbd5..8544ed94b79 100644 --- a/src/intervals.c +++ b/src/intervals.c | |||
| @@ -332,39 +332,43 @@ root_interval (INTERVAL interval) | |||
| 332 | */ | 332 | */ |
| 333 | 333 | ||
| 334 | static INTERVAL | 334 | static INTERVAL |
| 335 | rotate_right (INTERVAL interval) | 335 | rotate_right (INTERVAL A) |
| 336 | { | 336 | { |
| 337 | INTERVAL i; | 337 | INTERVAL B = A->left; |
| 338 | INTERVAL B = interval->left; | 338 | INTERVAL c = B->right; |
| 339 | ptrdiff_t old_total = interval->total_length; | 339 | ptrdiff_t old_total = A->total_length; |
| 340 | |||
| 341 | eassert (old_total > 0); | ||
| 342 | eassert (old_total | ||
| 343 | > TOTAL_LENGTH (B) + TOTAL_LENGTH (A->right)); | ||
| 344 | eassert (TOTAL_LENGTH (B) | ||
| 345 | > TOTAL_LENGTH (B->left) + TOTAL_LENGTH (c)); | ||
| 340 | 346 | ||
| 341 | /* Deal with any Parent of A; make it point to B. */ | 347 | /* Deal with any Parent of A; make it point to B. */ |
| 342 | if (! ROOT_INTERVAL_P (interval)) | 348 | if (! ROOT_INTERVAL_P (A)) |
| 343 | { | 349 | { |
| 344 | if (AM_LEFT_CHILD (interval)) | 350 | if (AM_LEFT_CHILD (A)) |
| 345 | set_interval_left (INTERVAL_PARENT (interval), B); | 351 | set_interval_left (INTERVAL_PARENT (A), B); |
| 346 | else | 352 | else |
| 347 | set_interval_right (INTERVAL_PARENT (interval), B); | 353 | set_interval_right (INTERVAL_PARENT (A), B); |
| 348 | } | 354 | } |
| 349 | copy_interval_parent (B, interval); | 355 | copy_interval_parent (B, A); |
| 350 | 356 | ||
| 351 | /* Make B the parent of A */ | 357 | /* Make B the parent of A. */ |
| 352 | i = B->right; | 358 | set_interval_right (B, A); |
| 353 | set_interval_right (B, interval); | 359 | set_interval_parent (A, B); |
| 354 | set_interval_parent (interval, B); | ||
| 355 | 360 | ||
| 356 | /* Make A point to c */ | 361 | /* Make A point to c. */ |
| 357 | set_interval_left (interval, i); | 362 | set_interval_left (A, c); |
| 358 | if (i) | 363 | if (c) |
| 359 | set_interval_parent (i, interval); | 364 | set_interval_parent (c, A); |
| 360 | 365 | ||
| 361 | /* A's total length is decreased by the length of B and its left child. */ | 366 | /* A's total length is decreased by the length of B and its left child. */ |
| 362 | interval->total_length -= B->total_length - LEFT_TOTAL_LENGTH (interval); | 367 | A->total_length -= B->total_length - TOTAL_LENGTH (c); |
| 363 | eassert (TOTAL_LENGTH (interval) >= 0); | 368 | eassert (TOTAL_LENGTH (A) > 0); |
| 364 | 369 | ||
| 365 | /* B must have the same total length of A. */ | 370 | /* B must have the same total length of A. */ |
| 366 | B->total_length = old_total; | 371 | B->total_length = old_total; |
| 367 | eassert (TOTAL_LENGTH (B) >= 0); | ||
| 368 | 372 | ||
| 369 | return B; | 373 | return B; |
| 370 | } | 374 | } |
| @@ -379,39 +383,43 @@ rotate_right (INTERVAL interval) | |||
| 379 | */ | 383 | */ |
| 380 | 384 | ||
| 381 | static INTERVAL | 385 | static INTERVAL |
| 382 | rotate_left (INTERVAL interval) | 386 | rotate_left (INTERVAL A) |
| 383 | { | 387 | { |
| 384 | INTERVAL i; | 388 | INTERVAL B = A->right; |
| 385 | INTERVAL B = interval->right; | 389 | INTERVAL c = B->left; |
| 386 | ptrdiff_t old_total = interval->total_length; | 390 | ptrdiff_t old_total = A->total_length; |
| 391 | |||
| 392 | eassert (old_total > 0); | ||
| 393 | eassert (old_total | ||
| 394 | > TOTAL_LENGTH (B) + TOTAL_LENGTH (A->left)); | ||
| 395 | eassert (TOTAL_LENGTH (B) | ||
| 396 | > TOTAL_LENGTH (B->right) + TOTAL_LENGTH (c)); | ||
| 387 | 397 | ||
| 388 | /* Deal with any parent of A; make it point to B. */ | 398 | /* Deal with any parent of A; make it point to B. */ |
| 389 | if (! ROOT_INTERVAL_P (interval)) | 399 | if (! ROOT_INTERVAL_P (A)) |
| 390 | { | 400 | { |
| 391 | if (AM_LEFT_CHILD (interval)) | 401 | if (AM_LEFT_CHILD (A)) |
| 392 | set_interval_left (INTERVAL_PARENT (interval), B); | 402 | set_interval_left (INTERVAL_PARENT (A), B); |
| 393 | else | 403 | else |
| 394 | set_interval_right (INTERVAL_PARENT (interval), B); | 404 | set_interval_right (INTERVAL_PARENT (A), B); |
| 395 | } | 405 | } |
| 396 | copy_interval_parent (B, interval); | 406 | copy_interval_parent (B, A); |
| 397 | 407 | ||
| 398 | /* Make B the parent of A */ | 408 | /* Make B the parent of A. */ |
| 399 | i = B->left; | 409 | set_interval_left (B, A); |
| 400 | set_interval_left (B, interval); | 410 | set_interval_parent (A, B); |
| 401 | set_interval_parent (interval, B); | ||
| 402 | 411 | ||
| 403 | /* Make A point to c */ | 412 | /* Make A point to c. */ |
| 404 | set_interval_right (interval, i); | 413 | set_interval_right (A, c); |
| 405 | if (i) | 414 | if (c) |
| 406 | set_interval_parent (i, interval); | 415 | set_interval_parent (c, A); |
| 407 | 416 | ||
| 408 | /* A's total length is decreased by the length of B and its right child. */ | 417 | /* A's total length is decreased by the length of B and its right child. */ |
| 409 | interval->total_length -= B->total_length - RIGHT_TOTAL_LENGTH (interval); | 418 | A->total_length -= B->total_length - TOTAL_LENGTH (c); |
| 410 | eassert (TOTAL_LENGTH (interval) >= 0); | 419 | eassert (TOTAL_LENGTH (A) > 0); |
| 411 | 420 | ||
| 412 | /* B must have the same total length of A. */ | 421 | /* B must have the same total length of A. */ |
| 413 | B->total_length = old_total; | 422 | B->total_length = old_total; |
| 414 | eassert (TOTAL_LENGTH (B) >= 0); | ||
| 415 | 423 | ||
| 416 | return B; | 424 | return B; |
| 417 | } | 425 | } |
diff --git a/test/ChangeLog b/test/ChangeLog index 4986280f5f1..338a825f51e 100644 --- a/test/ChangeLog +++ b/test/ChangeLog | |||
| @@ -1,3 +1,8 @@ | |||
| 1 | 2014-04-19 Michael Albinus <michael.albinus@gmx.de> | ||
| 2 | |||
| 3 | * automated/tramp-tests.el (tramp--test-check-files): Extend test. | ||
| 4 | (tramp-test31-utf8): Let-bind also `file-name-coding-system'. | ||
| 5 | |||
| 1 | 2014-04-18 Michael Albinus <michael.albinus@gmx.de> | 6 | 2014-04-18 Michael Albinus <michael.albinus@gmx.de> |
| 2 | 7 | ||
| 3 | * automated/tramp-tests.el (tramp-copy-size-limit): Set to nil. | 8 | * automated/tramp-tests.el (tramp-copy-size-limit): Set to nil. |
diff --git a/test/automated/tramp-tests.el b/test/automated/tramp-tests.el index dff9103c4a7..607718412fd 100644 --- a/test/automated/tramp-tests.el +++ b/test/automated/tramp-tests.el | |||
| @@ -1418,23 +1418,37 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'." | |||
| 1418 | 1418 | ||
| 1419 | (defun tramp--test-check-files (&rest files) | 1419 | (defun tramp--test-check-files (&rest files) |
| 1420 | "Runs a simple but comprehensive test over every file in FILES." | 1420 | "Runs a simple but comprehensive test over every file in FILES." |
| 1421 | (let ((tmp-name (tramp--test-make-temp-name))) | 1421 | (let ((tmp-name1 (tramp--test-make-temp-name)) |
| 1422 | (tmp-name2 (tramp--test-make-temp-name 'local))) | ||
| 1422 | (unwind-protect | 1423 | (unwind-protect |
| 1423 | (progn | 1424 | (progn |
| 1424 | (make-directory tmp-name) | 1425 | (make-directory tmp-name1) |
| 1426 | (make-directory tmp-name2) | ||
| 1425 | (dolist (elt files) | 1427 | (dolist (elt files) |
| 1426 | (let ((file (expand-file-name elt tmp-name))) | 1428 | (let ((file1 (expand-file-name elt tmp-name1)) |
| 1427 | (write-region elt nil file) | 1429 | (file2 (expand-file-name elt tmp-name2))) |
| 1428 | (should (file-exists-p file)) | 1430 | (write-region elt nil file1) |
| 1431 | (should (file-exists-p file1)) | ||
| 1429 | ;; Check file contents. | 1432 | ;; Check file contents. |
| 1430 | (with-temp-buffer | 1433 | (with-temp-buffer |
| 1431 | (insert-file-contents file) | 1434 | (insert-file-contents file1) |
| 1432 | (should (string-equal (buffer-string) elt))))) | 1435 | (should (string-equal (buffer-string) elt))) |
| 1436 | ;; Copy file both directions. | ||
| 1437 | (copy-file file1 tmp-name2) | ||
| 1438 | (should (file-exists-p file2)) | ||
| 1439 | (delete-file file1) | ||
| 1440 | (should-not (file-exists-p file1)) | ||
| 1441 | (copy-file file2 tmp-name1) | ||
| 1442 | (should (file-exists-p file1)))) | ||
| 1433 | ;; Check file names. | 1443 | ;; Check file names. |
| 1434 | (should (equal (directory-files | 1444 | (should (equal (directory-files |
| 1435 | tmp-name nil directory-files-no-dot-files-regexp) | 1445 | tmp-name1 nil directory-files-no-dot-files-regexp) |
| 1436 | (sort files 'string-lessp)))) | 1446 | (sort (copy-sequence files) 'string-lessp))) |
| 1437 | (ignore-errors (delete-directory tmp-name 'recursive))))) | 1447 | (should (equal (directory-files |
| 1448 | tmp-name2 nil directory-files-no-dot-files-regexp) | ||
| 1449 | (sort (copy-sequence files) 'string-lessp)))) | ||
| 1450 | (ignore-errors (delete-directory tmp-name1 'recursive)) | ||
| 1451 | (ignore-errors (delete-directory tmp-name2 'recursive))))) | ||
| 1438 | 1452 | ||
| 1439 | ;; This test is inspired by Bug#17238. | 1453 | ;; This test is inspired by Bug#17238. |
| 1440 | (ert-deftest tramp-test30-special-characters () | 1454 | (ert-deftest tramp-test30-special-characters () |
| @@ -1463,11 +1477,12 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'." | |||
| 1463 | (skip-unless (tramp--test-enabled)) | 1477 | (skip-unless (tramp--test-enabled)) |
| 1464 | 1478 | ||
| 1465 | (let ((coding-system-for-read 'utf-8) | 1479 | (let ((coding-system-for-read 'utf-8) |
| 1466 | (coding-system-for-write 'utf-8)) | 1480 | (coding-system-for-write 'utf-8) |
| 1467 | (tramp--test-check-files | 1481 | (file-name-coding-system 'utf-8)) |
| 1468 | "أصبح بوسعك الآن تنزيل نسخة كاملة من موسوعة ويكيبيديا العربية لتصفحها بلا اتصال بالإنترنت" | 1482 | (tramp--test-check-files |
| 1469 | "银河系漫游指南系列" | 1483 | "أصبح بوسعك الآن تنزيل نسخة كاملة من موسوعة ويكيبيديا العربية لتصفحها بلا اتصال بالإنترنت" |
| 1470 | "Автостопом по гала́ктике"))) | 1484 | "银河系漫游指南系列" |
| 1485 | "Автостопом по гала́ктике"))) | ||
| 1471 | 1486 | ||
| 1472 | ;; This test is inspired by Bug#16928. | 1487 | ;; This test is inspired by Bug#16928. |
| 1473 | (ert-deftest tramp-test32-asynchronous-requests () | 1488 | (ert-deftest tramp-test32-asynchronous-requests () |