* emacs/guix-main.scm: Use (guix scripts) module for 'build-package'
procedure.
* emacs/guix-base.el (guix-build-package): New procedure.
* emacs/guix-ui-package.el (guix-package-info-insert-build-button): New
procedure.
(guix-package-info-button-functions): New variable.
(guix-package-info-insert-misc): Insert buttons using it.
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.
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.
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.
This is a partial revert of commit d2b299a91f.
* emacs/guix-base.el (guix-revert-buffer): Make it more general by
removing the code specific to a particular search (a search for
packages/outputs by ID). Rename to...
(guix-buffer-revert): ... this.
* emacs/guix-base.el (guix-buffer-after-redisplay-hook): New variable.
(guix-redisplay-buffer): Use it. Remove all arguments and the code
for moving point to the next button. Rename to...
(guix-buffer-redisplay): ... this.
(guix-buffer-redisplay-goto-button): New procedure.
* emacs/guix-info.el (guix-package-info-show-source): Use it. Adjust
accordingly.
(guix-package-info-redisplay-after-download): Likewise.
* emacs/guix-base.el (guix-buffer-history-size): New procedure.
(guix-buffer-define-interface): Use it in the mode definition.
(guix-buffer-revert-confirm?): New procedure.
(guix-revert-buffer): Use it.
Make a root 'guix-buffer-define-interface' macro. It should generate a
common code for any type of interface. Inherit 'guix-info-define-interface'
and 'guix-list-define-interface' from it. They should provide a general
'info'/'list' interface for any data. Finally, make
'guix-ui-define-interface' for the common code for interfaces to Guix
packages and generations, and inherit 'guix-ui-info-define-interface' and
'guix-ui-list-define-interface' from it.
* emacs/guix-base.el (guix-define-buffer-type): Rename to...
(guix-buffer-define-interface): ... this. Rename internal
variables ('buf-' -> 'buffer-'). Move ':required' keyword to
'guix-ui-define-interface'.
* emacs/guix-info.el (guix-info-define-interface): New macro.
(guix-info-font-lock-keywords): New variable.
* emacs/guix-list.el (guix-list-define-entry-type): Rename to...
(guix-list-define-interface): ... this.
(guix-list-font-lock-keywords): New variable.
(guix-list-describe-ids): Move and rename to...
* emacs/guix-ui.el: New file.
(guix-ui-list-describe): ... this.
(guix-ui-define-interface, guix-ui-info-define-interface)
(guix-ui-list-define-interface): New macros.
(guix-ui-font-lock-keywords): New variable.
* emacs.am (ELFILES): Add "emacs/guix-ui.el"
* emacs/guix-utils.el (guix-keyword-args-let): New macro.
(guix-utils-font-lock-keywords): Add it.
* emacs/guix-base.el (guix-define-buffer-type): Use it.
* emacs/guix-list.el (guix-list-define-entry-type): Use it.
* emacs/guix-read.el (guix-define-readers): Use it.
* emacs/guix-utils.el (guix-symbol-title): New procedure.
* emacs/guix-base.el (guix-get-param-title): Use it.
(guix-param-titles): Remove most titles as they are automatically
defined by 'guix-symbol-title'.
* emacs/guix-base.el (guix-pull): Handle prefix argument when it is run
interactively. Use 'guix-command' instead of 'guix-pull' to prevent
REPL exit if 'leave' happens.
* emacs/guix-base.el (guix-apply-manifest): Use 'guix-command' instead
of 'guix-package' to prevent REPL exit if 'leave' happens. Expand
profile and manifest file names, as relative file names lead to an
error.
This is a followup to commit 06d45f4566.
* emacs/guix-base.el (guix-switch-to-generation): Replace
'switch-to-generation' with 'switch-to-generation*'.
* emacs/guix-backend.el (guix-make-guile-expression): Move to...
* emacs/guix-guile.el: ... here. New file.
* emacs/guix-base.el: Use it.
* emacs/guix-command.el: Use it.
* emacs.am (ELFILES): Add it.
* emacs/guix-main.scm (output+error): New procedure.
(guix-command-output): Use it.
* emacs/guix-base.el (guix-command-output): Display error output in the
minibuffer.
* emacs/guix.el (guix-faces): New custom group.
* emacs/guix-base.el (guix-operation-option-key): Use it.
(guix-define-buffer-type): Generate faces group.
* emacs/guix-info.el: Adjust faces to use new groups.
(guix-info-faces): New custom group.
* emacs/guix-list.el: Likewise
(guix-list-faces): New custom group.
* emacs/guix-base.el (guix-package-location): New function.
(guix-edit-package): Rename and move to ...
* emacs/guix.el (guix-edit): ...here. Make it interactive.
* emacs/guix-command.el (guix-edit-action): New function (alias to
'guix-edit') to override the popup for edit command in "M-x guix".
* emacs/guix-list.el (guix-list-edit-package): Adjust for 'guix-edit'
renaming.
* emacs/guix-main.scm (package-location-string): Allow to accept package
id or package name as argument.
* emacs/guix-main.scm: Use (guix scripts lint) module.
(lint-checker-names): New procedure.
* emacs/guix-base.el (guix-lint-checker-names): New function.
* emacs/guix-utils.el (guix-concat-strings): New function.
* emacs/guix-pcomplete.el (guix-pcomplete-short-options): Use it.
* emacs/guix-base.el (guix-get-package-strings): Likewise.
* emacs/guix-base.el (guix-define-buffer-type): Move common key bindings
from here...
(guix-root-map): ... to here. New variable.
* emacs/guix-info.el (guix-info-mode-map): Use it.
* emacs/guix-list.el (guix-list-mode-map): Use it.
* doc/emacs.texi (Emacs Keymaps): Document it.
* emacs/guix-base.el (guix-list-or-info-buffer-p): Delete. Replace with...
(guix-buffer-p): ... this. New procedure.
(guix-buffers): Use it. Add 'modes' argument.
(guix-update-buffer): New procedure.
(guix-update-buffers-maybe): Rename to ...
(guix-update-buffers-maybe-after-operation): this. Use
'guix-update-buffer'.
* emacs/guix-base.el (guix-entry-to-specification,
guix-entries-to-specifications): New procedures.
(guix-revert-buffer): Search by name if searching by ID gives no results.