Commit graph

247 commits

Author SHA1 Message Date
Alex Kost
6dd460c856 emacs: list: Support displaying URL links.
* emacs/guix-list.el (guix-list-url): New face.
  (guix-list-get-url): New procedure.
2016-01-25 22:11:47 +03:00
Alex Kost
83aab70b2d emacs: Add 'guix-packages-by-license' command.
* 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.
2016-01-25 22:11:47 +03:00
Alex Kost
cefb7aea9d emacs: Buttonize licenses in "Package Info".
* 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.
2016-01-25 22:11:47 +03:00
Alex Kost
71310ccc56 emacs: Add 'guix-browse-license-url' command.
* 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.
2016-01-25 22:11:47 +03:00
Alex Kost
0a2a2b3387 emacs: Rename 'file-path' to 'file-name'.
* emacs/guix-info.el (guix-info-file-path): Rename to...
  (guix-info-file-name): ... this.
* emacs/guix-list.el (guix-list-file-path): Rename to...
  (guix-list-file-name): ... this.
  (guix-list-get-file-path): Rename to...
  (guix-list-get-file-name): ... this.
* emacs/guix-ui-generation.el (guix-generation-list-format): Adjust
  accordingly.
* emacs/guix-ui-system-generation.el (guix-system-generation-list-format):
  Likewise.
* NEWS: Mention faces renaming.
2016-01-25 22:11:47 +03:00
Alex Kost
27a2e48337 emacs: Add 'guix-search-by-name'.
* emacs/guix-ui-package.el (guix-search-by-name): New command.
* doc/emacs.texi (Emacs Commands): Document it.
2016-01-18 19:11:46 +03:00
Alex Kost
e119ba9008 emacs: Rename 'guix-search-by-name' to 'guix-packages-by-name'.
* emacs/guix-ui-package.el (guix-search-by-name): Rename to...
  (guix-packages-by-name): ... this.  Complete package name.
* doc/emacs.texi (Emacs Commands): Likewise.
2016-01-18 19:11:46 +03:00
Alex Kost
67cedc4ba6 emacs: Add interface for system generations.
* 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.
2016-01-16 13:02:21 +03:00
Alex Kost
5672866848 emacs: Remove 'generation' search type.
Use 'installed' search type instead.

* emacs/guix-main.scm (%patterns-makers): Remove 'generation'.
  (package/output-sexps): Adjust accordingly.
* emacs/guix-ui-generation.el (guix-generation-info-insert-number):
  Replace 'generation' search with 'installed'.
  (guix-generation-list-show-packages): Likewise.
* emacs/guix-messages.el (guix-messages): Remove 'generation'.
2016-01-16 13:02:21 +03:00
Alex Kost
54c3c284d7 emacs: Replace 'generation-diff' search with 'profile-diff'.
* 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.
2016-01-16 13:02:21 +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
a0ad8ab01e emacs: profiles: Add 'guix-system-profile'.
* emacs/guix-profiles.el (guix-system-profile): New variable.
2016-01-16 13:02:21 +03:00
Alex Kost
6b3a1ce8d7 emacs: Fix heading face in "Package Info".
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.
2016-01-14 01:12:24 +03:00
Alex Kost
6d268e5281 emacs: Move loading packages to "guix-emacs.el".
* emacs/guix-init.el: Move the code for auto-loading Emacs packages to...
  (guix-package-enable-at-startup): Move to...
* emacs/guix-emacs.el (guix-package-enable-at-startup): ... here.
2016-01-13 17:56:14 +03:00
Alex Kost
e4e2154644 emacs: Make "guix-emacs.el" independent.
"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.
2016-01-13 17:56:14 +03:00
Alex Kost
08207339aa emacs: Complete --file in 'guix build' popup.
* emacs/guix-command.el (guix-command-improve-build-argument): Use
  'guix-read-file-name' to complete --file option.
2016-01-13 17:55:47 +03:00
Alex Kost
883fc5ed42 emacs: Add missing shell completions.
* 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.
2016-01-13 17:55:47 +03:00
Alex Kost
0a5ec7092d emacs: Display supported systems in "Package Info".
* emacs/guix-main.scm (%package-param-alist): Add 'systems'.
* emacs/guix-ui-package.el (guix-package-info-insert-systems): New
  procedure.
  (guix-package-info-format): Add it.
  (guix-output-info-format): Likewise.
  (guix-package-info-titles): Add "Supported systems" title.
