Reported by Christopher Allan Webber <cwebber@dustycloud.org> on #guix.
Several modules use the code from 'guix-profiles' without requiring it. It
was never noticed before commits e4e2154644
and 13fe4891fa, because 'guix-emacs' required
this module. But now, when 'site-start.el' loads 'guix-emacs',
'guix-profiles' may not exist yet, so it may not be required. This will
lead to an error when some of "M-x guix-..." commands will be used. See
<https://gnunet.org/bot/log/guix/2016-02-03#T898859>.
* emacs/guix-base.el: Require 'guix-profiles'.
* emacs/guix-ui.el: Likewise.
* emacs/guix-ui-generation.el: Likewise.
* emacs/guix-ui-package.el: Likewise.
* emacs/guix-main.scm (generation-package-specifications): Rename to...
(profile-package-specifications): ... this. Take a single 'profile'
argument.
(generation-difference): Rename to...
(profile-difference): ... this. Take profiles as arguments.
(package/output-sexps): Adjust accordingly.
* emacs/guix-ui-generation.el (guix-generation-list-profiles-to-compare):
New procedure.
(guix-generation-list-show-added-packages)
(guix-generation-list-show-removed-packages): Use it.
* emacs/guix-messages.el (guix-messages): Replace 'generation-diff' with
'profile-diff'.
(guix-message-outputs-by-diff): Adjust accordingly.
For a usual profile, packages are placed in a profile directory itself,
but for a system profile, packages are placed in 'profile'
sub-directory. So we need to do some special cases for system profiles
to find packages there as well.
* emacs/guix-base.el (guix-packages-profile): New procedure.
(guix-manifest-file): Use it. Add optional 'system?' argument.
* emacs/guix-ui-generation.el (guix-system-generation?)
(guix-generation-current-packages-profile): New procedures.
(guix-generation-packages, guix-generation-insert-packages): Remove
'generation' argument.
(guix-generation-packages-buffer): Add optional 'system?' argument.
(guix-profile-generation-manifest-file)
(guix-profile-generation-packages-buffer): Adjust accordingly.
* emacs/guix-main.scm (generation-package-specifications+paths): Rename to...
(profile->specifications+paths): ... this. Use a single 'profile' argument.
* emacs/guix-ui.el (guix-ui-read-profile): New procedure.
* emacs/guix-ui-package.el (guix-search-by-name)
(guix-search-by-regexp, guix-installed-packages)
(guix-obsolete-packages, guix-all-available-packages)
(guix-newest-available-packages): Use it.
* emacs/guix-ui-generation.el (guix-generations)
(guix-last-generations, guix-generations-by-time): Use it.
* emacs/guix-buffer.el (guix-define-groups, guix-define-entry-type)
(guix-define-buffer-type): New macros.
(guix-buffer-define-interface): Add parent groups for the generated
custom groups.
* emacs/guix-info.el: Use 'guix-define-buffer-type' to generate custom
groups.
* emacs/guix-list.el: Likewise.
* emacs/guix-ui.el: Use 'guix-define-groups' to generate custom groups.
(guix-ui-define-entry-type): New macro.
* emacs/guix-ui-package.el: Use it.
* emacs/guix-ui-generation.el: Use it.