Commit graph

247 commits

Author SHA1 Message Date
Alex Kost
a82a201a8d
emacs: Disable grafts when dry-run is enabled.
* emacs/guix-main.scm (process-package-actions): Set grafting according
to 'dry-run?'.
* guix/scripts.scm (build-package): Disable grafts when 'dry-run?' is #t.

Co-authored-by: Ludovic Courtès <ludo@gnu.org>
2016-07-30 18:17:03 +03:00
Ludovic Courtès
0bb9929eaa
gexp: Add 'with-imported-modules' macro.
* guix/gexp.scm (<gexp>)[modules]: New field.
(gexp-modules): New procedure.
(gexp->derivation): Use it and append the result to %MODULES.
Update docstring to mark #:modules as deprecated.
(current-imported-modules, with-imported-modules): New macros.
(gexp): Pass CURRENT-IMPORTED-MODULES as second argument to 'gexp'.
(gexp->script): Use and honor 'gexp-modules'; define '%modules'.
* tests/gexp.scm ("gexp->derivation & with-imported-modules")
("gexp->derivation & nested with-imported-modules")
("gexp-modules & ungexp", "gexp-modules & ungexp-splicing"):
New tests.
("program-file"): Use 'with-imported-modules'.  Remove #:modules
argument to 'program-file'.
* doc/guix.texi (G-Expressions): Document 'with-imported-modules'.
Mark #:modules of 'gexp->derivation' as deprecated.
* emacs/guix-devel.el: Add syntax for 'with-imported-modules'.
(guix-devel-keywords): Add it.
* .dir-locals.el: Likewise.
2016-07-12 22:47:08 +02:00
Alex Kost
b097dd72c4
emacs: Add "Build Log" button to Package Info.
* emacs/guix-main.scm (package-build-log-file): New procedure.
* emacs/guix-ui-package.el (guix-package-build-log-file)
(guix-package-find-build-log)
(guix-package-info-insert-build-log-button): New procedures.
(guix-package-info-button-functions): Add
'guix-package-info-insert-build-log-button'.
2016-05-31 23:51:54 +03:00
Alex Kost
e98316e69f
emacs: Add "Build" button to Package Info.
* emacs/guix-main.scm: Use (guix scripts) module for 'build-package'
procedure.
* emacs/guix-base.el (guix-build-package): New procedure.
* emacs/guix-ui-package.el (guix-package-info-insert-build-button): New
procedure.
(guix-package-info-button-functions): New variable.
(guix-package-info-insert-misc): Insert buttons using it.
2016-05-31 23:51:54 +03:00
Alex Kost
65e5fe54ba
emacs: Extend 'guix-mapinsert'.
* emacs/guix-utils.el (guix-mapinsert): Add 'indent' and 'column'
keyword arguments.
2016-05-31 23:51:54 +03:00
Alex Kost
d01ebd05d1
emacs: Show built output directories in Package Info.
* emacs/guix-main.scm (package-store-path): New procedure.
* emacs/guix-base.el (guix-package-store-path): New procedure.
* emacs/guix-ui-package.el (guix-package-info-auto-find-package): New
variable.
(guix-package-info-show-store-path, guix-package-info-insert-misc): New
procedures.
(guix-package-info-format, guix-output-info-format): Add
'guix-package-info-insert-misc'.
2016-05-31 23:51:54 +03:00
Mathieu Lirzin
c0d2e7b197
build: Use "%D%" in Makefile fragments.
* doc/local.mk: Use "%D%" for the directory of the fragment relative to
the base 'Makefile.am'.
* emacs/local.mk: Likewise.
* gnu/local.mk: Likewise.
* nix/local.mk: Likewise.
2016-05-24 13:07:19 +02:00
Alex Kost
f8476e17a7 emacs: Add 'guix-package-from-file' command.
* emacs/guix-main.scm (register-package, packages-from-file): New procedures.
(%patterns-makers): Add 'from-file' search type.
* emacs/guix-messages.el (guix-messages): Add messages for it.
* emacs/guix-ui-package.el (guix-package-from-file): New command.
(guix-package-info-insert-location): Adjust for 'from-file' type.
* doc/emacs.texi (Emacs Commands): Document it.
2016-05-10 12:05:53 +03:00
Alex Kost
3be3328927 emacs: main: Remove top-level package tables.
* emacs/guix-main.scm (%package-vhash, package-vhash, %package-table)
(package-table, name+version->key, key->name+version): Remove.
(package-by-address, packages-by-name+version): Adjust by using delayed
local package tables.
2016-05-10 12:05:53 +03:00
Alex Kost
10b0c31d6b emacs: Simplify 'guix-guile-boolean'.
* emacs/guix-guile.el (guix-guile-boolean): Use straightforward way to
  define true/false value.