2016-01-07 22:30:18 +03:00
Alex Kost
5c8994d9d9 emacs: Use "B" key in "Package List" to display latest builds.
* 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.
2016-01-02 17:25:35 +03:00
Alex Kost
32950fc846 emacs: Add Hydra interface.
* emacs/guix-utils.el (guix-hexify, guix-number->bool): New procedures.
  (guix-while-null): New macro.
* emacs/guix-hydra.el: New file.
* emacs/guix-hydra-build.el: New file.
* emacs/guix-hydra-jobset.el: New file.
* emacs.am (ELFILES): Add them.
* doc/emacs.texi (Emacs Hydra): New node.
  (Emacs Interface): Add it.
* doc/guix.texi (Top): Add it.
  (Substitutes): Mention Emacs interface.
2016-01-02 17:25:35 +03:00
Alex Kost
494a62f215 emacs: Add 'guix-ui-read-profile'.
* 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.
2016-01-02 17:25:35 +03:00
Alex Kost
8ed2c92eb1 emacs: Add hierarchy of customization groups.
* 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.
2016-01-02 17:25:35 +03:00
Alex Kost
dc690c445e emacs: Return nil instead of "" in completing readers.
* emacs/guix-utils.el (guix-completing-read): New procedure.
  (guix-define-readers): Use it.
2016-01-02 17:25:35 +03:00
Alex Kost
ddf6948b22 emacs: Add 'guix-list-get-display-entries'.
* emacs/guix-list.el (guix-list-get-display-entries): New procedure.
* emacs/guix-ui-generation.el (guix-generation-get-display): Use it.
2016-01-02 17:25:35 +03:00
Alex Kost
e29d192484 emacs: Add 'list-single' variables.
* emacs/guix-list.el (guix-list-single-entry?): New procedure.
  (guix-list-define-interface): Add ':list-single?' key and generate
  'guix-ENTRY-TYPE-list-single' variables.
* emacs/guix-ui-package.el (guix-package-list-single): Remove.
2016-01-02 17:25:35 +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
8103c22fea emacs: info: Get rid of syntactic fontification.
* emacs/guix-info.el (guix-info-mode-initialize): New procedure.  Set
  'font-lock-defaults' to avoid syntactic fontification.
  (guix-info-define-interface): Use it.
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
7171d824d7 emacs: info: Buttonize package name heading.
* emacs/guix-info.el (guix-package-info-insert-heading): Insert
  buttonized name specification.
2016-01-02 17:25:35 +03:00
Alex Kost
fc7a28897c emacs: Improve messages for packages found by ID.
* emacs/guix-messages.el (guix-message-packages-by-id): New procedure.
  (guix-messages): Use it.
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
2c7ed388cf emacs: info: Generalize inserting and formatting.
* emacs/guix-info.el: Use a more flexible format for inserting any data.
  (guix-info-ignore-empty-vals): Rename to...
  (guix-info-ignore-empty-values): ... this.
  (guix-info-insert-methods): Merge this and...
  (guix-info-displayed-params): ... this into...
  (guix-info-format): ... this.  Change format specifications.
  (guix-info-title-aliases, guix-info-value-aliases): New variables.
  (guix-info-displayed-params): Adjust for the new format.
  (guix-info-insert-entry): Likewise.
  (guix-package-info-fill-heading): Replace with...
  (guix-info-fill): ... this.
  (guix-info-insert-param): Replace with...
  (guix-info-insert-entry-unit): ... this.
  (guix-info-insert-title-default): Replace with...
  (guix-info-insert-title-format): ... this.
  (guix-info-insert-val-default): Replace with...
  (guix-info-insert-value-format): ... this.
  (guix-info-insert-val-simple): Replace with...
  (guix-info-insert-value-indent): ... this.
  (guix-package-info-insert-source): Adjust accordingly.
  (guix-package-info-insert-heading): Insert only name and version.
  (guix-package-info-define-insert-inputs): Do not generate
  'guix-package-info-insert-ENTRY-TYPE-inputs' procedures.
  (guix-info-fill-column, guix-info-insert-entry-default)
  (guix-info-method-funcall, guix-info-insert-file-path)
  (guix-info-insert-url, guix-info-insert-package-function)
  (guix-info-insert-installed-function)
  (guix-info-insert-output-function)
  (guix-info-insert-generation-function)
  (guix-package-info-heading-params)
  (guix-package-info-insert-with-heading)
  (guix-package-info-insert-description)
  (guix-package-info-insert-location)
  (guix-package-info-insert-full-names)
  (guix-package-info-insert-source-url): Remove.
  (guix-info-fill-column, guix-info-param-title)
  (guix-info-title-function, guix-info-value-function)
  (guix-info-title-method->function)
  (guix-info-value-method->function)
  (guix-info-insert-value-simple): New procedures.
