Commit Graph

176 Commits (8ed2c92eb12b894e03cc634d92d3c78636f44020)

Author SHA1 Message Date
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
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
Alex Kost 6f05a24df3 emacs: Add "View map" action to 'size' popup.
* emacs/guix-command.el (guix-run-view-size-map): New function.
  (guix-command-additional-execute-arguments,
  guix-command-special-executors): Add entries for "View map" action.
2015-09-23 13:36:22 +03:00
Alex Kost f80a7a6c58 emacs: Add code to call guile procedures.
* emacs/guix-guile.el (guix-guile-make-call-expression): New function.
* emacs/guix-geiser.el: Require 'guix-guile'.
  (guix-geiser-call, guix-geiser-call-in-repl): New functions.
2015-09-22 22:05:10 +03:00
Alex Kost f029f8a759 emacs: Move code for evaluating to "guix-geiser.el".
* emacs/guix-backend.el: Adjust commentary. Move "eval" code to ...
  (guix-eval, guix-eval-read, guix-eval-in-repl): Adjust to use new
  functions.
* emacs/guix-geiser.el: ...here.  New file.
  (guix-geiser-eval, guix-geiser-eval-read, guix-geiser-eval-in-repl,
  guix-repl-send): New functions.
* emacs.am (ELFILES): Add "guix-geiser.el".
2015-09-22 22:05:09 +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 67ee7c9576 emacs: Improve 'guix-prettify-regexp'.
* emacs/guix-prettify.el (guix-prettify-regexp): Modify to handle "nar"
  and "log".
2015-09-22 13:04:44 +03:00
Alex Kost b2cb869cf9 emacs: Replace 'guix-any' with 'cl-some'.
* emacs/guix-utils.el (guix-any): Remove.
* emacs/guix-command.el (guix-command-improve-argument): Use 'cl-some'
  instead of 'guix-any'.
2015-09-18 21:41:46 +03:00
Alex Kost eda1cc8b5d emacs: Add commands to show/hide build log phases.
Suggested by Ludovic Courtès <ludo@gnu.org>.

* emacs/guix-build-log.el (guix-build-log-phase-end-regexp): New
  variable.
  (guix-build-log-phase-start, guix-build-log-phase-end,
  guix-build-log-phase-hide, guix-build-log-phase-show,
  guix-build-log-phase-hidden-p, guix-build-log-phase-toggle-function,
  guix-build-log-phase-toggle, guix-build-log-phase-toggle-all): New functions.
  (guix-build-log-mode-map): Add 'TAB'/'S-TAB' key bindings.
* doc/emacs.texi (Emacs Build Log): Document them.
2015-09-18 21:41:23 +03:00
Alex Kost 83d95c7b36 emacs: Add "View build log" action to build popup.
* emacs/guix-command.el (guix-run-view-build-log): New function.
  (guix-command-additional-execute-arguments,
  guix-command-special-executors): Add entries for "View build log"
  action.
* emacs/guix-utils.el (guix-find-file-or-url): New function.
2015-09-15 15:19:31 +03:00
Alex Kost 34850cd59d emacs: Add modes for viewing build logs.
* emacs/guix-build-log.el: New file.
* emacs.am (ELFILES): Add it.
* doc/emacs.texi (Emacs Build Log): Document it.  New node.
  (Emacs Interface): Add it.
* doc/guix.texi (Top): Likewise.
2015-09-15 15:19:31 +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
Mathieu Lirzin 1cd4027cfd ui: Add package-description-string.
Provide support for Texinfo's markup in package description.

* guix/ui.scm (%text-width): New parameter.
  (texi->plain-text): New variable.
  (package->recutils): Use them.
  (package-description-string): New variable.
* emacs/guix-main.scm (%package-param-alist): Use it.
* gnu/packages/perl.scm (perl-devel-globaldestruction)
  (perl-devel-lexalias, perl-exporter-lite): Adapt to Texinfo's markup.
* gnu/packages/python.scm (python2-empy): Likewise.
2015-09-08 07:44:53 +02:00
Alex Kost 00f34aaafe emacs: Add support for "triplet" package inputs.
Fixes <http://bugs.gnu.org/21399>.

* emacs/guix-main.scm (full-name->name+version): Adjust to handle
  "name-version:output" string.
  (package-inputs-names): Support ("name" package "output") inputs.
