summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Monnier <monnier@iro.umontreal.ca>2014-09-02 15:51:25 -0400
committerStefan Monnier <monnier@iro.umontreal.ca>2014-09-02 15:51:25 -0400
commit559b827d8aba3ca060f3875a65028cffe71f258b (patch)
tree4cb648c9aa427312b6ef0452fc212d4801e19cfe
parent9de3064db6370972998737a9aa7cce7856c42aef (diff)
downloademacs-559b827d8aba3ca060f3875a65028cffe71f258b.tar.gz
* lisp/emacs-lisp/package.el (package-generate-description-file):
Properly quote the arguments. 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. Fixes: debbugs:18332
-rw-r--r--lisp/ChangeLog8
-rw-r--r--lisp/emacs-lisp/package.el24
2 files changed, 23 insertions, 9 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index c91f43cafa0..1e130d05cf6 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -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.
diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el
index b70b478cd32..329ab8e6de7 100644
--- a/lisp/emacs-lisp/package.el
+++ b/lisp/emacs-lisp/package.el
@@ -688,11 +688,9 @@ untar into a directory named DIR; otherwise, signal an error."
(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 @@ untar into a directory named DIR; otherwise, signal an error."
(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 @@ untar into a directory named DIR; otherwise, signal an error."
(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?
)