* emacs/guix-utils.el (guix-buttonize, guix-button-type?): New
  procedures.
  (guix-split-string): Split multi-line strings and ignore empty lines.
* doc/emacs.texi (Emacs Appearance): Adjust accordingly.
2016-01-02 17:25:35 +03:00
Alex Kost
25d2fe8bef emacs: list: Factorize "edit package" commands.
* 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.
2016-01-02 17:25:35 +03:00
Alex Kost
cf910ceffc emacs: list: Split 'guix-list-format' variable.
* emacs/guix-list.el: Generate 'guix-ENTRY-TYPE-list-format' variables
  for 'package', 'output' and 'generation' entry types.
  (guix-list-format): Remove.
  (guix-list-define-entry-type): Add ':format' keyword.
* doc/emacs.texi (Emacs Appearance): Adjust accordingly.
2016-01-02 17:25:35 +03:00
Alex Kost
78fdbdc033 emacs: list: Add 'guix-list-mode-initialize'.
* emacs/guix-list.el (guix-list-mode-initialize): New procedure.
  (guix-list-define-entry-type): Use it.
2016-01-02 17:25:35 +03:00
Alex Kost
649df66705 emacs: list: Generalize 'sort-key' code.
* 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.
2016-01-02 17:25:35 +03:00
Alex Kost
7b31510f26 emacs: list: Generalize 'describe' code.
* emacs/guix-list.el (guix-list-describe-warning-count): Remove variable.
  (guix-list-define-entry-type): Generate
  'guix-ENTRY-TYPE-list-describe-warning-count' and
  'guix-ENTRY-TYPE-list-describe-function' variables.
  (guix-list-describe-maybe): Remove.  Move the code...
  (guix-list-describe): ... here.
  (guix-list-describe-warning-count, guix-list-describe-entries)
  (guix-list-describe-ids): New procedures.
  (guix-output-list-describe): Adjust accordingly.
  (guix-list-mode-map): Bind "i" key to 'guix-list-describe'.
  (guix-generation-list-mode-map): Remove "i" key.
2016-01-02 17:25:35 +03:00
Alex Kost
f768e4b387 emacs: list: Generalize 'marks' code.
* emacs/guix-list.el (guix-list-mark-alist): Rename to...
  (guix-list-marks): ... this
  (guix-list-data, guix-list-default-marks): New variables.
  (guix-list-value, guix-list-additional-marks, guix-list-marks): New
  procedures.
  (guix-list-define-entry-type): Adjust accordingly.
2016-01-02 17:25:35 +03:00
Alex Kost
d9c9f9a515 emacs: Add 'guix-alist-put'.
* emacs/guix-utils.el (guix-alist-put, guix-alist-put-1)
  (guix-alist-put!): New procedures.
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
376af769f9 emacs: list: Configure format in one place.
* emacs/guix-list.el: (guix-list-column-format): Merge this and...
  (guix-list-column-value-methods): ... this into...
  (guix-list-format): ... this.  New variable.
  (guix-list-tabulated-vector): Adjust accordingly.
  (guix-list-tabulated-format): Likewise.
  (guix-list-tabulated-entry): Likewise.
* doc/emacs.texi (Emacs Appearance): Likewise.
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
e86a43d471 emacs: list: Generate numerical sort predicates.
* 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.
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
36c00c61fa emacs: Add 'guix-with-indent'.
* 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.
2016-01-02 17:25:35 +03:00
Alex Kost
778437ed9f emacs: Use "cl-list*" instead of "apply #'list".
* emacs/guix-command.el (guix-run-view-build-log): Use cl-list*.
  (guix-run-view-size-map): Likewise.
* emacs/guix-external.el (guix-dot-arguments): Likewise.
2016-01-02 17:25:35 +03:00
Alex Kost
1ccdc7f0be emacs: Use socket instead of port.
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.
2015-12-15 21:35:35 +03:00
Alex Kost
7ccb3ad3c1 emacs: 'node-type' is in (guix graph) now.
This is a followup to commit 8fb583714f.

* emacs/guix-main.scm (graph-type-names): Use 'node-type-name'
  from (guix graph) module.
