* 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.
* emacs/guix-info.el (guix-info-mode-initialize): New procedure. Set
'font-lock-defaults' to avoid syntactic fontification.
(guix-info-define-interface): Use it.
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-list.el: Use separate edit commands instead of a single one.
(guix-list-for-each-line, guix-list-edit-package): Remove.
(guix-package-list-edit, guix-output-list-edit): New procedures.
(guix-package-list-mode-map, guix-output-list-mode-map): Use them.
* emacs/guix-list.el (guix-list-sort-key): New procedure.
(guix-list-tabulated-sort-key): Use it.
(guix-list-define-entry-type): Generate
'guix-ENTRY-TYPE-list-sort-key' variables.
* 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-list.el: Generate predicates to sort tabulated list
columns numerically.
(guix-list-define-numerical-sorter)
(guix-list-define-numerical-sorters): New macros
(guix-list-column-format): Use 'guix-list-sort-numerically-0' for
generation "Number" column.
* 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-utils.el (guix-with-indent): New macro.
(guix-memoized-font-lock-keywords): Rename to...
(guix-utils-font-lock-keywords): ... this. Add it.
* emacs/guix-info.el (guix-info-insert-entry-default): Use it.
Suggested by Florian Paul Schmidt.
* emacs/guix-backend.el (guix-default-port): Remove.
(guix-repl-socket-file-name-function, guix-repl-current-socket): New
variables.
(guix-repl-socket-file-name, guix-repl-delete-socket-maybe): New
procedures.
(guix-get-guile-program): Take socket as an optional argument.
(guix-start-repl-maybe): Adjust accordingly.
* emacs/guix-emacs.el (guix-emacs-autoloads-regexp): New variable.
(guix-emacs-find-autoloads-in-directory): Return a list of autoloads
without extensions.
* emacs/guix-command.el (guix-command-improve-common-build-argument):
Use "R" key for '--rounds' option to avoid conflicts with "r" key in
'build' popup (--root) and 'package' popup (--remove).
* emacs/guix-emacs.el (guix-emacs-load-autoloads): Use 'profile'
as an optional argument.
(guix-emacs-load-autoloads-maybe): Adjust accordingly.
* emacs/guix-init.el: Likewise.
* 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.
* emacs/guix-command.el (guix-command-improve-environment-argument): Use
"E" for '--expose' and "S" for '--share' to distinguish them from
'--expression' and '--system' accordingly. Make '--ad-hoc' an option
taking packages instead of a simple switch.
(guix-command-rest-argument): Complete shell command instead of
packages for '--' argument.
(guix-command-additional-arguments): Add fake 'packages' argument.
New variable.
(guix-command-additional-arguments): Use it.
(guix-command-post-process-environment-packages,
guix-command-post-process-environment-ad-hoc): New functions.
(guix-command-post-processors): Add "environment" command with the new
argument processors.
* emacs/guix-command.el (guix-command-improve-action-argument): Use "C"
key for 'container' action to distinguish it from 'challenge'.
(guix-command-rest-argument): Add positional arguments.
* emacs/guix-build-log.el (guix-build-log-minor-mode-activate): New variable.
(guix-build-log-minor-mode-activate-maybe): New function.
* emacs/guix-init.el: Add it to 'shell-mode-hook'.
* doc/emacs.texi (Emacs Build Log): Mention it.
* emacs/guix-build-log.el (guix-build-log-mode-hook): Remove
'compilation-shell-minor-mode' as it is slow on big buffers, and
'view-mode' as it rebinds too many keys.
(guix-build-log-mode-map): Add "c" and "v" key bindings for the
removed minor modes.
* emacs/guix-build-log.el (guix-build-log-mode-map): Move keys to ...
(guix-build-log-common-map): ...here. New variable.
(guix-build-log-minor-mode-map): New variable.
(guix-build-log-minor-mode): Use it.
* doc/emacs.texi (Emacs Build Log): Document it.
* gnu/services.scm (%modify-service, modify-services): New macros.
* gnu/services/base.scm (mingetty-service-type, guix-service-type):
Export.
* emacs/guix-devel.el (guix-devel-keywords): Add 'modify-services'.
Ditto in 'guix-devel-scheme-indent' call.
* doc/guix.texi (Using the Configuration System): Give an example of
'modify-services'.
(Service Reference): Document it.
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-config.el.in (guix-emacs-interface-directory,
guix-state-directory): Rename to ...
(guix-config-emacs-interface-directory, guix-config-state-directory):
...this.
(guix-config-guile-program): New constant.
(guix-guile-program): Move to ...
* emacs/guix-external.el (guix-guile-program): ...here. Make it a
'defcustom'.
* emacs/guix-profiles.el (guix-default-profile): Use
'guix-config-state-directory'.
* emacs/guix-backend.el (guix-load-path): Use
'guix-config-emacs-interface-directory'.
Suggested by Ludovic Courtès <ludo@gnu.org>.
* configure.ac: Set DOT_USER_PROGRAM variable.
* emacs/guix-config.el.in (guix-config-dot-program): New constant.
* emacs/guix-external.el (guix-dot-program): Use it.
Suggested by Ludovic Courtès <ludo@gnu.org>.
* emacs/guix-external.el (guix-png-file-name): Change prefix of a file
name to "guix-emacs-graph-" to avoid possible conflicts.
Fixes a regression introduced in 7741139080.
Reported by Ludovic Courtès <ludo@gnu.org>.
Not all emacs packages have "...-autoloads.el" files, so there is a
chance that "~/.guix-profile/share/emacs/site-lisp" will not be added to
'load-path', so add it unconditionally.
* emacs/guix-init.el: Add guix emacs directory to 'load-path'. Move
requiring 'guix-emacs' to the top-level.
Suggested by Ludovic Courtès <ludo@gnu.org>.
* emacs/guix-devel.el: Add indentation rules for Guix macros/procedures.
(guix-devel-scheme-indent): New macro.
(guix-devel-indent-package): New function.
Suggested by Ludovic Courtès <ludo@gnu.org>.
* guix/scripts.scm (build-package-source): New procedure.
* emacs/guix-devel.el (guix-devel-build-package-source): New command.
(guix-devel-keys-map): Add key binding for it.
* doc/emacs.texi (Emacs Development): Document it.
Suggested by Ludovic Courtès <ludo@gnu.org>.
* emacs/guix-devel.el (guix-devel-setup-repl): Add a workaround for
'guix-warning-port'.
(guix-devel-lint-package): New command.
(guix-devel-keys-map): Add key binding for it.
* doc/emacs.texi (Emacs Development): Document it.
* emacs/guix-devel.el (guix-devel-with-definition): New macro.
(guix-devel-build-package-definition): Use it.
(guix-devel-emacs-font-lock-keywords): New variable.
Setting up guix ports needs to be done in Geiser REPL synchronously,
otherwise this operation may not be finished before the further
evaluating of guile code.
* emacs/guix-guile.el (guix-guile-prompt?): New function.
* emacs/guix-geiser.el (guix-geiser-eval-in-repl-synchronously): New
function.
* emacs/guix-devel.el (guix-devel-setup-repl): Use it.
* emacs/guix-build-log.el (guix-build-log-phase-toggle-all): Handle the
case when there are no characters before the first phase:
'guix-build-log-next-phase' moves to the second phase in such a case,
and the toggling is not done properly, so use 're-search-forward'
instead.
* emacs/guix-guile.el (guix-guile-keyword-regexp): New function.
* emacs/guix-devel.el (guix-devel-faces): New custom group.
(guix-devel-modify-phases-keyword): New face.
(guix-devel-modify-phases-keyword-regexp,
guix-devel-font-lock-keywords): New variables.
(guix-devel-modify-phases-font-lock-matcher,
guix-devel-modify-phases-font-lock-pre): New functions.
(guix-devel-mode): Adjust to add/remove font-lock-keywords.