2015-09-04 16:01:35 +03:00
Alex Kost d1f80aa401 emacs: Use "r" key for 'cran' action in 'import' popup.
* emacs/guix-command.el (guix-command-improve-import-argument): New
  variable and function.
  (guix-command-argument-improvers): Add it.
2015-09-02 17:00:06 +03:00
Alex Kost 761d6fd9c1 emacs: Add "View graph" action to graph popup.
* emacs/guix-command.el: Require 'guix-external'.
  (guix-run-view-graph): New function.
  (guix-command-additional-execute-arguments,
  guix-command-special-executors): Add entries for "View graph" action.
2015-09-01 13:03:51 +03:00
Alex Kost 32c0b6d78c emacs: Allow users to choose a 'find-file' function.
* emacs/guix-utils.el (guix-find-file-function): New variable.
  (guix-find-file): Use it.
2015-09-01 13:03:51 +03:00
Alex Kost 70fabd498c emacs: Add code to run 'dot' program.
* emacs/guix-external.el: New file.
* emacs.am (ELFILES): Add it.
2015-09-01 13:03:50 +03:00
Alex Kost 8b9ceb8d03 emacs: Add code to pipe guix output to external program.
* emacs/guix-main.scm: Use (ice-9 popen) module.
  (pipe-guix-output): New procedure.
2015-09-01 13:03:50 +03:00
Mathieu Lirzin 9a479bc383 emacs: Use only one guix-load-path variable.
emacs/guix-init.el (guix-load-path): Move to ...
emacs/guix-backend.el (guix-load-path): ... Here. Redefine it.
2015-08-30 22:46:21 +02:00
Mathieu Lirzin 7061938fdb emacs: Fix guix-guile-program default value.
Fixes <http://bugs.gnu.org/21127>.

* emacs/guix-backend.el: Use guix-config.
  (guix-guile-program): Move to ...
* emacs/guix-config.el.in (guix-guile-program): ... here.  Use Guile
  program file name from compile-time instead of depending on PATH.
2015-08-30 22:45:47 +02:00
Mathieu Lirzin bd6163d13f build: Produce 'guix-config' instead of using compile-time tricks.
* emacs/guix-{init,profiles}.el.in: Rename to ...
* emacs/guix-{init,profiles}.el: ... these.  New files.
  Use 'guix-config'.
* emacs/guix-config.el.in: New file.
* emacs.am (nodist_lisp_DATA): Add it.  Move them to ...
  (ELFILES): ... here.
* .gitignore, configure.ac: Adjust accordingly.
2015-08-30 19:20:12 +02: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 9b0afb0d28 emacs: Add popup interface for guix commands.
* emacs/guix-command.el: New file.
* emacs.am (ELFILES): Add it.
* doc/emacs.texi (Emacs Initial Setup): Mention 'magit-popup' library.
  (Emacs Popup Interface): New node.
  (Emacs Interface): Add it.
* doc/guix.texi (Top): Likewise.
2015-08-30 18:26:03 +03:00
Alex Kost 1f13861b57 emacs: Add "guix-popup.el".
* emacs/guix-popup.el: New file.
* emacs.am (ELFILES): Add it.
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 d007d8a10c emacs: Add minibuffer readers.
* emacs/guix-read.el: New file.
* emacs.am (ELFILES): Add it.
2015-08-30 18:26:02 +03:00
Alex Kost 26476d5852 emacs: Add help variables.
* emacs/guix-pcomplete.el (guix-pcomplete-parse-package-regexp,
  guix-pcomplete-parse-command-regexp,
  guix-pcomplete-parse-long-option-regexp,
  guix-pcomplete-parse-short-option-regexp,
  guix-pcomplete-parse-list-regexp, guix-pcomplete-parse-regexp-group,
  guix-pcomplete-systems, guix-pcomplete-hash-formats,
  guix-pcomplete-refresh-subsets, guix-pcomplete-key-policies): Move and
  rename to ...
* emacs/guix-help-vars.el (guix-help-parse-package-regexp,
  guix-help-parse-command-regexp, guix-help-parse-long-option-regexp,
  guix-help-parse-short-option-regexp, guix-help-parse-list-regexp,
  guix-help-parse-regexp-group, guix-help-system-types,
  guix-help-hash-formats, guix-help-refresh-subsets,
  guix-help-key-policies): ...here.  New file.
  (guix-help-parse-option-regexp, guix-help-source-types,
  guix-help-verify-options, guix-help-elpa-archives): New variables.
* emacs.am (ELFILES): Add "guix-help-vars.el".
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 6543601fa0 emacs: Add 'guix-memoized-defalias' macro.
* emacs/guix-utils.el (guix-memoized-defalias): New macro.
  (guix-memoized-font-lock-keywords): New variable.
2015-08-30 18:26:01 +03:00
Alex Kost e767752c79 emacs: Add 'guix-any'.
* emacs/guix-utils.el (guix-any): New function.
2015-08-30 18:26:01 +03:00
Alex Kost ad0f31f6a5 emacs: Add utils to copy guix command.
* emacs/guix-utils.el (guix-copy-as-kill, guix-copy-command-as-kill):
  New functions.
2015-08-30 18:26:01 +03:00
Alex Kost 009d6388e6 emacs: Add utils to make symbol and string for guix command.
* emacs/guix-utils.el (guix-shell-quote-argument, guix-command-symbol,
  guix-command-string): New functions.
2015-08-30 18:26:01 +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 c10521e976 emacs: Add and use 'guix-while-search'.
* emacs/guix-utils.el (guix-while-search): New macro.
* emacs/guix-pcomplete.el (guix-pcomplete-run-guix-and-search): Use it.
* emacs/guix-prettify.el (guix-prettify-decompose-buffer): Likewise.
2015-08-30 18:26:01 +03:00
Alex Kost 935d079bb7 emacs: Add 'guix-prettify' to 'guix' custom group.
* emacs/guix-prettify.el (guix-prettify): Add 'guix' group.
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 f2638f0b37 emacs: Add completions for 'guix graph'.
* emacs/guix-pcomplete.el (guix-pcomplete-parse-linter-regexp): Improve
  and rename to ...
  (guix-pcomplete-parse-list-regexp): ...this.  New variable.
  (guix-pcomplete-lint-checkers): Use it.
  (guix-pcomplete-graph-types): New function.
  (guix-pcomplete-complete-command-arg): Complete package names for
  'guix graph' command.
  (guix-pcomplete-complete-option-arg): Complete '-t/--type' option.
2015-08-27 17:50:01 +03:00
Ludovic Courtès 6078594b13 emacs: Require 'cl-lib'.
* emacs/guix-emacs.el: Require 'cl-lib', for 'cl-pushnew'.
2015-07-20 22:25:42 +02:00
Christopher Allan Webber 8c9610be19 emacs: Fix reference to directory variable.
This is a followup to commit 7741139080.

* emacs/guix-emacs.el (guix-emacs-find-autoloads): Fix variable
  reference to 'elisp-root-dir'.

Signed-off-by: Alex Kost <alezost@gmail.com>
2015-07-20 11:37:35 +03:00
Ludovic Courtès dbe422aba8 emacs: Fill package heading in Info buffers.
* emacs/guix-info.el (guix-package-info-fill-heading): New variable.
  (guix-package-info-insert-heading): Fill heading if needed.

Co-authored-by: Alex Kost <alezost@gmail.com>
2015-07-14 18:46:59 +03:00
Alex Kost 7741139080 emacs: Find autoloads in "guix.d" subdirectories.
Co-authored-by: Federico Beffa <beffa@fbengineering.ch>.

* emacs/guix-emacs.el (guix-emacs-find-autoloads-in-directory,
  guix-emacs-subdirs): New functions.
  (guix-emacs-find-autoloads): Search for autoloads in "guix.d"
  subdirectories.
  (guix-emacs-load-autoloads): Add subdirectories to 'load-path'.
* emacs/guix-init.el.in: Do not add guix emacs directory to 'load-path'
  because it will be done by 'guix-emacs-load-autoloads'.  Move
  requiring 'guix-emacs' from the top-level to a clause for checking for
  'guix-package-enable-at-startup'.
2015-07-11 18:21:35 +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 6a8c9545cb emacs: Simplify defining package ID in a list buffer.
* emacs/guix-list.el: Always retrieve 'package-id' parameter for a list
  of outputs.
  (guix-list-current-package-id): New function.
2015-06-22 22:19:19 +03:00
Alex Kost 0805f336ad emacs: Complete 'guix size --map-file' properly.
* emacs/guix-pcomplete.el (guix-pcomplete-complete-option-arg): Complete
  file name for '-m/--map-file' option of 'guix size' command.
