]> code.delx.au - gnu-emacs-elpa/commitdiff
Avoid bug in insert-file-contents with REPLACE=t
authorNoam Postavsky <npostavs@users.sourceforge.net>
Tue, 31 May 2016 00:21:19 +0000 (20:21 -0400)
committerNoam Postavsky <npostavs@users.sourceforge.net>
Tue, 31 May 2016 00:21:19 +0000 (20:21 -0400)
* yasnippet.el (yas--load-directory-2): Call `erase-buffer' before
`insert-file-contents' instead of passing non-nil REPLACE, avoids Emacs
bug #23659.

Fixes #707.

yasnippet.el

index f670a29e3ae2973cbf098214431560ba3e4ae65a..7b87cd3408555f3ab253f54ec61d7112c8f0025b 100644 (file)
@@ -1805,7 +1805,10 @@ With prefix argument USE-JIT do jit-loading of snippets."
     (with-temp-buffer
       (dolist (file (yas--subdirs directory 'no-subdirs-just-files))
         (when (file-readable-p file)
-          (insert-file-contents file nil nil nil t)
+          ;; Erase the buffer instead of passing non-nil REPLACE to
+          ;; `insert-file-contents' (avoids Emacs bug #23659).
+          (erase-buffer)
+          (insert-file-contents file)
           (push (yas--parse-template file)
                 snippet-defs))))
     (when snippet-defs