branch: externals/futur
commit e64bbd7bf9c700b159492ea9cd4f77e9f69d703b
Author: Stefan Monnier <[email protected]>
Commit: Stefan Monnier <[email protected]>

    (futur--make-thread): Silence warning on Emacs<31
    
    * futur.el (with-suppressed-warnings): Provide fallback definition.
    (futur--make-thread): Silence warning on Emacs<31.
---
 futur.el | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/futur.el b/futur.el
index 12fda77f5e..bdb8e3e617 100644
--- a/futur.el
+++ b/futur.el
@@ -150,6 +150,11 @@
 
 (defvar futur--in-background nil)
 
+(eval-and-compile
+  (unless (fboundp 'with-suppressed-warnings) ;Emacs-27
+    (defmacro with-suppressed-warnings (_warnings &rest body)
+      (with-no-warnings ,@body))))
+
 (defun futur--background ()
   (let ((futur--in-background t))
     (while t
@@ -169,7 +174,8 @@
 
 (defun futur--make-thread (f name)
   (condition-case nil
-      (make-thread f name 'silently)
+      (with-suppressed-warnings ((callargs make-thread))
+        (make-thread f name 'silently))
     (wrong-number-of-arguments ;; Emacs<31
      (with-current-buffer (get-buffer-create " *futur--background*")
        (make-thread f name)))))

Reply via email to