bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#23692: 25.1.50; Package.el gets confused if file has no autoloads (c


From: Clément Pit--Claudel
Subject: bug#23692: 25.1.50; Package.el gets confused if file has no autoloads (could be a bug in update-directory-autoloads)
Date: Fri, 3 Jun 2016 18:03:46 -0400
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.8.0

When the a single-package file has no autoloads, the call to 
update-directory-autoloads leaves the generated autoload files modified, but 
unsaved. This causes package.el to prompt the user about killing a modified 
file.

Small repro: paste the following in *scratch* and run 
package-install-from-buffer.


;;; test-package.el --- blah

;; Author: Me
;; Version: 1.0

(provide 'test-package)
;;; test-package.el ends here


This will show the following message: "Buffer test-package-autoloads.el 
modified; kill anyway? (yes or no)"

The problem happens when package.el reaches the following bit:

(defun package-generate-autoloads (name pkg-dir)
  (let* (...)
    ...
    (let ((buf (find-buffer-visiting generated-autoload-file)))
      (when buf (kill-buffer buf))) ;; <-- HERE
    ...))

The particular path that leads to an error condition is the following: inside 
of update-directory-autoloads, we see this:

      ;; Don't modify the file if its content has not been changed, so `make'
      ;; dependencies don't trigger unnecessarily.
      (when changed
        (let ((version-control 'never))
          (save-buffer)))

The flag `changed` is only set to `t` if files autoloads are found. However, 
file without autoloads also get added to the generated autoloads file:

    ;;;### (autoloads nil nil (some file names here) (0 0 0
    ;;;;;;  0))

I'm not sure which part of this is a bug: package.el assuming that 
update-directory-autoloads always saves the file after modifying it (which 
seems false), or update-directory-autoloads not saving the file. In any case, 
it's probably a misfeature that package.el prompts the user about killing a 
modified autoloads file as part of the installation process.

Thanks!
Clément.

In GNU Emacs 25.1.50.1 (x86_64-unknown-linux-gnu, GTK+ Version 3.10.8)
 of 2016-05-28 built on clem-w50-mint
Repository revision: 8377f2ed8aad863d6c59987b7b53fbceee46881e
Windowing system distributor 'The X.Org Foundation', version 11.0.11501000
System Description:     Linux Mint 17.3 Rosa

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]