]> git.eshelyaron.com Git - emacs.git/commitdiff
Avoid errors with recentering in 'skeleton-insert'
authorEli Zaretskii <eliz@gnu.org>
Sat, 30 Jun 2018 09:07:24 +0000 (12:07 +0300)
committerEli Zaretskii <eliz@gnu.org>
Sat, 30 Jun 2018 09:07:24 +0000 (12:07 +0300)
* lisp/skeleton.el (skeleton-insert): Don't recenter if we are
running in a buffer other than the one displayed in the selected
window.  (Bug#31950)

lisp/skeleton.el

index 90e3819cb7fd9954e17279202295671d35bf48f4..e3cebba916498d8bd37905c027e3d577121f8c5a 100644 (file)
@@ -268,7 +268,8 @@ available:
        (or (eolp) (not skeleton-end-newline) (newline-and-indent))
        (run-hooks 'skeleton-end-hook)
        (sit-for 0)
-       (or (pos-visible-in-window-p beg)
+       (or (not (eq (window-buffer) (current-buffer)))
+            (pos-visible-in-window-p beg)
            (progn
              (goto-char beg)
              (recenter 0)))