all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "Clément Pit--Claudel" <clement.pitclaudel@live.com>
To: 23692@debbugs.gnu.org
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	[thread overview]
Message-ID: <5751FEC2.5080807@live.com> (raw)


[-- Attachment #1.1: Type: text/plain, Size: 2069 bytes --]

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 #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

             reply	other threads:[~2016-06-03 22:03 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-03 22:03 Clément Pit--Claudel [this message]
2016-06-03 22:50 ` bug#23692: 25.1.50; Package.el gets confused if file has no autoloads (could be a bug in update-directory-autoloads) Glenn Morris
2016-06-04  4:34   ` Clément Pit--Claudel
2016-06-06 17:24   ` Glenn Morris
2016-06-09  1:47     ` Stefan Monnier
2016-06-13 18:33       ` Glenn Morris
2016-06-14  0:40         ` Stefan Monnier
2016-10-10  9:56           ` Eli Zaretskii
2016-10-11 19:56             ` Stefan Monnier
2016-10-11 20:54               ` Eli Zaretskii
2016-06-13 22:17       ` Clément Pit--Claudel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5751FEC2.5080807@live.com \
    --to=clement.pitclaudel@live.com \
    --cc=23692@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.