diff --git a/lisp/org.el b/lisp/org.el index 500e9659a..0c1d36a4e 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -6618,7 +6618,8 @@ This function is the default value of the hook `org-cycle-hook'." (cond ((eq state 'content) nil) ((eq state 'all) nil) - ((and (eq state 'folded) (eq last-command this-command)) + ((and org-scroll-position-to-restore + (eq state 'folded) (eq last-command this-command)) (set-window-start nil org-scroll-position-to-restore)) ((eq state 'folded) nil) ((eq state 'children)