2016-05-10 12:05:53 +03:00
Alex Kost
e3dba5ac75 emacs: Add 'guix-version' command.
* emacs/guix-config.el.in (guix-config-name, guix-config-version): New
  constants.
* emacs/guix-about.el (guix-version): New command.  New file.
* emacs/local.mk (ELFILES): Add it.
2016-05-09 11:41:00 +03:00
Alex Kost
86670ca4b7 emacs: main: Use (guix combinators).
Reported by rsiddharth on #guix.
This is a followup to commit 958dd3ce68.

* emacs/guix-main.scm: Use (guix combinators) module as 'memoize' moved there.
2016-05-05 11:33:06 +03:00
Alex Kost
557361e79f emacs: Add "edit" command to a list of licenses.
* emacs/guix-ui-license.el (guix-license-list-edit): New command.
(guix-license-list-mode-map): Bind it to "e" key.
2016-04-26 12:32:56 +03:00
Alex Kost
57748c2756 emacs: Add license definition button to License Info buffer.
* emacs/guix-ui-license.el (guix-license-insert-file): New procedure.
(guix-license-info-format): Use it.
2016-04-26 12:32:56 +03:00
Alex Kost
8472b2fd2d emacs: Add 'guix-find-license-definition' command.
* emacs/guix-license.el (guix-license-file): New procedure.
(guix-find-license-definition): New command.
* doc/emacs.texi (Emacs Licenses): Document it.
2016-04-26 12:32:56 +03:00
Mathieu Lirzin
03d0e2d2b9 build: Move 'Makefile' fragments to subdirectories.
This follows a convention used by some other GNU packages like Autoconf,
Bison, Coreutils, and Gnulib.

* doc.am: Rename to ...
* doc/local.mk: ... this.
* emacs.am: Rename to ...
* emacs/local.mk: ... this.
* gnu-system.am: Rename to ...
* gnu/local.mk: ... this.
* daemon.am: Rename to ...
* nix/local.mk: ... this.
* Makefile.am: Adapt to them.
* doc/guix.texi (Porting to a New Platform): Adapt documentation.
* guix/config.scm.in (%state-directory, %config-directory): Adapt comments.
* emacs/guix-config.el.in (guix-config-state-directory): Likewise.
2016-04-21 18:47:50 +02:00
Alex Kost
a7c61781df emacs: Display license info on button press in Package Info buffer.
* emacs/guix-ui-package.el (guix-package-license): Adjust button action
  to display license info instead of browsing license URL.
2016-04-18 10:09:02 +03:00
Alex Kost
690c055b08 emacs: Add location "Packages" button to Package Info buffer.
* emacs/guix-ui-package.el (guix-package-info-insert-location): New
procedure.
(guix-package-info-format): Use it.
(guix-output-info-format): Likewise.
2016-04-18 10:09:02 +03:00
Alex Kost
b4b9975d4a emacs: Add interface for package locations.
* emacs/guix-main.scm (%package-location-param-alist): New variable.
(package-location->sexp, package-location-entries): New procedures.
* emacs/guix-ui-location.el: New file.
* emacs.am (ELFILES): Add it.
* doc/emacs.texi (Emacs Package Locations): Document 'guix-locations'.
* NEWS: Mention it.
2016-04-18 10:09:02 +03:00
Alex Kost
e81a89d176 emacs: Make 'guix-find-location' interactive.
* emacs/guix-location.el (guix-find-location): Make interactive.  Adjust
  to handle "reduced" locations (without line and column numbers).
