From 13123998a42be86d71b018604ad32dfd6537b8c7 Mon Sep 17 00:00:00 2001 From: Artur Malabarba Date: Tue, 21 Apr 2015 23:41:56 +0100 Subject: sx-question-mode-hide-show-section complains if used incorrectly Fix #282 --- sx-question-mode.el | 2 ++ 1 file changed, 2 insertions(+) (limited to 'sx-question-mode.el') diff --git a/sx-question-mode.el b/sx-question-mode.el index 6583961..d1732fb 100644 --- a/sx-question-mode.el +++ b/sx-question-mode.el @@ -150,6 +150,8 @@ Optional argument _ is for `push-button'." (let ((ov (or (sx-question-mode--section-overlays-at (line-end-position)) (sx-question-mode--section-overlays-at (point))))) + (unless (overlayp ov) + (sx-user-error "Not inside a question or answer")) (goto-char (overlay-start ov)) (forward-line 0) (overlay-put -- cgit v1.2.3