emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[nongnu] elpa/golden-ratio 6173b7c416 64/95: Prevent recenter error in p


From: ELPA Syncer
Subject: [nongnu] elpa/golden-ratio 6173b7c416 64/95: Prevent recenter error in post-command-hook for emacs-25.
Date: Thu, 7 Sep 2023 22:02:14 -0400 (EDT)

branch: elpa/golden-ratio
commit 6173b7c4165b056edbbd948d890dd3498f78138b
Author: Thierry Volpiatto <thierry.volpiatto@gmail.com>
Commit: Thierry Volpiatto <thierry.volpiatto@gmail.com>

    Prevent recenter error in post-command-hook for emacs-25.
    
    * golden-ratio.el (golden-ratio--post-command-hook): Delay call to 
golden-ratio
    until window to resize get its current-buffer.
    This error happen only in emacs-25.
---
 golden-ratio.el | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/golden-ratio.el b/golden-ratio.el
index 495c961ea8..b28e88bb75 100644
--- a/golden-ratio.el
+++ b/golden-ratio.el
@@ -120,7 +120,10 @@ will not cause the window to be resized to the golden 
ratio."
                  (loop for com in golden-ratio-extra-commands
                        thereis (or (memq com this-command)
                                    (memq (car-safe com) this-command)))))
-    (golden-ratio)))
+    ;; This is needed in emacs-25 to avoid this error from `recenter':
+    ;; `recenter'ing a window that does not display current-buffer.
+    ;; This doesn't happen in emacs-24.4 and previous versions.
+    (run-with-idle-timer 0.01 nil (lambda () (golden-ratio)))))
 
 (defun golden-ratio--mouse-leave-buffer-hook ()
   (run-at-time 0.1 nil (lambda ()



reply via email to

[Prev in Thread] Current Thread [Next in Thread]