unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@iro.umontreal.ca>
To: Glenn Morris <rgm@gnu.org>
Cc: Fabrice Niessen <fni-news@pirilampo.org>, 18332@debbugs.gnu.org
Subject: bug#18332: 24.3.93; Convenience is a malformed function when installing ELPA package
Date: Tue, 02 Sep 2014 15:53:20 -0400	[thread overview]
Message-ID: <jwvfvg9es1e.fsf-monnier+emacsbugs@gnu.org> (raw)
In-Reply-To: <hxiol6rmdw.fsf@fencepost.gnu.org> (Glenn Morris's message of "Tue, 02 Sep 2014 12:57:15 -0400")

> rm -rf /tmp/foo
> mkdir -p /tmp/foo

> HOME=/tmp/foo emacs-24.3.93 -l package \
>   --eval "(progn (package-initialize) (package-refresh-contents) (package-install 'yasnippet))"

> However I just get a byte-compilation warning, no error.

Don't know about the error, indeed.  I've fixed the two problems I saw
in the above test (first problem: the yasnippet-pkg.el file was
re-generated rather than just using the one that's in the tarball;
second problem: the file we generated did not properly quote the
arguments, hence the compilation warning).


        Stefan


=== modified file 'lisp/ChangeLog'
--- lisp/ChangeLog	2014-09-02 18:16:32 +0000
+++ lisp/ChangeLog	2014-09-02 19:49:58 +0000
@@ -1,5 +1,13 @@
 2014-09-02  Stefan Monnier  <monnier@iro.umontreal.ca>
 
+	* emacs-lisp/package.el (package-generate-description-file):
+	Properly quote the arguments (bug#18332).  Change second arg.
+	(package--alist-to-plist-args): Rename from package--alist-to-plist and
+	quote the elements.
+	(package--make-autoloads-and-stuff): Fix the test for pre-existence of
+	the *-pkg.el file.  Adjust to new calling convention of
+	package-generate-description-file.
+
 	* progmodes/gud.el (gud-gdb-completion-at-point): Add hack (bug#18282).
 	(gud-gdb-completions): Remove obsolete workaround.
 

=== modified file 'lisp/emacs-lisp/package.el'
--- lisp/emacs-lisp/package.el	2014-06-26 13:47:37 +0000
+++ lisp/emacs-lisp/package.el	2014-09-02 19:46:57 +0000
@@ -688,11 +688,9 @@
 	    (error "Package does not untar cleanly into directory %s/" dir)))))
   (tar-untar-buffer))
 
-(defun package-generate-description-file (pkg-desc pkg-dir)
+(defun package-generate-description-file (pkg-desc pkg-file)
   "Create the foo-pkg.el file for single-file packages."
-  (let* ((name (package-desc-name pkg-desc))
-         (pkg-file (expand-file-name (package--description-file pkg-dir)
-                                     pkg-dir)))
+  (let* ((name (package-desc-name pkg-desc)))
     (let ((print-level nil)
           (print-quoted t)
           (print-length nil))
@@ -712,13 +710,20 @@
                            (list (car elt)
                                  (package-version-join (cadr elt))))
                          requires))))
-          (package--alist-to-plist
+          (package--alist-to-plist-args
            (package-desc-extras pkg-desc))))
         "\n")
        nil pkg-file nil 'silent))))
 
-(defun package--alist-to-plist (alist)
-  (apply #'nconc (mapcar (lambda (pair) (list (car pair) (cdr pair))) alist)))
+(defun package--alist-to-plist-args (alist)
+  (mapcar (lambda (x)
+            (if (and (not (consp x))
+                     (or (keywordp x)
+                         (not (symbolp x))
+                         (memq x '(nil t))))
+                x `',x))
+          (apply #'nconc
+                 (mapcar (lambda (pair) (list (car pair) (cdr pair))) alist))))
 
 (defun package-unpack (pkg-desc)
   "Install the contents of the current buffer as a package."
@@ -751,9 +756,10 @@
 (defun package--make-autoloads-and-stuff (pkg-desc pkg-dir)
   "Generate autoloads, description file, etc.. for PKG-DESC installed at PKG-DIR."
   (package-generate-autoloads (package-desc-name pkg-desc) pkg-dir)
-  (let ((desc-file (package--description-file pkg-dir)))
+  (let ((desc-file (expand-file-name (package--description-file pkg-dir)
+                                     pkg-dir)))
     (unless (file-exists-p desc-file)
-      (package-generate-description-file pkg-desc pkg-dir)))
+      (package-generate-description-file pkg-desc desc-file)))
   ;; FIXME: Create foo.info and dir file from foo.texi?
   )
 






  reply	other threads:[~2014-09-02 19:53 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-26  8:16 bug#18332: 24.3.93; Convenience is a malformed function when installing ELPA package Fabrice Niessen
2014-08-26 16:10 ` Glenn Morris
2014-08-26 20:40   ` Thierry Volpiatto
     [not found]   ` <5a61hfdyfp.fsf-iW7gFb+/I3LZHJUXO5efmti2O/JbrIOy@public.gmane.org>
2014-08-29 21:01     ` Fabrice Niessen
2014-08-29 21:56       ` Glenn Morris
     [not found]         ` <ea38cf3qpl.fsf-iW7gFb+/I3LZHJUXO5efmti2O/JbrIOy@public.gmane.org>
2014-09-02 10:12           ` Fabrice Niessen
2014-09-02 16:57             ` Glenn Morris
2014-09-02 19:53               ` Stefan Monnier [this message]
     [not found]               ` <hxiol6rmdw.fsf-iW7gFb+/I3LZHJUXO5efmti2O/JbrIOy@public.gmane.org>
2014-09-02 20:47                 ` Fabrice Niessen
2014-09-02 20:57                   ` Stefan Monnier
     [not found]                   ` <mailman.8155.1409691562.1147.bug-gnu-emacs@gnu.org>
     [not found]                     ` <mailman.8155.1409691562.1147.bug-gnu-emacs-mXXj517/zsQ@public.gmane.org>
2014-09-05 15:44                       ` Fabrice Niessen
2014-09-05 16:24                         ` Glenn Morris
2014-09-02 17:38             ` Stefan Monnier
     [not found]               ` <jwv38c9gc0t.fsf-monnier+emacsbugs-mXXj517/zsQ@public.gmane.org>
2014-09-02 20:55                 ` Fabrice Niessen
2016-06-02 16:15 ` Noam Postavsky

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=jwvfvg9es1e.fsf-monnier+emacsbugs@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --cc=18332@debbugs.gnu.org \
    --cc=fni-news@pirilampo.org \
    --cc=rgm@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 public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).