[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master f0bc797 04/12: Use old advice for Emacs 24.3.
From: |
Jackson Ray Hamilton |
Subject: |
[elpa] master f0bc797 04/12: Use old advice for Emacs 24.3. |
Date: |
Sun, 21 Jun 2015 21:16:13 +0000 |
branch: master
commit f0bc797b6c5c2b297fc981ab943cfb5696065dc1
Author: Jackson Ray Hamilton <address@hidden>
Commit: Jackson Ray Hamilton <address@hidden>
Use old advice for Emacs 24.3.
---
test/context-coloring-test.el | 29 +++++++++++++++++++----------
1 files changed, 19 insertions(+), 10 deletions(-)
diff --git a/test/context-coloring-test.el b/test/context-coloring-test.el
index 272ee1d..c84ae67 100644
--- a/test/context-coloring-test.el
+++ b/test/context-coloring-test.el
@@ -198,20 +198,29 @@ signaled."
(let ((name (intern (format "context-coloring-test-%s-mode" name))))
`(define-derived-mode ,name fundamental-mode "Testing")))
+(defvar context-coloring-test-caused-p nil
+ "Dumb flag tracking for lambdas inside old advice definitions
+which don't seem to have lexical binding.")
+
(defmacro context-coloring-test-assert-causes-coloring (&rest body)
"Assert that BODY causes coloring."
- (let ((colorized-p (make-symbol "colorized-p")))
- `(let (,colorized-p)
- (advice-add #'context-coloring-colorize
- :after (lambda ()
- (setq ,colorized-p t))
- '((name . assert-causes-coloring)))
- ,@body
- (when (not ,colorized-p)
- (ert-fail "Expected to have colorized, but it didn't.")))))
+ `(progn
+ ;; Gross, but I want this to pass on 24.3.
+ (ad-add-advice #'context-coloring-colorize
+ '(assert-causes-coloring
+ nil t
+ (advice . (lambda ()
+ (setq context-coloring-test-caused-p t))))
+ 'after
+ 0)
+ (ad-activate #'context-coloring-colorize)
+ ,@body
+ (when (not context-coloring-test-caused-p)
+ (ert-fail "Expected to have colorized, but it didn't."))))
(defun context-coloring-test-cleanup-assert-causes-coloring ()
- (advice-remove #'context-coloring-colorize 'assert-causes-coloring))
+ (ad-unadvise #'context-coloring-colorize)
+ (setq context-coloring-test-caused-p nil))
(context-coloring-test-define-derived-mode mode-startup)
- [elpa] master updated (afda2e6 -> 98073fe), Jackson Ray Hamilton, 2015/06/21
- [elpa] master f0bc797 04/12: Use old advice for Emacs 24.3.,
Jackson Ray Hamilton <=
- [elpa] master 89f862a 03/12: Minutia., Jackson Ray Hamilton, 2015/06/21
- [elpa] master 2487c3a 07/12: Fix eval-expression detection., Jackson Ray Hamilton, 2015/06/21
- [elpa] master b31aa52 05/12: Automatically determine the maximum face., Jackson Ray Hamilton, 2015/06/21
- [elpa] master 8d54c2e 08/12: Suppress unavailable messages in minibuffer., Jackson Ray Hamilton, 2015/06/21
- [elpa] master 32b276e 11/12: Version 7.0.0., Jackson Ray Hamilton, 2015/06/21
- [elpa] master ef0c4da 09/12: Cleanup refactoring artifacts., Jackson Ray Hamilton, 2015/06/21
- [elpa] master 354ac23 06/12: Checkdoc compliance., Jackson Ray Hamilton, 2015/06/21
- [elpa] master cbffe2a 02/12: Remove automatic theming., Jackson Ray Hamilton, 2015/06/21
- [elpa] master 92d3d12 01/12: Remove asynchronous support., Jackson Ray Hamilton, 2015/06/21
- [elpa] master 1bebaa4 10/12: Merge branch 'debt', Jackson Ray Hamilton, 2015/06/21