From 1423efbd255e574eafbd834d5ab7409218737c21 Mon Sep 17 00:00:00 2001 From: Lars Tveito Date: Sun, 24 May 2015 02:40:35 +0200 Subject: [PATCH] Don't assume bounds are found --- focus.el | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/focus.el b/focus.el index 2386733..578243a 100644 --- a/focus.el +++ b/focus.el @@ -167,8 +167,9 @@ deleted, and `focus-move-focus' is removed from `post-command-hook'." (interactive "p") (forward-thing (focus-get-thing) (+ 1 n)) (let ((bounds (focus-bounds))) - (goto-char (/ (+ (car bounds) (cdr bounds)) 2))) - (recenter nil)) + (when bounds + (goto-char (/ (+ (car bounds) (cdr bounds)) 2)) + (recenter nil)))) (defun focus-prev-thing (&optional n) "Moves the point to the middle of the Nth previous thing."