branch: master commit ec0539b41189a124582a1ce7ee0159f994856042 Author: Ian Dunn <du...@gnu.org> Commit: Ian Dunn <du...@gnu.org>
Fixed enwc-setup to be able to be called more than once. * enwc.el (enwc-mode-line-timer): Create new variable to track mode-line timer. * enwc-setup.el (enwc-setup): Use cl-pushnew instead of append to add to global-mode-string. Use new variable for timer. --- lisp/enwc-setup.el | 7 +++---- lisp/enwc.el | 2 ++ 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/lisp/enwc-setup.el b/lisp/enwc-setup.el index c0e3ac2..014cb74 100644 --- a/lisp/enwc-setup.el +++ b/lisp/enwc-setup.el @@ -97,10 +97,9 @@ "Sets up ENWC. This setups ENWC and confirms that one of the backends can be found on D-Bus." - (setq global-mode-string (append global-mode-string - '(enwc-display-string))) - (run-at-time t 1 'enwc-update-mode-line) - + (cl-pushnew 'enwc-display-string global-mode-string :test #'equal) + (unless enwc-mode-line-timer + (setq enwc-mode-line-timer (run-at-time t 1 'enwc-update-mode-line))) (let ((cur-back nil) (back-list enwc-backends)) (while (and back-list (not cur-back)) diff --git a/lisp/enwc.el b/lisp/enwc.el index 83aa6d6..5308e2b 100644 --- a/lisp/enwc.el +++ b/lisp/enwc.el @@ -233,6 +233,8 @@ whether or not ENWC is in wired mode.") (defvar enwc-scan-interactive nil) +(defvar enwc-mode-line-timer nil) + (make-local-variable 'enwc-edit-id) ;; The Fonts