2016-04-18 10:09:02 +03:00
Alex Kost
8934c3b60f emacs: Display message if license not found.
* emacs/guix-ui-license.el (guix-license-message): New procedure.
(guix-license-info-message-function): Use it.
(guix-license-list-message-function): Likewise.
2016-04-18 10:09:02 +03:00
Alex Kost
27986d7b19 emacs: Separate package license code.
Move list/info interface code from "guix-license.el" to
"guix-ui-license.el".

* emacs/guix-license.el (guix-license-get-entries, guix-license-get-display)
(guix-license-insert-packages-button, guix-license-insert-comment)
(guix-licenses): Move to...
* emacs/guix-ui-license.el: ... here.  New file.
* emacs.am (ELFILES): Add it.
2016-04-18 10:09:02 +03:00
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
b4ea535a9f emacs: Add 'guix-packages-by-location' command.
* emacs/guix-main.scm (packages-by-location-file, package-location-files):
New procedures.
(%patterns-makers): Add 'location' search type.
* emacs/guix-messages.el (guix-message-packages-by-location): New procedure.
(guix-messages): Use it.
* emacs/guix-read.el (guix-package-locations)
(guix-read-package-location): New procedures.
* emacs/guix-ui-package.el (guix-packages-by-location): New command.
* doc/emacs.texi (Emacs Commands): Document it.

Co-authored-by: Ludovic Courtès <ludo@gnu.org>
2016-04-18 10:09:01 +03:00
Alex Kost
117195c28d emacs: Use full profile name in Guix buffer names.
* emacs/guix-ui.el (guix-ui-buffer-name-default): Rename to...
(guix-ui-buffer-name-short): ... this.
(guix-ui-buffer-name-full): New procedure.
(guix-ui-buffer-name-function): Set it as default.
2016-04-15 11:32:37 +03:00
Alex Kost
6ea80938ae emacs: Factorize code for buffer names.
* emacs/guix-ui.el (guix-ui-buffer-name-default): Extract the code to
  compose buffer name and move to...
* emacs/guix-utils.el (guix-compose-buffer-name): ... here.  New procedure.
2016-04-15 11:32:36 +03:00
Alex Kost
183f42f90f emacs: Speed up starting the REPL.
Delay initializing variables.

* emacs/guix-main.scm: (%packages): Rename to...
(%package-vhash): ... this.  Delay setting the value.
(package-vhash): New procedure (wrapper for '%package-vhash').
(%package-table): Delay setting the value.
(package-table): New procedure (wrapper for '%package-table').
(package-by-address, packages-by-name+version): Use wrappers.
2016-04-04 20:11:22 +03:00
Alex Kost
619ff9066d emacs: Use (guix scripts lint) only when needed.
* emacs/guix-main.scm: Do not use (guix scripts pull) module.
(lint-checker-names): Adjust to use it.
2016-04-04 20:11:22 +03:00
Alex Kost
7d0978f56f emacs: Remove unused module.
This is a followup to commit c67e344f21.

* emacs/guix-main.scm: Do not use (guix scripts pull).
2016-04-04 20:11:22 +03:00
Alex Kost
f1f09937a6 emacs: Stylistic improvements in guile code.
* emacs/guix-main.scm (package-unique?): Use 'match' instead of 'cdr'.
(package-by-address): Likewise.
2016-04-04 20:11:22 +03:00
Alex Kost
5f2928456b emacs: Use 'build-and-use-profile' from (guix scripts package).
* guix/scripts/package.scm: Export 'build-and-use-profile'.
* emacs/guix-main.scm (process-package-actions): Use it.
2016-04-04 20:11:22 +03:00
Alex Kost
ff4455e6e2 emacs: Deprecate "guix-init.el".
'guix-init' served 2 purposes:

- to autoload guix commands (by requiring 'guix-autoloads');
- and to autoload Emacs packages installed with Guix (by requiring
  'guix-emacs').

The second purpose is not actual anymore, as Emacs package handles this
task now, so there is no need in 'guix-init' anymore.

* emacs/guix-init.el: Do not require 'guix-emacs'.  Add a deprecation
  message.
* doc/emacs.texi (Emacs Initial Setup): Recommend to use
  'guix-autoloads' instead of 'guix-init'.
2016-03-24 18:49:59 +03:00
Alex Kost
c292a6f304 emacs: Use space to separate package name and version in heading.
Reported by Ludovic Courtès <ludo@gnu.org>.

* emacs/guix-ui-package.el (guix-package-name): Check 'spec' property.
(guix-package-info-insert-heading): Use "name version" for button label,
write name specification to 'spec' property.
2016-03-23 11:24:38 +03:00
Alex Kost
4c68c53804 emacs: Fix converting scheme into elisp expression.
* emacs/guix-geiser.el (guix-geiser-eval-read): Replace #f/#t with nil/t
  only when they follow "(" or " ".
2016-03-23 11:24:38 +03:00
Ludovic Courtès
16f4acbddb emacs: Gracefully handle wrong package names passed to 'guix-edit'.
Fixes <http://bugs.gnu.org/22933>.

* emacs/guix-main.scm (package-location-string): Rewrite to handle the
case where 'packages-by-name' returns the empty list.

Co-authored-by: Mathieu Lirzin <mthl@gnu.org>
2016-03-08 11:11:28 +01: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
b8fa5a2ae8 emacs: hydra: Use '-' to separate job names and version numbers.
* emacs/guix-hydra.el (guix-hydra-job-name-specification): New procedure.
* emacs/guix-ui-package.el (guix-package-info-insert-systems)
(guix-package-list-latest-builds): Use it.
2016-03-04 13:17:36 +03:00
Alex Kost
6caa4dfa37 Do not check package freshness during upgrade.
Fixes <http://bugs.gnu.org/22740>.
Reported by Andreas Enge <andreas@enge.fr>.

* gnu/packages.scm (waiting, ftp-open*, check-package-freshness): Remove.
* guix/scripts/package.scm (options->installable): Adjust accordingly.
* emacs/guix-main.scm (package->manifest-entry*): Likewise.
2016-02-24 18:24:16 +03:00
Alex Kost
260795b736 emacs: Do not allow a user to modify system profiles.
Fixes <http://bugs.gnu.org/22607>.
Reported by myglc2 <myglc2@gmail.com>.

Remove possibilities to install/delete packages to/from a system profile
both for "Package List" and "Package Info" buffers.

* emacs/guix-profiles.el (guix-system-profile-regexp): New variable.
(guix-system-profile?): New procedure.
* emacs/guix-ui-package.el (guix-package-info-insert-output): Do not
display "Install"/"Delete" button for a system profile.
(guix-package-assert-non-system-profile): New procedure.
(guix-package-execute-actions): Use it.
2016-02-22 22:36:35 +03:00
Alex Kost
0338132e65 emacs: Set 'guix-buffer-item' before displaying entries.
* emacs/guix-buffer.el (guix-buffer-set): Set 'guix-buffer-item' early,
  so that it can be used during displaying entries.  For example, this
  allows us to use a value of the current guix profile when package
  entries are inserted in a "List" or "Info" buffer.
