diff options
| author | Glenn Morris | 2018-12-20 07:51:17 -0800 |
|---|---|---|
| committer | Glenn Morris | 2018-12-20 07:51:17 -0800 |
| commit | 62112a77f191c0b00aa420ce2d0fee8aa03592bf (patch) | |
| tree | 3f6f65f84d5f4a600534ae29aec1ef49fa797c4f | |
| parent | 1e5f84805884e37563db9f16076d458ceaa03917 (diff) | |
| parent | 081fb694c3f88e77d4a0e09fba8ce457037b9132 (diff) | |
| download | emacs-62112a77f191c0b00aa420ce2d0fee8aa03592bf.tar.gz emacs-62112a77f191c0b00aa420ce2d0fee8aa03592bf.zip | |
Merge from origin/emacs-26
081fb69 (origin/emacs-26) Check result from c-backward-token-2 to avo...
f4ea746 cl-make-random-state was not copying its arg
| -rw-r--r-- | lisp/emacs-lisp/cl-extra.el | 2 | ||||
| -rw-r--r-- | lisp/progmodes/cc-fonts.el | 4 | ||||
| -rw-r--r-- | test/lisp/emacs-lisp/cl-extra-tests.el | 5 |
3 files changed, 8 insertions, 3 deletions
diff --git a/lisp/emacs-lisp/cl-extra.el b/lisp/emacs-lisp/cl-extra.el index 78484fcfa3f..7d530deae5b 100644 --- a/lisp/emacs-lisp/cl-extra.el +++ b/lisp/emacs-lisp/cl-extra.el | |||
| @@ -482,7 +482,7 @@ Optional second arg STATE is a random-state object." | |||
| 482 | If STATE is t, return a new state object seeded from the time of day." | 482 | If STATE is t, return a new state object seeded from the time of day." |
| 483 | (unless state (setq state cl--random-state)) | 483 | (unless state (setq state cl--random-state)) |
| 484 | (if (cl-random-state-p state) | 484 | (if (cl-random-state-p state) |
| 485 | (copy-tree state t) | 485 | (copy-sequence state) |
| 486 | (cl--make-random-state (if (integerp state) state (cl--random-time))))) | 486 | (cl--make-random-state (if (integerp state) state (cl--random-time))))) |
| 487 | 487 | ||
| 488 | ;; Implementation limits. | 488 | ;; Implementation limits. |
diff --git a/lisp/progmodes/cc-fonts.el b/lisp/progmodes/cc-fonts.el index 2e85924f7be..e91e54df9ca 100644 --- a/lisp/progmodes/cc-fonts.el +++ b/lisp/progmodes/cc-fonts.el | |||
| @@ -1255,8 +1255,8 @@ casts and declarations are fontified. Used on level 2 and higher." | |||
| 1255 | (save-excursion | 1255 | (save-excursion |
| 1256 | (goto-char match-pos) | 1256 | (goto-char match-pos) |
| 1257 | (while | 1257 | (while |
| 1258 | (progn (c-backward-token-2) | 1258 | (and (zerop (c-backward-token-2)) |
| 1259 | (eq (char-after) ?\())) | 1259 | (eq (char-after) ?\())) |
| 1260 | (looking-at c-arithmetic-op-regexp))) | 1260 | (looking-at c-arithmetic-op-regexp))) |
| 1261 | (cons nil nil)) | 1261 | (cons nil nil)) |
| 1262 | ;; In a C++ member initialization list. | 1262 | ;; In a C++ member initialization list. |
diff --git a/test/lisp/emacs-lisp/cl-extra-tests.el b/test/lisp/emacs-lisp/cl-extra-tests.el index baad8eb8e67..fe59703530f 100644 --- a/test/lisp/emacs-lisp/cl-extra-tests.el +++ b/test/lisp/emacs-lisp/cl-extra-tests.el | |||
| @@ -94,4 +94,9 @@ | |||
| 94 | (should (equal (list lst3 (cdr lst3) (cddr lst3)) | 94 | (should (equal (list lst3 (cdr lst3) (cddr lst3)) |
| 95 | (cl-maplist fn3 lst lst2 lst3))))) | 95 | (cl-maplist fn3 lst lst2 lst3))))) |
| 96 | 96 | ||
| 97 | (ert-deftest cl-extra-test-cl-make-random-state () | ||
| 98 | (let ((s (cl-make-random-state))) | ||
| 99 | ;; Test for Bug#33731. | ||
| 100 | (should-not (eq s (cl-make-random-state s))))) | ||
| 101 | |||
| 97 | ;;; cl-extra-tests.el ends here | 102 | ;;; cl-extra-tests.el ends here |