From f058bd163d33c4203371509f5893f884d224db8f Mon Sep 17 00:00:00 2001 From: jenchieh Date: Sat, 9 Mar 2019 21:59:30 +0800 Subject: [PATCH] Fixed compile warnings. --- focus.el | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/focus.el b/focus.el index 9a0dd16..7b07697 100644 --- a/focus.el +++ b/focus.el @@ -198,7 +198,7 @@ default is overwritten. This function simply helps set the "Pin the focused section to its current location or the region, if active." (interactive) - (when focus-mode + (when (bound-and-true-p focus-mode) (when (region-active-p) (focus-move-overlays (region-beginning) (region-end))) (remove-hook 'post-command-hook 'focus-move-focus t))) @@ -206,7 +206,7 @@ if active." (defun focus-unpin () "Unpin the focused section." (interactive) - (when focus-mode + (when (bound-and-true-p focus-mode) (add-hook 'post-command-hook 'focus-move-focus nil t))) (defun focus-next-thing (&optional n) @@ -229,7 +229,8 @@ if active." This function is triggered by the `focus-read-only-blink-timer', when `focus-read-only-mode' is activated." (with-current-buffer focus-buffer - (when (and focus-read-only-mode (not (null focus-read-only-blink-timer))) + (when (and (bound-and-true-p focus-read-only-mode) + (not (null focus-read-only-blink-timer))) (setq focus-read-only-blink-timer nil) (setq cursor-type nil)))) @@ -238,7 +239,7 @@ when `focus-read-only-mode' is activated." This is added to the `pre-command-hook' when `focus-read-only-mode' is active." (with-current-buffer focus-buffer - (when (and focus-read-only-mode + (when (and (bound-and-true-p focus-read-only-mode) (not (member last-command '(focus-next-thing focus-prev-thing)))) (when focus-read-only-blink-timer (cancel-timer focus-read-only-blink-timer)) (setq cursor-type focus-cursor-type)