Commit b0df8b95 authored by Dmitry Gutov's avatar Dmitry Gutov

Replace uses of `save-buffer' with `write-region'

* lisp/emacs-lisp/package.el (package--download-one-archive): Use
`write-region' instead of `save-buffer' to avoid running various
hooks. 
(describe-package-1): Same.  Insert newline at the end of the
buffer if appropriate.

Fixes: debbugs:17155
parent 2614b25f
2014-05-21 Dmitry Gutov <dgutov@yandex.ru>
* emacs-lisp/package.el (package--download-one-archive): Use
`write-region' instead of `save-buffer' to avoid running various
hooks. (Bug#17155)
(describe-package-1): Same. Insert newline at the end of the
buffer if appropriate.
2014-05-20 Juri Linkov <juri@jurta.org>
* avoid.el (mouse-avoidance-set-mouse-position): Don't raise frame.
......
......@@ -1254,10 +1254,7 @@ similar to an entry in `package-alist'. Save the cached copy to
;; may fetch a URL redirect page).
(when (listp (read (current-buffer)))
(make-directory dir t)
(setq buffer-file-name (expand-file-name file dir))
(let ((version-control 'never)
(require-final-newline nil))
(save-buffer))))
(write-region nil nil (expand-file-name file dir) nil 'silent)))
(when good-signatures
;; Write out good signatures into archive-contents.signed file.
(write-region (mapconcat #'epg-signature-to-string good-signatures "\n")
......@@ -1503,11 +1500,13 @@ If optional arg NO-ACTIVATE is non-nil, don't activate packages."
(package--with-work-buffer
(package-archive-base desc)
(format "%s-readme.txt" name)
(setq buffer-file-name
(expand-file-name readme package-user-dir))
(let ((version-control 'never)
(require-final-newline t))
(save-buffer))
(save-excursion
(goto-char (point-max))
(unless (bolp)
(insert ?\n)))
(write-region nil nil
(expand-file-name readme package-user-dir)
nil 'silent)
(setq readme-string (buffer-string))
t))
(error nil))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment