Commit Graph

15 Commits (4d93f312f084c34a70cf7da3abe5f92a74d76861)

Author SHA1 Message Date
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 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
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 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 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 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 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 1a6c4c2f37 emacs: Add 'guix-devel-build-package-definition'.
Suggested by Ludovic Courtès <ludo@gnu.org>.

* emacs/guix-guile.el (guix-guile-definition-regexp): New variable.
  (guix-guile-current-definition, guix-guile-boolean): New functions.
* emacs/guix-devel.el: Require 'guix-base'.
  (guix-devel-repl-processes): New variable.
  (guix-devel-setup-repl, guix-devel-setup-repl-maybe): New functions.
  (guix-devel-build-package-definition): New command.
* doc/emacs.texi (Emacs Development): Document it.
2015-09-23 13:36:37 +03:00
Alex Kost 187f80c6c5 emacs: Add development utils.
* emacs/guix-guile.el (guix-guile-current-module): New function.
* emacs/guix-devel.el: New file.
* emacs.am (ELFILES): Add it.
* doc/emacs.texi (Emacs Development): New node.
  (Emacs Interface): Add it.
* doc/contributing.texi (The Perfect Setup): Mention it.
* doc/guix.texi (Top): Add it.
* emacs/guix-init.el: Add 'guix-devel-activate-mode-maybe' to
  'scheme-mode-hook'.
2015-09-23 13:36:37 +03:00