emacs: Use '@' to separate package names and version numbers.

This is a followup to commit 1b846da8c3.

* emacs/guix-base.el (guix-package-name-specification): Use "@" instead
of "-".
* emacs/guix-main.scm (name+version->full-name): Likewise.
(package-inputs-names): Use 'make-package-specification' instead of
'package-full-name'.
(full-name->name+version): Update the docstring.
* emacs/guix-ui-package.el (guix-packages-by-name): Likewise.
This commit is contained in:
Alex Kost 2016-03-03 12:53:03 +03:00
parent b8fa5a2ae8
commit db0c709b9a
3 changed files with 6 additions and 5 deletions

View file

@ -44,7 +44,7 @@
(defun guix-package-name-specification (name version &optional output) (defun guix-package-name-specification (name version &optional output)
"Return Guix package specification by its NAME, VERSION and OUTPUT." "Return Guix package specification by its NAME, VERSION and OUTPUT."
(concat name "-" version (concat name "@" version
(when output (concat ":" output)))) (when output (concat ":" output))))

View file

@ -86,13 +86,13 @@ (define (output+error thunk)
(define (full-name->name+version spec) (define (full-name->name+version spec)
"Given package specification SPEC with or without output, "Given package specification SPEC with or without output,
return two values: name and version. For example, for SPEC return two values: name and version. For example, for SPEC
\"foo-0.9.1b:lib\", return \"foo\" and \"0.9.1b\"." \"foo@0.9.1b:lib\", return \"foo\" and \"0.9.1b\"."
(let-values (((name version output) (let-values (((name version output)
(package-specification->name+version+output spec))) (package-specification->name+version+output spec)))
(values name version))) (values name version)))
(define (name+version->full-name name version) (define (name+version->full-name name version)
(string-append name "-" version)) (string-append name "@" version))
(define* (make-package-specification name #:optional version output) (define* (make-package-specification name #:optional version output)
(let ((full-name (if version (let ((full-name (if version
@ -263,7 +263,8 @@ (define (package-inputs-names inputs)
"Return a list of full names of the packages from package INPUTS." "Return a list of full names of the packages from package INPUTS."
(filter-map (match-lambda (filter-map (match-lambda
((_ (? package? package)) ((_ (? package? package))
(package-full-name package)) (make-package-specification (package-name package)
(package-version package)))
((_ (? package? package) output) ((_ (? package? package) output)
(make-package-specification (package-name package) (make-package-specification (package-name package)
(package-version package) (package-version package)

View file

@ -946,7 +946,7 @@ See `guix-find-location' for the meaning of DIRECTORY."
(defun guix-packages-by-name (name &optional profile) (defun guix-packages-by-name (name &optional profile)
"Display Guix packages with NAME. "Display Guix packages with NAME.
NAME is a string with name specification. It may optionally contain NAME is a string with name specification. It may optionally contain
a version number. Examples: \"guile\", \"guile-2.0.11\". a version number. Examples: \"guile\", \"guile@2.0.11\".
If PROFILE is nil, use `guix-current-profile'. If PROFILE is nil, use `guix-current-profile'.
Interactively with prefix, prompt for PROFILE." Interactively with prefix, prompt for PROFILE."