Suppress queries when installing package from file

* lisp/emacs-lisp/package.el (package-install-file): Assume it
is OK to set the visited file name, since we are not actually
touching anything on disk, and prevent the modified flag from
preventing us to kill the temporary buffer.  The flag is set by
tar-mode.
This commit is contained in:
Philip Kaludercic 2026-04-18 14:05:36 +02:00
parent 27434c0f9d
commit 0051e2b707
No known key found for this signature in database

View file

@ -2327,11 +2327,12 @@ directory."
(setq default-directory file)
(dired-mode))
(insert-file-contents-literally file)
(set-visited-file-name file)
(set-visited-file-name file t)
(set-buffer-modified-p nil)
(when (string-match "\\.tar\\'" file) (tar-mode)))
(unwind-protect
(package-install-from-buffer)
(with-silent-modifications
(package-install-from-buffer))
(fundamental-mode)))) ; free auxiliary data
;;;###autoload