2016-02-22 22:29:56 +03:00
Alex Kost
cfb1c62aa9 emacs: Add 'M-x guix-installed-{user/system}-packages'.
* emacs/guix-ui-package.el (guix-installed-user-packages)
(guix-installed-system-packages): New commands.
* doc/emacs.texi (Emacs Commands): Document them.
2016-02-22 22:17:16 +03:00
Alex Kost
19a9c6f47c emacs: Autoload hooks instead of putting them in 'guix-init'.
* emacs/guix-init.el: Move adding hooks to...
* emacs/guix-build-log.el: ... here.
* emacs/guix-devel.el: ... and here.
2016-02-18 11:59:03 +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
004ea62955 emacs: Find Emacs packages in a system profile.
Fixes <http://bugs.gnu.org/22550>.
Reported by myglc2 <myglc2@gmail.com>.

* emacs/guix-emacs.el (guix-emacs-autoload-packages): Autoload Emacs
  packages installed in a system profile.
2016-02-07 11:24:35 +03:00
Alex Kost
09b634565d emacs: Move the code to load Emacs packages after installing.
This code should belong to "guix-backend" as it is run after a REPL
operation to check if new Emacs packages have been installed and to
autoload them if needed.

* emacs/guix-emacs.el (guix-emacs-activate-after-operation)
(guix-emacs-load-autoloads-maybe): Move and rename to...
* emacs/guix-backend.el (guix-emacs-activate-after-operation)
(guix-repl-autoload-emacs-packages-maybe): ... this.
(guix-after-repl-operation-hook): Adjust for the renaming.
2016-02-07 11:24:35 +03:00
Alex Kost
abea77e3f0 emacs: Factorize searching for Emacs packages.
* emacs/guix-emacs.el: (guix-emacs-directories): New procedure.
(guix-emacs-find-autoloads-in-directory): Rename to...
(guix-emacs-find-autoloads): ... this.
(guix-emacs-load-autoloads): Remove.  Replace with...
(guix-emacs-autoload-packages): ... this.  New procedure.  At first,
find a list of directories with Emacs packages, then add them to
'load-path' and finally, load autoloads.
* doc/emacs.texi (Emacs Initial Setup): Adjust accordingly.
2016-02-07 11:24:35 +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
70fd33ea75 emacs: command: Disambiguate "w" key in build options.
This is a followup to commit 47c0f92c37.

* emacs/guix-command.el (guix-command-improve-common-build-argument):
  Use "W" key for '--with-input' option (leave "w" for '--with-source').
2016-02-01 21:23:38 +03:00
Alex Kost
710fa231f0 guix system: Rename 'dmd-graph' to 'shepherd-graph'.
* doc/images/dmd-graph.dot: Rename to...
* doc/images/shepherd-graph.dot: ... this.
* doc.am (DOT_FILES): Adjust accordingly.
* guix/scripts/system.scm (dmd-service-node-label)
  (dmd-service-node-type, export-dmd-graph): Rename to...
  (shepherd-service-node-label, shepherd-service-node-type)
  (export-shepherd-graph): ... this.
  (show-help, process-action, process-command): Rename 'dmd-graph' to
  'shepherd-graph'.
* emacs/guix-command.el (guix-command-additional-execute-arguments)
  (guix-command-special-executors): Likewise.
* doc/guix.texi: Likewise.
* doc/emacs.texi (Emacs Popup Interface): Likewise.
2016-01-29 20:21:54 +03:00
Alex Kost
687c9bc023 emacs: Add interface for licenses.
* emacs/guix-main.scm (%license-param-alist): New variable.
  (license->sexp, find-licenses, license-entries): New procedures.
* emacs/guix-license.el (guix-license-get-entries)
  (guix-license-get-display, guix-license-insert-packages-button)
  (guix-license-insert-comment, guix-license-list-describe)
  (guix-license-list-show-packages): New procedures.
  (guix-licenses): New command.
* doc/emacs.texi (Emacs Licenses): New node.
  (Emacs Interface): Add it.
* doc/guix.texi (Top): Add it.
* NEWS: Mention new interface.
2016-01-25 22:11:47 +03:00