2015-06-22 11:01:21 +03:00
Alex Kost 14a983c28a emacs: Add completions for 'edit' and 'size' commands.
* emacs/guix-pcomplete.el (guix-pcomplete-complete-command-arg):
  Complete package names for 'guix edit' and 'guix size' commands.
  (guix-pcomplete-complete-option-arg): Complete '-s/--system' option
  for 'guix size'.
2015-06-19 12:59:32 +03:00
Alex Kost 00a8dae2a6 emacs: Add shell completions for "guix" command.
Suggested by Ludovic Courtès <ludo@gnu.org>.

* emacs/guix-pcomplete.el: New file.
* emacs.am (ELFILES): Add it.
* doc/emacs.texi (Emacs Completions): New node.
2015-06-08 11:46:05 +03:00
Alex Kost 132e74fec9 emacs: Add "memoization" code.
* emacs/guix-utils.el (guix-memoize): New function.
  (guix-memoized-defun): New macro.
2015-06-08 11:46:05 +03:00
Alex Kost 307153c1ef emacs: Report about "search paths" after operation.
* guix/scripts/package.scm: Export 'display-search-paths'.
* emacs/guix-main.scm (process-package-actions): Use it.
2015-05-29 20:54:54 +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 578b98da43 emacs: Remove "M" key binding for marking all lines.
* emacs/guix-list.el: Split 'guix-list-mark' into internal and
  interactive functions.  Remove "M" key binding, use "C-u m" instead.
  (guix-list--mark): New function.  Use it in other marking functions.
  (guix-list-mark): Mark all lines with a prefix argument.
* doc/emacs.texi (Emacs List buffer): Document changes in the key
  bindings.
2015-05-29 20:54:54 +03:00
Ludovic Courtès 4ad2e76a14 emacs: In 'run-with-store' call, specify the guile-for-build.
This fixes a regression introduced in commit e87f059.

* emacs/guix-main.scm (process-package-actions): Add call to
  'set-guile-for-build' in monadic expression.
2015-01-16 21:24:52 +01:00
Alex Kost 12f2490aa3 emacs: Handle autoloading Emacs packages installed with Guix.
* emacs/guix-emacs.el: New file.
* emacs.am (ELFILES): Add it.
* emacs/guix-backend.el (guix-after-repl-operation-hook): Add
  'guix-emacs-load-autoloads-maybe'.
* emacs/guix-init.el.in: Autoload emacs packages.
  (guix-package-enable-at-startup): New variable.
2014-12-02 22:09:23 +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 cbbc877134 emacs: Add missing directory to the guile load path.
Reported by Adam Pribyl and David Thompson.

* emacs/guix-helper.scm.in (set-paths!): Add guile module dir to '%load-path'.
2014-11-26 23:07:16 +03:00
Ludovic Courtès 90fad2880d emacs: Disable build traces produced by the daemon.
* emacs/guix-main.scm (process-package-actions,
  package-source-build-derivation): Pass #:print-build-trace #f to
  'set-build-options', to reduce verbosity.
2014-11-25 23:01:48 +01:00
Ludovic Courtès a1ca1b7a50 emacs: Don't override the user's 'geiser-guile-load-path'.
* emacs/guix-backend.el (guix-start-repl): Add GUIX-LOAD-PATH to the
  front of GEISER-GUILE-LOAD-PATH instead of overriding it.
2014-11-20 21:14:39 +01: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 e718f6cc8f emacs: Add 'guix-find-file'.
* emacs/guix-utils.el (guix-find-file): New procedure.
* emacs/guix-info.el (guix-file): Use it.
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 5614921754 emacs: Add "c" key binding to copy a button link.
* emacs/guix-info.el (guix-info-button-map): New variable.
  (guix-info-button-copy-label): New procedure.
* doc/emacs.texi (Emacs Info buffer): Mention a "c" key binding.
  (Emacs Keymaps): Add 'guix-info-button-map'.
2014-11-10 16:13:40 +03:00
Alex Kost 9a130e19fc emacs: Add 'guix-prettify'.
* emacs/guix-prettify.el: New file.
* emacs.am (ELFILES): Add it.
* doc/emacs.texi (Emacs Prettify): New node.
* doc/guix.texi (Features): Mention it.
2014-11-07 14:58:15 +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