Skip to content

Commit

Permalink
Split up `focus-move-focus'
Browse files Browse the repository at this point in the history
  • Loading branch information
larstvei committed Jan 31, 2016
1 parent 307df45 commit f310fa1
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions focus.el
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit f310fa1

Please sign in to comment.