branch: externals/hyperbole commit f5f52449266809ed08301e576e3f0d53d98ebf00 Author: Stefan Monnier <monn...@iro.umontreal.ca> Commit: Stefan Monnier <monn...@iro.umontreal.ca>
Fix compilation: don't burp if hui-window is loaded before hui-mouse * hmouse-drv.el: Just require `hui-window` without messing with `hmouse-alist` any more. Move compiler-silencing `defvar`s outside of `eval-when-compile`. * hui-mouse.el: Just use `require` instead of `load`. * hui-window.el: Set hmouse-alist only after loading hui-mouse. (hui-window--register): New function. (hui-mouse): Use with-eval-after-load. --- hmouse-drv.el | 12 ++++-------- hui-mouse.el | 4 ++-- hui-window.el | 9 +++++---- 3 files changed, 11 insertions(+), 14 deletions(-) diff --git a/hmouse-drv.el b/hmouse-drv.el index 318b62e..6952986 100644 --- a/hmouse-drv.el +++ b/hmouse-drv.el @@ -4,7 +4,7 @@ ;; ;; Orig-Date: 04-Feb-90 ;; -;; Copyright (C) 1989-2017 Free Software Foundation, Inc. +;; Copyright (C) 1989-2018 Free Software Foundation, Inc. ;; See the "HY-COPY" file for license information. ;; ;; This file is part of GNU Hyperbole. @@ -16,16 +16,12 @@ ;;; Other required Elisp libraries ;;; ************************************************************************ -(eval-when-compile - (defvar hmouse-alist nil) - (require 'hui-window) - (makunbound 'hmouse-alist)) ;; for `hmouse-drag-item-to-display' +(require 'hui-window) (require 'hypb) ;; Quiet byte compiler warnings for these free variables. -(eval-when-compile - (defvar hkey-action nil) - (defvar pred-value nil)) +(defvar hkey-action) +(defvar pred-value) ;;; ************************************************************************ ;;; Public variables diff --git a/hui-mouse.el b/hui-mouse.el index 000bbcc..922df5d 100644 --- a/hui-mouse.el +++ b/hui-mouse.el @@ -4,7 +4,7 @@ ;; ;; Orig-Date: 04-Feb-89 ;; -;; Copyright (C) 1991-2017 Free Software Foundation, Inc. +;; Copyright (C) 1991-2018 Free Software Foundation, Inc. ;; See the "HY-COPY" file for license information. ;; ;; This file is part of GNU Hyperbole. @@ -390,7 +390,7 @@ smart keyboard keys.") (require 'hmouse-key) ;; This next library adds drag actions to `hmouse-alist'. -(load "hui-window") +(require 'hui-window) ;;; ************************************************************************ ;;; support code diff --git a/hui-window.el b/hui-window.el index d58e602..87b6364 100644 --- a/hui-window.el +++ b/hui-window.el @@ -4,7 +4,7 @@ ;; ;; Orig-Date: 21-Sep-92 ;; -;; Copyright (C) 1992-2017 Free Software Foundation, Inc. +;; Copyright (C) 1992-2018 Free Software Foundation, Inc. ;; See the "HY-COPY" file for license information. ;; ;; This file is part of GNU Hyperbole. @@ -171,9 +171,9 @@ drag release window.") ;;; ;;; Add window handling to hmouse-alist dispatch table. -;;; -(if (not (boundp 'hmouse-alist)) - (error "\"hui-window.el\": `hmouse-alist' must be defined before loading this.") + +(defvar hmouse-alist) +(defun hui-window--register () (unless (assoc #'(hmouse-inactive-minibuffer-p) hmouse-alist) (setq hmouse-alist (append @@ -241,6 +241,7 @@ drag release window.") ;; ) hmouse-alist)))) +(with-eval-after-load 'hui-mouse (hui-window--register)) ;;; ************************************************************************ ;;; Public functions