emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[nongnu] elpa/markdown-mode 5e155411b4 2/2: Merge pull request #789 from


From: ELPA Syncer
Subject: [nongnu] elpa/markdown-mode 5e155411b4 2/2: Merge pull request #789 from jrblevin/fix-tests-for-latest-emacs
Date: Tue, 8 Aug 2023 01:00:11 -0400 (EDT)

branch: elpa/markdown-mode
commit 5e155411b465e80be56b2ea6439b9615880e8382
Merge: b403120e60 8c7b5c532c
Author: Shohei YOSHIDA <syohex@gmail.com>
Commit: GitHub <noreply@github.com>

    Merge pull request #789 from jrblevin/fix-tests-for-latest-emacs
    
    Fix tests for Emacs 30
---
 tests/markdown-test.el | 20 ++++++++------------
 1 file changed, 8 insertions(+), 12 deletions(-)

diff --git a/tests/markdown-test.el b/tests/markdown-test.el
index 53c77895f9..d8aa4886f1 100644
--- a/tests/markdown-test.el
+++ b/tests/markdown-test.el
@@ -32,6 +32,7 @@
 (require 'ert)
 (require 'cl-lib)
 (require 'ispell)
+(require 'eww)
 
 (eval-when-compile
   ;; This is for byte-compile warnings on older Emacs.
@@ -6864,25 +6865,20 @@ Detail: 
https://github.com/jrblevin/markdown-mode/pull/590";
           (should (string= (buffer-name) "doesnotexist.md")))
       (kill-buffer))))
 
-(defadvice markdown-live-preview-window-eww
-    (around markdown-test-create-fake-eww disable)
-  (setq ad-return-value (get-buffer-create "*eww*")))
+(defun markdown-test-live-preview-window-eww (_orig-fun &rest _args)
+  (get-buffer-create "*eww*"))
 
 (defmacro markdown-test-fake-eww (&rest body)
   `(progn
-     ,@(if (and (fboundp 'libxml-parse-html-region) (require 'eww nil t)) body
-         `((ad-enable-advice #'markdown-live-preview-window-eww
-                             'around 'markdown-test-create-fake-eww)
-           (ad-activate #'markdown-live-preview-window-eww)
+     ,@(if (fboundp 'libxml-parse-html-region)
+           body
+         `((advice-add 'markdown-live-preview-window-eww :around 
#'markdown-test-live-preview-window-eww)
            ,@body
-           (ad-disable-advice #'markdown-live-preview-window-eww
-                              'around 'markdown-test-create-fake-eww)
-           (ad-activate #'markdown-live-preview-window-eww)))))
+           (advice-remove 'markdown-live-preview-window-eww 
#'markdown-test-live-preview-window-eww)))))
 
 (defmacro markdown-test-eww-or-nothing (test &rest body)
   (declare (indent 1))
-  (if (and (fboundp 'libxml-parse-html-region) (require 'eww nil t)
-           (executable-find markdown-command))
+  (if (and (fboundp 'libxml-parse-html-region) (executable-find 
markdown-command))
       `(progn ,@body)
     (message "no eww, no libxml2, or no %s found: skipping %s" 
markdown-command test)
     nil))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]