From f310fa1c31f6cdc046c2e4f9bba7235cc10c0ccf Mon Sep 17 00:00:00 2001 From: Lars Tveito Date: Sun, 31 Jan 2016 23:13:29 +0100 Subject: [PATCH] Split up `focus-move-focus' --- focus.el | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/focus.el b/focus.el index 2670dbb..e53d2b1 100644 --- a/focus.el +++ b/focus.el @@ -138,14 +138,18 @@ argument." (make-list foregrounds foreground))))) (defun focus-move-focus () - "Move `focus-pre-overlay' and `focus-post-overlay'. + "Moves the focused section according to `focus-bounds'. -If function `focus-mode' is enabled, this command fires after -each command." +If `focus-mode' is enabled, this command fires after each +command." (let* ((bounds (focus-bounds))) (when bounds - (move-overlay focus-pre-overlay (point-min) (car bounds)) - (move-overlay focus-post-overlay (cdr bounds) (point-max))))) + (focus-move-overlays (car bounds) (cdr bounds))))) + +(defun focus-move-overlays (low high) + "Move `focus-pre-overlay' and `focus-post-overlay'." + (move-overlay focus-pre-overlay (point-min) low) + (move-overlay focus-post-overlay high (point-max))) (defun focus-init () "This function is run when command `focus-mode' is enabled.