8

Every time when I change something in a buffer, and then I decided to install a package from packages.el, Emacs is repeatingly asking me if I want to save the other buffers, because it's changed.

I fail to understand the relation between this buffer and the installation of a package. On the internet I found no suitable answer.

Anyone care to explain the logic behind this?

Thanks in advance.

ReneFroger
  • 3,855
  • 22
  • 63
  • Please provide a recipe, so we know just what you are talking about. It sounds like Emacs is about to kill a buffer that has been modified, and is letting you know that so you can save it first. – Drew Apr 24 '16 at 00:43
  • See also http://emacs.stackexchange.com/questions/21347/package-install-is-checking-a-lot-of-files/21350 – wasamasa Apr 24 '16 at 09:37

1 Answers1

8

There isn't a lot of logic behind this. At least, not in the sense of a conscious decision. It's more of a feature of the compilation process that really doesn't apply to package management but nobody has bothered to fix it yet.

Whenever Emacs is about to compile something it asks you if you want to save edited buffers. That's actually something very useful, and makes perfect sense when you're compiling some code you're working on.

In particular, this applies to the byte compiler, which compiles Elisp files. And one of the steps of installing a package is to byte compile it. When this happens, Emacs will do its usual routine of asking you to save stuff, even though it doesn't really matter here.

Malabarba
  • 22,878
  • 6
  • 78
  • 163
  • Thanks for your reply. It makes sense then. It's even asking to save org-files, php-files, Javascript files etc who all cannot be compiled. Poor boy when package.el tells you you can upgrade 40 packages, and you just do it. Then you need to confirm/deny for every unsaved buffer that you don't want to save it. – ReneFroger Apr 24 '16 at 09:12