* emacs/guix-ui.el (guix-ui-buffer-name-default): Rename to...
(guix-ui-buffer-name-short): ... this.
(guix-ui-buffer-name-full): New procedure.
(guix-ui-buffer-name-function): Set it as default.
* emacs/guix-ui.el (guix-ui-buffer-name-default): Extract the code to
compose buffer name and move to...
* emacs/guix-utils.el (guix-compose-buffer-name): ... here. New procedure.
'guix-init' served 2 purposes:
- to autoload guix commands (by requiring 'guix-autoloads');
- and to autoload Emacs packages installed with Guix (by requiring
'guix-emacs').
The second purpose is not actual anymore, as Emacs package handles this
task now, so there is no need in 'guix-init' anymore.
* emacs/guix-init.el: Do not require 'guix-emacs'. Add a deprecation
message.
* doc/emacs.texi (Emacs Initial Setup): Recommend to use
'guix-autoloads' instead of 'guix-init'.
Reported by Ludovic Courtès <ludo@gnu.org>.
* emacs/guix-ui-package.el (guix-package-name): Check 'spec' property.
(guix-package-info-insert-heading): Use "name version" for button label,
write name specification to 'spec' property.
Fixes <http://bugs.gnu.org/22933>.
* emacs/guix-main.scm (package-location-string): Rewrite to handle the
case where 'packages-by-name' returns the empty list.
Co-authored-by: Mathieu Lirzin <mthl@gnu.org>
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.
* emacs/guix-hydra.el (guix-hydra-job-name-specification): New procedure.
* emacs/guix-ui-package.el (guix-package-info-insert-systems)
(guix-package-list-latest-builds): Use it.
Fixes <http://bugs.gnu.org/22607>.
Reported by myglc2 <myglc2@gmail.com>.
Remove possibilities to install/delete packages to/from a system profile
both for "Package List" and "Package Info" buffers.
* emacs/guix-profiles.el (guix-system-profile-regexp): New variable.
(guix-system-profile?): New procedure.
* emacs/guix-ui-package.el (guix-package-info-insert-output): Do not
display "Install"/"Delete" button for a system profile.
(guix-package-assert-non-system-profile): New procedure.
(guix-package-execute-actions): Use it.
* emacs/guix-buffer.el (guix-buffer-set): Set 'guix-buffer-item' early,
so that it can be used during displaying entries. For example, this
allows us to use a value of the current guix profile when package
entries are inserted in a "List" or "Info" buffer.
Fixes <http://bugs.gnu.org/22550>.
Reported by myglc2 <myglc2@gmail.com>.
* emacs/guix-emacs.el (guix-emacs-autoload-packages): Autoload Emacs
packages installed in a system profile.
This code should belong to "guix-backend" as it is run after a REPL
operation to check if new Emacs packages have been installed and to
autoload them if needed.
* emacs/guix-emacs.el (guix-emacs-activate-after-operation)
(guix-emacs-load-autoloads-maybe): Move and rename to...
* emacs/guix-backend.el (guix-emacs-activate-after-operation)
(guix-repl-autoload-emacs-packages-maybe): ... this.
(guix-after-repl-operation-hook): Adjust for the renaming.
* emacs/guix-emacs.el: (guix-emacs-directories): New procedure.
(guix-emacs-find-autoloads-in-directory): Rename to...
(guix-emacs-find-autoloads): ... this.
(guix-emacs-load-autoloads): Remove. Replace with...
(guix-emacs-autoload-packages): ... this. New procedure. At first,
find a list of directories with Emacs packages, then add them to
'load-path' and finally, load autoloads.
* doc/emacs.texi (Emacs Initial Setup): Adjust accordingly.
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.
This is a followup to commit 47c0f92c37.
* emacs/guix-command.el (guix-command-improve-common-build-argument):
Use "W" key for '--with-input' option (leave "w" for '--with-source').
* emacs/guix-main.scm (packages-by-license): New procedure.
(%patterns-makers): Add 'license' search type.
* emacs/guix-messages.el (guix-message-packages-by-license): New procedure.
(guix-messages): Use it.
* emacs/guix-ui-package.el (guix-packages-by-license): New command.
* doc/emacs.texi (Emacs Commands): Document it.
* emacs/guix-ui-package.el (guix-package-license): New button type.
(guix-package-info-format, guix-output-info-format): Use it.
* doc/emacs.texi (Emacs Info buffer): Mention it.
* emacs/guix-main.scm (%licenses): New variable.
(licenses, license-names, lookup-license, lookup-license-uri): New
procedures.
* emacs/guix-read.el (guix-license-names, guix-read-license-name): New
procedures.
* emacs/guix-license.el: New file.
(guix-lookup-license-url): New procedure.
(guix-browse-license-url): New command.
* emacs.am (ELFILES): Add new file.
* emacs/guix-main.scm (system-generation-boot-parameters)
(system-generation-param-alist, system-generation-sexps): New procedures.
(entries): Add 'system-generation' entry type.
* emacs/guix-messages.el (guix-result-message): Use the same messages
for 'generation' and 'system-generation' entry types.
* emacs/guix-ui-system-generation.el: New file.
* emacs.am (ELFILES): Add it.
* doc/emacs.texi (Emacs Commands): Document new commands.
* NEWS: Mention new interface.
* 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.
Reported by Ludovic Courtès <ludo@gnu.org> on #guix.
This fixes a regression introduced in commit 7171d824.
'insert-text-button' procedure does not allow to override a button face,
so a specialized button type should be used instead.
* emacs/guix-ui-package.el (guix-package-heading): New button type.
(guix-package-info-insert-heading): Use it.
"guix-emacs.el" may be used just for "instructing" Emacs where to find
Emacs packages installed with Guix, so it should have as few
dependencies as possible.
See <http://lists.gnu.org/archive/html/guix-devel/2016-01/msg00022.html>.
* emacs/guix-emacs.el: Require 'guix-profiles' optionally.
(guix-emacs-load-autoloads): Use 'guix-profile-prompt' only if it is
available.
* emacs/guix-pcomplete.el (guix-pcomplete-complete-option-arg): Complete
file name for '--install-from-file' option of 'guix package' command,
and for '--file' and '--with-source' options of 'guix build' command.
* emacs/guix-ui-package.el (guix-package-list-latest-builds): New
procedure.
(guix-package-list-mode-map): Bind "B" key to it.
(guix-output-list-mode-map): Likewise.
* doc/emacs.texi (Emacs List buffer): Document it.
* 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.