2015-12-15 21:35:35 +03:00
Alex Kost
98f4a9004b emacs: Handle compiled autoloads.
* emacs/guix-emacs.el (guix-emacs-autoloads-regexp): New variable.
  (guix-emacs-find-autoloads-in-directory): Return a list of autoloads
  without extensions.
2015-12-11 14:34:03 +03:00
Alex Kost
1ae15c3646 emacs: Fix '--rounds' option in command popups.
* 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).
2015-12-09 19:55:04 +03:00
Alex Kost
dcb00c0ad5 emacs: Add 'guix-build-log-find-file'.
* emacs/guix-build-log.el (guix-build-log-find-file): New procedure.
* emacs/guix-command.el (guix-run-view-build-log): Use it.
2015-12-09 19:54:19 +03:00
Alex Kost
d7a58c60d6 emacs: list: Fontify time stamps.
* emacs/guix-list.el (guix-list-time): New face.
  (guix-list-get-time): Use it.
2015-12-09 19:54:19 +03:00
Alex Kost
d84018b5b1 emacs: info: Add 'guix-info-heading' face.
* emacs/guix-info.el (guix-info-heading): New face.
  (guix-package-info-heading): Inherit it.
2015-12-09 19:54:19 +03:00
Alex Kost
f5688801b2 emacs: info: Show a message after copying button label.
* emacs/guix-info.el (guix-info-button-copy-label): Use
  'guix-copy-as-kill' to display a message with what was killed.
2015-12-06 12:46:10 +03:00
Alex Kost
9ff175655c emacs: Complete --profile in 'guix package' popup.
* emacs/guix-command.el (guix-command-improve-package-argument): Use
  'guix-read-file-name' to complete --profile option.
2015-12-06 12:46:10 +03:00
Alex Kost
a65f007524 emacs: 'guix-emacs-load-autoloads' takes a profile.
* 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.
2015-12-06 12:46:10 +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
59dc56390d emacs: Expand 'guix-load-path'.
Reported by Mathieu Lirzin <mthl@gnu.org> at
<http://lists.gnu.org/archive/html/guix-devel/2015-11/msg00585.html>.

* emacs/guix-backend.el (guix-start-repl): Expand 'guix-load-path' to
  avoid a potentially relative directory name in Guile %load-path.
2015-11-23 11:33:55 +03:00
Ludovic Courtès
f106b0e970 emacs: 'display-search-paths' now takes a list of profiles.
Fixes a regression introduced in fc2d233.

* emacs/guix-main.scm (process-package-actions): Make second argument to
  'display-search-paths' a list.
2015-11-16 10:54:23 +01:00
Alex Kost
8b341eb05d emacs: Adjust 'guix environment' popup.
* 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.
2015-11-12 21:22:35 +03:00
Alex Kost
cfa548b4ea emacs: Adjust 'guix container' popup.
* 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.
2015-11-12 21:22:35 +03:00
Alex Kost
959c78f69a emacs: Improve post processing of popup arguments.
* emacs/guix-command.el (guix-command-switches,
  guix-command-rest-arg-regexp): New variables.
  (guix-command-post-processors,
  guix-command-post-process-matching-args,
  guix-command-post-process-rest-single,
  guix-command-post-process-rest-multiple,
  guix-command-post-process-rest-multiple-leave,
  guix-command-post-process-package-args): New functions.
  (guix-command-post-process-rest-multiple): Take 2 arguments.
  (guix-command-define-popup-action): Adjust accordingly.
* emacs/guix-utils.el (guix-modify): New function.
2015-11-12 21:22:35 +03:00
Alex Kost
f4044b586d emacs: Enable 'guix-build-log-minor-mode' in shell buffers.
* 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.
2015-11-02 15:52:52 +03:00
Alex Kost
0048552d0d emacs: Enable 'guix-build-log-mode' for build log files.
* emacs/guix-build-log.el (auto-mode-alist): Add 'guix-build-log-mode'
  to 'auto-mode-alist'.
2015-11-02 15:52:52 +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
c42e6c6c2f emacs: Disable minor modes in 'guix-build-log-mode'.
* 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.
2015-10-31 23:22:41 +03:00
Alex Kost
20ce2fee33 emacs: Add key bindings for 'guix-build-log-minor-mode'.
* 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.
2015-10-31 23:22:40 +03:00
Alex Kost
b0e44d4f7d emacs: Add shell completions for 'guix refresh --type'.
* emacs/guix-pcomplete.el (guix-pcomplete-refresh-updaters): New function.
  (guix-pcomplete-complete-option-arg): Complete '-t/--type' option for
  'guix refresh' command.
