Commit Graph

61 Commits

Author SHA1 Message Date
Alex Kost
79c7a8f214 emacs: Separate package location code.
* emacs/guix-base.el (guix-directory, guix-read-directory)
(guix-set-directory): Move to "guix-backend.el".
(guix-find-location, guix-package-location, guix-edit): Move to...
* emacs/guix-location.el: ... here.  New file.
* emacs/guix-ui-package.el: Use it.
* emacs.am (ELFILES): Add it.
2016-04-18 10:09:02 +03:00
Alex Kost
db0c709b9a 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.
2016-03-04 13:17:36 +03:00
Alex Kost
2c04e2eec8 emacs: 'C-u M-x guix-edit' prompts for directory.
* emacs/guix-base.el (guix-read-directory): New procedure.
(guix-find-location, guix-edit): Add optional 'directory' argument.
* emacs/guix-ui-package.el (guix-package-list-edit)
(guix-output-list-edit): Likewise.
* doc/emacs.texi (Emacs Commands): Mention "C-u".
2016-02-10 01:31:19 +03:00
Alex Kost
e20f051ec4 emacs: Add missing (require 'guix-profiles).
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.
2016-02-04 15:31:43 +03:00
Alex Kost
2df17bd0ee emacs: Find packages in system profiles.
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.
2016-01-16 13:02:21 +03:00
Alex Kost
c80ce104be emacs: Reorganize package/generation UI code.
Move the code for packages/generations interface from "guix-info.el",
"guix-list.el", "guix-base.el" and "guix.el" to "guix-ui-package.el" and
"guix-ui-generation.el".

* emacs/guix-base.el (guix-package-entry->name-specification)
  (guix-package-entries->name-specifications)
  (guix-package-id-and-output-by-output-id)
  (guix-package-installed-outputs, guix-process-package-actions)
  (guix-package-list-type, guix-package-info-type)
  (guix-continue-package-operation-p, guix-get-package-strings)
  (guix-insert-package-strings): Move to "guix-ui-package.el".
  (guix-generation-packages-buffer-name-function, guix-output-name-width)
  (guix-generation-packages-update-buffer, guix-generation-packages)
  (guix-generation-packages-buffer-name-default)
  (guix-generation-packages-buffer-name-long)
  (guix-generation-packages-buffer-name, guix-generation-packages-buffer)
  (guix-generation-insert-packages, guix-generation-insert-package)
  (guix-profile-generation-manifest-file, guix-delete-generations)
  (guix-profile-generation-packages-buffer, guix-switch-to-generation):
  Move to "guix-ui-generation.el".
* emacs/guix-info.el (guix-package-location, guix-package-name)
  (guix-package-source, guix-package-info-source)
  (guix-package-info-heading, guix-package-info-license)
  (guix-package-info-name, guix-package-info-name-button)
  (guix-package-info-version, guix-package-info-location)
  (guix-package-info-synopsis, guix-package-info-description)
  (guix-package-info-obsolete, guix-package-info-installed-outputs)
  (guix-package-info-uninstalled-outputs)
  (guix-package-info-insert-heading)
  (guix-package-info-define-insert-inputs)
  (guix-package-info-obsolete-string)
  (guix-package-info-insert-obsolete-text)
  (guix-package-info-insert-non-unique-text)
  (guix-package-info-insert-outputs, guix-package-info-insert-output)
  (guix-package-info-insert-action-button)
  (guix-package-info-auto-find-source)
  (guix-package-info-auto-download-source)
  (guix-package-info-download-buffer, guix-package-info-show-source)
  (guix-package-info-download-source, guix-package-info-insert-source)
  (guix-package-info-redisplay-after-download)
  (guix-output-info-insert-version, guix-output-info-insert-output):
  Move to "guix-ui-package.el".
  (guix-generation-info-number, guix-generation-info-current)
  (guix-generation-not-current, guix-generation-info-insert-number)
  (guix-generation-info-insert-current): Move to "guix-ui-generation.el".
* emacs/guix-list.el (guix-package-list-generation-marking-enabled)
  (guix-package-list-installed, guix-package-list-obsolete)
  (guix-package-list-get-name, guix-package-list-get-installed-outputs)
  (guix-package-list-marking-check, guix-package-list-mark-outputs)
  (guix-package-list-mark-install, guix-package-list-mark-delete)
  (guix-package-list-mark-upgrade, guix-package-list-mark-upgrades)
  (guix-list-mark-package-upgrades, guix-list-execute-package-actions)
  (guix-package-list-execute, guix-package-list-make-action)
  (guix-package-list-edit, guix-output-list-mark-install)
  (guix-output-list-mark-delete, guix-output-list-mark-upgrade)
  (guix-output-list-mark-upgrades, guix-output-list-make-action)
  (guix-output-list-describe, guix-output-list-edit): Move to
  "guix-ui-package.el".
  (guix-generation-list-get-current, guix-generation-list-switch)
  (guix-generation-list-generations-to-compare)
  (guix-generation-list-compare, guix-generation-list-show-packages)
  (guix-generation-list-show-added-packages)
  (guix-generation-list-show-removed-packages)
  (guix-generation-list-diff, guix-generation-list-diff-manifests)
  (guix-generation-list-ediff, guix-generation-list-ediff-manifests)
  (guix-generation-list-diff-packages)
  (guix-generation-list-ediff-packages)
  (guix-generation-list-mark-delete, guix-generation-list-execute): Move
  to "guix-ui-generation.el".
* emacs/guix.el: Remove.
  (guix, guix-faces, guix-edit): Move to "guix-base.el".
  (guix-list-single-package, guix-search-params, guix-search-history)
  (guix-get-show-packages, guix-search-by-name, guix-search-by-regexp)
  (guix-installed-packages, guix-obsolete-packages)
  (guix-all-available-packages, guix-newest-available-packages): Move
  to "guix-ui-package.el".
  (guix-get-show-generations, guix-generations, guix-last-generations)
  (guix-generations-by-time): Move to "guix-ui-generation.el".
* emacs.am (ELFILES): Remove "guix.el".  Add "guix-ui-package.el" and
  "guix-ui-generation.el".
* doc/emacs.texi (Emacs Appearance): Adjust accordingly.
2016-01-02 17:25:35 +03:00
Alex Kost
b1990426fd emacs: Reorganize 'readers' code.
* emacs/guix-base.el (guix-graph-type-names, guix-refresh-updater-names)
  (guix-lint-checker-names, guix-package-names): Move to...
* emacs/guix-read.el: ... here.
  (guix-read-file-name, guix-define-reader, guix-define-readers): Move to...
* emacs/guix-utils.el: ... here.
2016-01-02 17:25:35 +03:00
Alex Kost
6c40b7b703 emacs: Generalize buffer interface.
Extract the code for defining buffer interface from "guix-base.el",
generalize it and move to "guix-buffer.el".

* emacs.am (ELFILES): Add "emacs/guix-buffer.el".
* emacs/guix-base.el (guix-profile, guix-entries, guix-buffer-type)
  (guix-entry-type, guix-search-type, guix-search-vals, guix-set-vars)
  (guix-get-symbol, guix-show-entries, guix-get-show-entries)
  (guix-set-buffer, guix-history-call, guix-make-history-item)
  (guix-get-params-for-receiving): Remove.
  (guix-switch-to-buffer): Rename to 'guix-buffer-display' and move to
  "guix-buffer.el".
  (guix-get-entries): Rename to 'guix-ui-get-entries' and move to
  "guix-ui.el".
  (guix-buffer-data, guix-buffer-value, guix-buffer-param-title)
  (guix-buffer-name, guix-buffer-history-size)
  (guix-buffer-revert-confirm?, guix-buffer-map, guix-buffer-revert)
  (guix-buffer-after-redisplay-hook, guix-buffer-redisplay)
  (guix-buffer-redisplay-goto-button): Move to...
* emacs/guix-buffer.el: ... here.  New file.
  (guix-buffer-item): New variable.
  (guix-buffer-with-item, guix-buffer-with-current-item)
  (guix-buffer-define-current-item-accessor)
  (guix-buffer-define-current-item-accessors)
  (guix-buffer-define-current-args-accessor)
  (guix-buffer-define-current-args-accessors): New macros.
  (guix-buffer-get-entries, guix-buffer-mode-enable)
  (guix-buffer-mode-initialize, guix-buffer-insert-entries)
  (guix-buffer-show-entries-default, guix-buffer-show-entries)
  (guix-buffer-message, guix-buffer-history-item, guix-buffer-set)
  (guix-buffer-display-entries-current)
  (guix-buffer-get-display-entries-current)
  (guix-buffer-display-entries, guix-buffer-get-display-entries): New
  procedures.
* emacs/guix-info.el: Adjust for the procedures renaming.
  (guix-info-define-interface): Add ':show-entries-function' keyword.
* emacs/guix-list.el: Likewise.
* emacs/guix-ui.el (guix-ui-define-interface): Generate
  'guix-ENTRY-TYPE-BUFFER-TYPE-get-entries' procedure based on
  'guix-ui-get-entries'.
* emacs/guix.el (guix-get-show-packages, guix-get-show-generations):
  Adjust for the procedures renaming.
2016-01-02 17:25:35 +03:00
Alex Kost
8bff0c796e emacs: Generalize buffer naming.
* emacs/guix-base.el (guix-buffer-name): New procedure.
  (guix-buffer-define-interface): Make ':buffer-name' a required keyword.
  (guix-update-after-operation, guix-buffer-name-function)
  (guix-buffer-name-simple, guix-buffer-name-default, guix-buffer-name)
  (guix-buffer-p, guix-buffers, guix-update-buffer)
  (guix-update-buffers-maybe-after-operation): Adjust, move and rename to...
* emacs/guix-ui.el (guix-ui-update-after-operation)
  (guix-ui-buffer-name-function, guix-ui-buffer-name-simple)
  (guix-ui-buffer-name-default, guix-ui-buffer-name)
  (guix-ui-buffer?, guix-ui-buffers, guix-ui-update-buffer)
  (guix-ui-update-buffers-after-operation): ... this.
  (guix-ui-define-interface): Generate
  'guix-ENTRY-TYPE-BUFFER-TYPE-buffer-name' procedure and pass it as
  ':buffer-name' argument.
  (guix-ui): New custom group.
* emacs/guix-info.el: Specify ':buffer-name' for the defined interfaces.
* emacs/guix-list.el: Likewise.
* doc/emacs.texi (Emacs Appearance): Adjust accordingly.
2016-01-02 17:25:35 +03:00
Alex Kost
87fe9ecae5 emacs: Generalize buffer reverting.
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.
2016-01-02 17:25:35 +03:00
Alex Kost
819518d15a emacs: Generalize buffer redisplaying.
* 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.
2016-01-02 17:25:35 +03:00
Alex Kost
e40b3c33f4 emacs: Split 'guix-root-map' keymap.
* emacs/guix-base.el: (guix-root-map): Split into...
  (guix-buffer-map): ... this and...
* emacs/guix-ui.el (guix-ui-map): ... this.
  (guix-ui-define-interface): Generate
  'guix-ENTRY-TYPE-BUFFER-TYPE-mode-map' keymaps inheriting them from
  'guix-ui-map' and 'guix-BUFFER-TYPE-mode-map'.
* emacs/guix-info.el (guix-info-mode-map): Use 'guix-buffer-map'.
* emacs/guix-list.el (guix-list-mode-map): Likewise.
* doc/emacs.texi (Emacs Keymaps): Document new keymaps.
2016-01-02 17:25:35 +03:00
Alex Kost
c8e2666a8a emacs: Add wrappers for 'history-size' and 'revert-confirm'.
* 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.
2016-01-02 17:25:35 +03:00
Alex Kost
574f6727b0 emacs: Split 'guix-param-titles' variable.
Generate 'guix-ENTRY-TYPE-BUFFER-TYPE-titles' variables for each
ENTRY-TYPE and BUFFER-TYPE instead.

* emacs/guix-base.el (guix-param-titles): Remove.
  (guix-buffer-data): New variable.
  (guix-buffer-value, guix-buffer-param-title): New procedures.
  (guix-buffer-define-interface): Add ':titles' keyword.
* emacs/guix-info.el (guix-info-param-title): Adjust accordingly.
* emacs/guix-list.el (guix-list-param-title): Likewise.
  (guix-list-column-titles): Remove.
* doc/emacs.texi (Emacs Appearance): Adjust accordingly.
2016-01-02 17:25:35 +03:00
Alex Kost
9193fb7c1d emacs: info: Split 'guix-info-format' variable.
* emacs/guix-info.el: Generate 'guix-ENTRY-TYPE-info-format' variables
  for 'package', 'installed-output', 'output' and 'generation' entry
  types.
  (guix-info-format): Remove.
  (guix-info-data): New variable.
  (guix-info-value): New procedure.
  (guix-info-define-interface): Add ':format' keyword.
* emacs/guix-base.el (guix-buffer-define-interface): Add ':reduced?'
  keyword.
* doc/emacs.texi (Emacs Appearance): Adjust accordingly.
2016-01-02 17:25:35 +03:00
Alex Kost
7735c503b5 emacs: Factorize macros for defining interfaces.
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"
2016-01-02 17:25:35 +03:00
Alex Kost
4ba476f949 emacs: Add 'guix-keyword-args-let'.
* 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.
2016-01-02 17:25:35 +03:00
Alex Kost
0b9cd3206a emacs: Rename internal procedures.
* emacs/guix-list.el (guix-list-get-param-title): Rename to...
  (guix-list-param-title): ... this.
  (guix-list-get-column-format): Rename to...
  (guix-list-format): ... this.
  (guix-list-get-displayed-params): Rename to...
  (guix-list-displayed-params): ... this.
  (guix-list-get-sort-key): Rename to...
  (guix-list-tabulated-sort-key): ... this.
  (guix-list-make-tabulated-vector): Rename to...
  (guix-list-tabulated-vector): ... this.
  (guix-list-get-list-format): Rename to...
  (guix-list-tabulated-format): ... this.
  (guix-list-get-tabulated-entries): Rename to...
  (guix-list-tabulated-entries): ... this.
  (guix-list-get-tabulated-entry): Rename to...
  (guix-list-tabulated-entry): ... this.
* emacs/guix-info.el (guix-info-get-displayed-params): Rename to...
  (guix-info-displayed-params): ... this.
* emacs/guix-base.el (guix-get-params-for-receiving): Adjust
  accordingly.
  (guix-get-name-spec): Rename to...
  (guix-package-name-specification): ... this.
  (guix-get-full-name): Merge this and...
  (guix-entry-to-specification): ... this into...
  (guix-package-entry->name-specification): ... this.
  (guix-get-installed-outputs): Rename to...
  (guix-package-installed-outputs): ... this.
  (guix-get-package-id-and-output-by-output-id): Rename to...
  (guix-package-id-and-output-by-output-id): ... this.
2016-01-02 17:25:35 +03:00
Alex Kost
ceea647c72 emacs: Simplify defining parameter titles.
* 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'.
2016-01-02 17:25:35 +03:00
Alex Kost
73ce3c19c4 emacs: Add API for 'guix-entry'.
* emacs/guix-info.el: Use new entry procedures.
* emacs/guix-list.el: Likewise.
* emacs/guix-base.el: Likewise.
  (guix-get-entry-by-id): Move and rename to ...
* emacs/guix-entry.el (guix-entry-by-id): ...this.  New file.
  (guix-entry-value, guix-entry-id, guix-entries-by-ids)
  (guix-replace-entry): New procedures.
* emacs.am (ELFILES): Add new file.
2016-01-02 17:25:35 +03:00
Alex Kost
c67e344f21 emacs: Fix 'guix-pull'.
* 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.
2015-12-06 12:46:10 +03:00
Alex Kost
957b73382b emacs: Fix 'guix-apply-manifest'.
* 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.
2015-12-06 12:46:10 +03:00
Alex Kost
6407ce8ea1 emacs: Add completions for '--type' option of 'refresh' popup.
* guix/scripts/refresh.scm: Export '%updaters'.
* emacs/guix-main.scm (refresh-updater-names): New procedure.
* emacs/guix-base.el (guix-refresh-updater-names): New function.
* emacs/guix-read.el (guix-read-refresh-updater-names,
  guix-read-refresh-updater-names-string): New functions.
* emacs/guix-command.el (guix-command-improve-refresh-argument): Use
  'guix-read-refresh-updater-names-string'.
2015-11-02 15:51:40 +03:00
Alex Kost
cfd56de3d8 emacs: Use 'switch-to-generation*'.
This is a followup to commit 06d45f4566.

* emacs/guix-base.el (guix-switch-to-generation): Replace
  'switch-to-generation' with 'switch-to-generation*'.
2015-10-27 21:54:57 +03:00
Alex Kost
c74cd6cc12 emacs: Move guile related code to "guix-guile.el".
* 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.
2015-09-22 22:05:09 +03:00
Alex Kost
ea369ee1b0 emacs: Display guix command errors in the minibuffer.
* 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.
2015-09-15 15:19:31 +03:00
Alex Kost
46e17df661 emacs: Add customization groups for faces.
* 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.
2015-09-15 15:19:30 +03:00
Alex Kost
eb097f36b1 emacs: Use prompt for packages instead popup for edit action.
* 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.
2015-08-30 18:26:03 +03:00
Alex Kost
7008dffff5 emacs: Add code to run guix command in shell.
* emacs/guix-base.el (guix-run-in-shell, guix-run-in-eshell,
  guix-run-command-in-shell): New functions.
  (guix-run-in-shell-function, guix-shell-buffer-name): New variables.
2015-08-30 18:26:02 +03:00
Alex Kost
5e53b0c5a9 emacs: Add code to run guix command in REPL.
* emacs/guix-base.el (guix-run-command-in-repl, guix-command-output,
  guix-help-string): New functions.
* emacs/guix-main.scm (guix-command, guix-command-output, help-string):
  New procedures.
2015-08-30 18:26:02 +03:00
Alex Kost
51dac38339 emacs: Add and use alist accessors.
* emacs/guix-utils.el (guix-define-alist-accessor): New macro.
  (guix-assq-value, guix-assoc-value): New functions.
  (guix-get-key-val): Remove.
* emacs/guix-base.el: Replace 'guix-get-key-val' with 'guix-assq-value'
  everywhere.
* emacs/guix-info.el: Likewise.
* emacs/guix-list.el: Likewise.
* emacs/guix-messages.el: Likewise.
2015-08-30 18:26:02 +03:00
Alex Kost
25a2839c9d emacs: Add 'guix-package-names'.
* emacs/guix-main.scm (package-names, package-names-lists): New procedures.
* emacs/guix-base.el (guix-package-names): New function.
2015-08-30 18:26:02 +03:00
Alex Kost
43b40c4b15 emacs: Add 'guix-graph-type-names'.
* emacs/guix-main.scm: Use (guix scripts graph) module.
  (graph-type-names): New procedure.
* emacs/guix-base.el (guix-graph-type-names): New function.
2015-08-30 18:26:02 +03:00
Alex Kost
056b5ceffc emacs: Add 'guix-lint-checker-names'.
* emacs/guix-main.scm: Use (guix scripts lint) module.
  (lint-checker-names): New procedure.
* emacs/guix-base.el (guix-lint-checker-names): New function.
2015-08-30 18:26:02 +03:00
Alex Kost
1ce96dd927 emacs: Add and use 'guix-concat-strings'.
* 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.
2015-08-30 18:26:01 +03:00
Alex Kost
cc77415053 emacs: Remove leftover internal variable.
This is a followup to commit 74cc67372e.

* emacs/guix-base.el (guix-define-buffer-type): Remove 'mode-map'
  variable.
2015-08-30 18:26:01 +03:00
Alex Kost
74cc67372e emacs: Add 'guix-root-map'.
* 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.
2015-06-26 16:15:45 +03:00
Alex Kost
6248e32635 emacs: Add "edit" command to a list of packages.
* emacs/guix-base.el (guix-edit-package): New function.
* emacs/guix-list.el (guix-list-edit-package): New command.  Bind it to
  "e" key.
* emacs/guix-main.scm (package-location-string): New procedure.
* doc/emacs.texi (Emacs List buffer): Document "e" key binding.
* doc/guix.texi (Invoking guix edit): Mention "package list" buffer.
2015-06-22 22:19:19 +03:00
Alex Kost
5a727cdfa9 emacs: Add 'guix-apply-manifest'.
* emacs/guix-base.el (guix-apply-manifest): New command.
  Bind it to "M" key.
* doc/emacs.texi (Emacs General info): Document it.
2015-05-29 20:54:54 +03:00
Alex Kost
3db349cb09 emacs: Move profiles code to "guix-profiles.el.in".
* emacs/guix-base.el (guix-user-profile, guix-default-profile,
  guix-current-profile, guix-profile-prompt, guix-set-current-profile): Move
  to...
* emacs/guix-init.el.in (guix-default-profile): Move to...
* emacs/guix-profiles.el.in: ... here.  New file.
* configure.ac (AC_CONFIG_FILES): Add "emacs/guix-profiles.el".
* emacs.am (nodist_lisp_DATA): Likewise.
2014-12-02 22:09:22 +03:00
Alex Kost
0b0fbf0c16 emacs: Add "Source" field to 'guix-info' buffers.
Suggested by Ludovic Courtès.

* emacs/guix-info.el (guix-info-insert-methods, guix-info-displayed-params):
  Add 'source' parameter.
  (guix-package-info-source): New face.
  (guix-package-source): New button type.
  (guix-package-info-auto-find-source, guix-package-info-auto-download-source,
  guix-package-info-download-buffer): New variables.
  (guix-package-info-show-source, guix-package-info-insert-source-url,
  guix-package-info-insert-source, guix-package-info-download-source,
  guix-package-info-redisplay-after-download): New procedures.
* emacs/guix-base.el (guix-param-titles): Add 'source' parameter.
  (guix-operation-prompt): Add 'prompt' argument.
  (guix-after-source-download-hook): New variable.
  (guix-package-source-path, guix-package-source-build-derivation): New
  procedures.
* emacs/guix-main.scm (%package-param-alist): Add 'source' parameter.
  (package-source-names, package-source-derivation->store-path,
  package-source-path, package-source-build-derivation): New procedures.
2014-11-12 22:10:32 +03:00
Alex Kost
37c4ffc2c4 emacs: Improve 'guix-redisplay-buffer'.
* emacs/guix-base.el (guix-redisplay-buffer): Allow to display new entries.
  Restore point position.
2014-11-10 16:13:41 +03:00
Alex Kost
7be25d4af0 emacs: Restore mode-line after operation prompt.
* emacs/guix-base.el (guix-operation-prompt): Restore 'mode-line-format' after
  prompting.
2014-11-10 16:13:40 +03:00
Alex Kost
d38bd08c74 emacs: Add interface for comparing generations.
Suggested by Ludovic Courtès.

* doc/emacs.texi (Emacs List buffer): Document new key bindings.
* emacs/guix-base.el (guix-generation-packages-buffer-name-function,
  guix-generation-packages-update-buffer, guix-output-name-width): New
  variables.
  (guix-generation-file, guix-manifest-file, guix-generation-packages,
  guix-generation-packages-buffer-name-default,
  guix-generation-packages-buffer-name-long,
  guix-generation-packages-buffer-name, guix-generation-packages-buffer,
  guix-generation-insert-package, guix-generation-insert-packages,
  guix-profile-generation-manifest-file,
  guix-profile-generation-packages-buffer): New procedures.
* emacs/guix-list.el: Add key bindings for comparing generations.
  (guix-generation-list-generations-to-compare,
  guix-generation-list-show-added-packages,
  guix-generation-list-show-removed-packages, guix-generation-list-compare,
  guix-generation-list-ediff-manifests, guix-generation-list-diff-manifests,
  guix-generation-list-ediff-packages, guix-generation-list-diff-packages,
  guix-generation-list-ediff, guix-generation-list-diff): New procedures.
* emacs/guix-messages.el (guix-messages): Add 'generation-diff' search type.
  (guix-message-outputs-by-diff): New procedure.
* emacs/guix-utils.el (guix-diff-switches): New variable.
  (guix-diff): New procedure.
* emacs/guix-main.scm (package/output-sexps): Handle 'generation-diff' search
  type.
  (manifest-entry->package-specification,
  manifest-entries->package-specifications, generation-package-specifications,
  generation-package-specifications+paths, generation-difference): New
  procedures.
2014-11-04 15:51:22 +03:00
Alex Kost
62f261d88c emacs: Improve minibuffer messages.
* emacs/guix-base.el (guix-messages, guix-result-message): Move to
  'guix-messages.el'.
  (guix-set-buffer, guix-history-call, guix-redisplay-buffer): Adjust for
  the modified 'guix-result-message'.
* emacs/guix-messages.el: New file.
  (guix-redisplay-buffer): Add 'profile' argument.
  (guix-message-string-name, guix-message-string-entry-type,
  guix-message-string-entries, guix-message-packages-by-name,
  guix-message-generations-by-time): New procedures.
2014-11-04 15:51:21 +03:00
Alex Kost
2d7bf94927 emacs: Add 'guix-pull' command.
* emacs/guix-base.el (guix-pull): New command.
  (guix-update-after-pull, guix-after-pull-hook): New variables.
  (guix-restart-repl-after-pull, guix-update-buffers-maybe-after-pull): New
  procedures.
* emacs/guix-main.scm: Use (guix scripts pull) module.
* doc/emacs.texi (Emacs Commands): Document 'guix-pull' command.
2014-10-27 21:52:56 +03:00
Alex Kost
f209da9f94 emacs: Improve buffer procedures.
* 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'.
2014-10-27 21:52:56 +03:00
Alex Kost
d2b299a91f emacs: Handle updating by ID after REPL restart.
* 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.
2014-10-27 21:52:55 +03:00
Alex Kost
23459fa59b emacs: Improve interface for working with multiple profiles.
Suggested by David Thompson, Ludovic Courtès and Mathieu Lirzin.

* emacs/guix-base.el (guix-profile-prompt): New procedure.
  (guix-set-current-profile): Use it.
  (guix-buffer-name-simple, guix-buffer-name-default, guix-buffer-name): New
  procedures.
  (guix-buffer-name-function, guix-profile): New variables.
  (guix-set-vars, guix-get-entries, guix-get-show-entries, guix-set-buffer,
  guix-history-call, guix-process-package-actions,
  guix-continue-package-operation-p, guix-delete-generations,
  guix-switch-to-generation): Add 'profile' argument.
* emacs/guix.el (guix-get-show-packages, guix-get-show-generations,
  guix-search-by-name, guix-search-by-regexp, guix-installed-packages,
  guix-obsolete-packages, guix-all-available-packages,
  guix-newest-available-packages, guix-generations, guix-generations-by-time):
  Likewise.
  (guix-last-generations): New command.
* emacs/guix-info.el: Adjust for using 'profile' argument where needed.
* emacs/guix-list.el: Likewise.
* doc/emacs.texi (Emacs Commands): Document 'guix-last-generations' and using
  "C-u" for commands.
  (Emacs Buffer Names): Document 'guix-buffer-name-function'.
2014-10-18 10:24:13 +04:00
Alex Kost
189cea2782 emacs: Add 'guix-generations-by-time' command.
* emacs/guix-main.scm (find-generations): Add finding generations by time.
* emacs/guix-utils.el (guix-read-date): New procedure.
* emacs/guix-base.el (guix-messages): Add new messages.
* emacs/guix.el (guix-generations-by-time): New command.
* doc/emacs.texi (emacs Commands): Document it.
2014-10-17 10:56:27 +04:00