]> code.delx.au - gnu-emacs/blobdiff - lisp/electric.el
Merge from origin/emacs-24
[gnu-emacs] / lisp / electric.el
index bf73dbb256ffed59aab58a051cd792e5133a4d0f..dd7767fd5eb9cd8c9fda48d376213d229d53401f 100644 (file)
@@ -1,6 +1,6 @@
 ;;; electric.el --- window maker and Command loop for `electric' modes
 
-;; Copyright (C) 1985-1986, 1995, 2001-2014 Free Software Foundation,
+;; Copyright (C) 1985-1986, 1995, 2001-2015 Free Software Foundation,
 ;; Inc.
 
 ;; Author: K. Shane Hartman
       ;; Don't shrink the window, but expand it if necessary.
       (goto-char (point-min))
       (unless (= (point-max) (window-end win t))
-       (fit-window-to-buffer win max-height))
+       ;; This call is executed even if the window existed before, was
+       ;; reused, ... contradicting a claim in the comment before this
+       ;; function.
+       (fit-window-to-buffer win max-height nil nil nil t))
       win)))
 
 ;;; Electric keys.
@@ -368,7 +371,7 @@ newline after CHAR but stay in the same place.")
                (setq pos (electric--after-char-pos))
                ;; Not in a string or comment.
                (not (nth 8 (save-excursion (syntax-ppss pos)))))
-      (let ((end (copy-marker (point)))
+      (let ((end (point-marker))
             (sym (if (functionp rule) (funcall rule) rule)))
         (set-marker-insertion-type end (not (eq sym 'after-stay)))
         (goto-char pos)