2015-10-31 23:21:23 +03:00
Ludovic Courtès
cd6f6c22fb services: Add 'modify-services'.
* 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.
2015-10-28 21:58:25 +01: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
e1d3318634 emacs: Add "Packages" option for 'guix challenge' popup.
* emacs/guix-command.el (guix-command-rest-argument): Add "challenge".
2015-10-27 21:54:57 +03:00
Alex Kost
402d73bc75 emacs: Add shell completions for 'guix challenge'.
* emacs/guix-pcomplete.el (guix-pcomplete-complete-command-arg): Add
  "challenge" to complete package names for it.
2015-10-27 21:54:57 +03:00
Alex Kost
4ab70c5ca0 emacs: devel: Add indentation rules for 'modify-phases' keywords.
* emacs/guix-devel.el: Add indentation rules for 'modify-phases' keywords.
  (guix-devel-indent-modify-phases-keyword,
  guix-devel-indent-modify-phases-keyword-1,
  guix-devel-indent-modify-phases-keyword-2): New functions.
2015-10-20 16:47:21 +03:00
Alex Kost
380566157d emacs: config: Use "emacs-config-" prefix for constants.
* 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'.
2015-10-20 16:47:05 +03:00
Alex Kost
51805219a5 build: Set DOT_USER_PROGRAM for Emacs interface.
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.
2015-10-20 16:47:05 +03:00
Alex Kost
5d86684ddf emacs: devel: Highlight Guix keywords.
* emacs/guix-devel.el (guix-devel-keywords): New constant.
  (guix-devel-font-lock-keywords): Use it.
2015-10-17 18:57:30 +03:00
Alex Kost
7c0b02f5ae emacs: Improve file names of generated graphs.
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.
2015-10-17 18:56:50 +03:00
Alex Kost
727495757f emacs: Add "View graph" actions to system graph commands.
* emacs/guix-command.el (guix-command-additional-execute-arguments,
  guix-command-special-executors): Add "View graph" actions for
  'dmd-graph' and 'extension-graph' commands.
2015-10-16 17:24:13 +03:00
Alex Kost
e0c5309a83 emacs: Disambiguate "d" key in 'system' popup.
* emacs/guix-command.el (guix-command-improve-system-argument): Use "D"
  key for 'disk-image' action (leave "d" for 'dmd-graph').
2015-10-16 17:14:57 +03:00
Alex Kost
b1b53df382 emacs: init: Add "share/emacs/site-lisp" to 'load-path'.
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.
2015-10-16 17:14:57 +03:00
Alex Kost
17fa842b79 emacs: devel: Add indentation rules.
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.
2015-10-14 19:20:28 +03:00
Alex Kost
ad8b83bda0 emacs: Add 'guix-devel-build-package-source'.
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.
2015-10-12 10:59:31 +03:00
Alex Kost
b94ef11a53 emacs: Add 'guix-devel-lint-package'
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.
2015-10-09 16:17:45 +03:00
Alex Kost
5952111cc0 emacs: Add 'guix-devel-with-definition'.
* 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.
2015-10-09 16:17:45 +03:00
Alex Kost
5a60d56975 emacs: Fix 'guix-devel-setup-repl'.
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.
2015-10-09 16:17:45 +03:00
Alex Kost
7c786db4fb emacs: Fix 'guix-build-log-phase-toggle-all'.
* 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.
2015-10-09 16:17:45 +03:00
Alex Kost
88908d55e0 emacs: devel: Fix 'modify-phases' highlighting.
* emacs/guix-devel.el (guix-devel-modify-phases-font-lock-pre): Handle
  the case when 'modify-phases' is commented.
2015-10-09 16:17:44 +03:00
Alex Kost
1af9815d81 emacs: devel: Highlight gexp symbols.
Suggested by Ludovic Courtès <ludo@gnu.org>.

* emacs/guix-devel.el (guix-devel-gexp-symbol): New face.
  (guix-devel-font-lock-keywords): Adjust to handle gexp symbols.
2015-10-09 16:14:11 +03:00
Alex Kost
730bf80888 emacs: devel: Highlight 'modify-phases' keywords.
* 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.
2015-09-26 22:38:43 +03:00
Alex Kost
665ce1ebe5 emacs: build-log: Improve regexp for the phase end.
* emacs/guix-build-log.el (guix-build-log-phase-end-regexp): Handle
  fractional number of seconds (like "0.8").
2015-09-25 10:45:38 +03:00