branch: externals/debbugs commit d8e47dddd3b9f288ae5f0b7899b642e3174afc0f Author: Michael Albinus <michael.albi...@gmx.de> Commit: Michael Albinus <michael.albi...@gmx.de>
Make debbugs-compat.el more robust * debbugs-compat.el (debbugs-gnu-use-threads): Don't declare. (debbugs-compat-add-debbugs-advice) (debbugs-compat-remove-debbugs-advice): Use `bound-and-true-p', it isn't guaranteed that debbugs-gnu.el is loaded. --- debbugs-compat.el | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/debbugs-compat.el b/debbugs-compat.el index cedbb386c9..d97c589532 100644 --- a/debbugs-compat.el +++ b/debbugs-compat.el @@ -42,7 +42,6 @@ ;; t, which is not thread-safe. We override this setting. It is ;; fixed in Emacs 31.1. (defvar url-http-attempt-keepalives) -(defvar debbugs-gnu-use-threads) (defvar debbugs-compat-url-http-attempt-keepalives nil "Temporary storage for `url-http-attempt-keepalives'.") @@ -52,7 +51,8 @@ (defun debbugs-compat-add-debbugs-advice () "Activate advice for Bug#73199." - (when (and debbugs-gnu-use-threads (< emacs-major-version 31)) + (when (and (bound-and-true-p debbugs-gnu-use-threads) + (< emacs-major-version 31)) (setq debbugs-compat-url-http-attempt-keepalives url-http-attempt-keepalives) (advice-add @@ -60,7 +60,8 @@ (defun debbugs-compat-remove-debbugs-advice () "Deactivate advice for Bug#73199." - (when (and debbugs-gnu-use-threads (< emacs-major-version 31)) + (when (and (bound-and-true-p debbugs-gnu-use-threads) + (< emacs-major-version 31)) (setq url-http-attempt-keepalives debbugs-compat-url-http-attempt-keepalives) (advice-remove 'url-http-create-request #'debbugs-compat-debbugs-advice)))