branch: externals/hyperbole commit 4a21251bb2ed5fdb69c92f02ccba8556ee57fa9a Author: Mats Lidell <mats.lid...@lidells.se> Commit: GitHub <nore...@github.com>
Use compatibility macro for with-suppressed-warnings (#92) * Use compatibility macro for with-suppressed-warnings * Move macro to hypb and use it from there --- ChangeLog | 10 +++++++++- hypb.el | 7 +++++++ hyperbole.el | 5 ++++- kotl/kotl-mode.el | 5 ++++- 4 files changed, 24 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index b9469cb..6fd43ea 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,4 +1,10 @@ -2021-05-17 Mats Lidell <ma...@gnu.org> +2021-05-18 Mats Lidell <ma...@gnu.org> + +* kotl/kotl-mode.el (hypb): + hyperbole.el (hypb): Use compatibility macro. + +* hypb.el (hypb-with-suppressed-warnings): Add compatibility macro for + suppressing warnings * Makefile (kotl/kotl-autoloads.el): Remove PRELOADS for generating autoloads. Patch from Stefan Monnier. Thank you Stefan. @@ -7,6 +13,8 @@ hyperbole.el (fboundp): Do not use with-suppressed-warnings since not available in Emacs 26 +2021-05-17 Mats Lidell <ma...@gnu.org> + * kotl/kmenu.el (id-menubar-set): Add external dependency. * hyrolo.el (google-contacts-history, google-contacts-expire-time) diff --git a/hypb.el b/hypb.el index 63af433..8caa156 100644 --- a/hypb.el +++ b/hypb.el @@ -18,6 +18,13 @@ (eval-and-compile (mapc #'require '(compile hversion hact locate))) +(defmacro hypb-with-suppressed-warnings (spec &rest body) + "Backwards compatibility macro." + (declare (debug (sexp &optional body)) (indent 1)) + (if (fboundp 'with-suppressed-warnings) + `(with-suppressed-warnings ,spec ,@body) + `(with-no-warnings ,@body))) + ;;; ************************************************************************ ;;; Public variables ;;; ************************************************************************ diff --git a/hyperbole.el b/hyperbole.el index 5ba685f..64ddd99 100644 --- a/hyperbole.el +++ b/hyperbole.el @@ -75,6 +75,8 @@ ;;; Start Initializations ;;; ************************************************************************ +(require 'hypb) + (defconst hyperbole-loading t "Temporary constant available for testing while Hyperbole is loading.") @@ -424,7 +426,8 @@ The function does NOT recursively descend into subdirectories of the directory or directories specified." ;; Don't use a 'let' on this next line or it will fail. (setq generated-autoload-file output-file) - (update-directory-autoloads dir))) + (hypb-with-suppressed-warnings ((obsolete update-directory-autoloads)) + (update-directory-autoloads dir)))) ;; Before the 6.0.1 release, Hyperbole used to patch the package-generate-autoloads ;; function to ensure that kotl/ subdirectories were autoloaded. This diff --git a/kotl/kotl-mode.el b/kotl/kotl-mode.el index 1a55bf7..6c87ea7 100644 --- a/kotl/kotl-mode.el +++ b/kotl/kotl-mode.el @@ -18,6 +18,8 @@ (eval-and-compile (mapc #'require '(cl-lib delsel hsettings hmail kfile kvspec kcell outline org-table kotl-orgtbl))) +(require 'hypb) + ;;; ************************************************************************ ;;; Public variables ;;; ************************************************************************ @@ -166,7 +168,8 @@ It provides the following keys: ;; We have been converting a buffer from a foreign format to a koutline. ;; Now that it is converted, ensure that `kotl-previous-mode' is set to ;; koutline. - (setq kotl-previous-mode 'kotl-mode) + (hypb-with-suppressed-warnings ((free-vars kotl-previous-mode)) + (setq kotl-previous-mode 'kotl-mode)) ;; Enable Org Table editing minor mode (user can disable via kotl-mode-hook ;; if desired). (orgtbl-mode 1)