Bladeren bron

org.el: Fix cycling hang when %p is in frame-title-format

* lisp/org.el (org-optimize-window-after-visibility-change): Guard
against calling set-window-start with a nil POS argument.

org-optimize-window-after-visibility-change calls set-window-start
with org-scroll-position-to-restore when it is a repeat call
(i.e. last-command and this-command match).  However,
org-scroll-position-to-restore may not have yet been set yet (e.g. if
org-startup-folded is at its default value of showeverything).

Calling set-window-start appears to generally be a noop, but, for a
reason that I don't understand, it triggers a hang when %p is in
frame-title-format.

Reported-by: Massimo Lauria <massimo.lauria@uniroma1.it>
Ref: https://orgmode.org/list/CAJCFsEEHJXP4nKZpWdzheMM5O0Dq-tT+v0u0FsT+3Q0mi4v10A@mail.gmail.com
Kyle Meyer 4 jaren geleden
bovenliggende
commit
4f8ac0a7a3
1 gewijzigde bestanden met toevoegingen van 2 en 1 verwijderingen
  1. 2 1
      lisp/org.el

+ 2 - 1
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)