Commit Graph

130 Commits

Author SHA1 Message Date
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
Alex Kost 833fdac028 emacs: Add package info heading.
Co-authored-by: Ludovic Courtès <ludo@gnu.org>

* emacs/guix-info.el: (guix-package-info-heading): New face.
  (guix-package-info-synopsis): Modify face.
  (guix-info-insert-entry-default, guix-package-info-insert-heading,
  guix-package-info-insert-with-heading): New procedures.
  (guix-package-info-heading-params, guix-info-insert-package-function,
  guix-info-insert-installed-function, guix-info-insert-output-function,
  guix-info-insert-generation-function): New variables.
2014-11-02 20:43:10 +03:00
Alex Kost 2d7bf94927 emacs: Add 'guix-pull' command.
* emacs/guix-base.el (guix-pull): New command.
  (guix-update-after-pull, guix-after-pull-hook): New variables.
  (guix-restart-repl-after-pull, guix-update-buffers-maybe-after-pull): New
  procedures.
* emacs/guix-main.scm: Use (guix scripts pull) module.
* doc/emacs.texi (Emacs Commands): Document 'guix-pull' command.
2014-10-27 21:52:56 +03:00
Alex Kost 17b50485a6 emacs: Improve REPL procedures.
* emacs/guix-backend.el (guix-start-process-maybe): Add 'start-msg' and
  'end-msg' optional arguments.
  (guix-start-repl-maybe): Likewise.  Do not kill buffer with a dead process.
  (guix-repl-exit): New procedure.
  (guix-eval-in-repl): Use 'geiser-repl--send'.
2014-10-27 21:52:56 +03:00
Alex Kost f209da9f94 emacs: Improve buffer procedures.
* emacs/guix-base.el (guix-list-or-info-buffer-p): Delete.  Replace with...
  (guix-buffer-p): ... this.  New procedure.
  (guix-buffers): Use it.  Add 'modes' argument.
  (guix-update-buffer): New procedure.
  (guix-update-buffers-maybe): Rename to ...
  (guix-update-buffers-maybe-after-operation): this.  Use
  'guix-update-buffer'.
2014-10-27 21:52:56 +03:00
Alex Kost ce2e4e3938 emacs: Introduce REPL operation type.
* emacs/guix-backend.el (guix-repl-operation-type): New variable.
  (guix-repl-output-filter): Run type hooks after performing an operation.
  (guix-eval-read): Add 'operation-type' argument.
2014-10-27 21:52:55 +03:00
Alex Kost d2b299a91f emacs: Handle updating by ID after REPL restart.
* emacs/guix-base.el (guix-entry-to-specification,
  guix-entries-to-specifications): New procedures.
  (guix-revert-buffer): Search by name if searching by ID gives no results.
2014-10-27 21:52:55 +03:00
Alex Kost 23459fa59b emacs: Improve interface for working with multiple profiles.
Suggested by David Thompson, Ludovic Courtès and Mathieu Lirzin.

* emacs/guix-base.el (guix-profile-prompt): New procedure.
  (guix-set-current-profile): Use it.
  (guix-buffer-name-simple, guix-buffer-name-default, guix-buffer-name): New
  procedures.
  (guix-buffer-name-function, guix-profile): New variables.
  (guix-set-vars, guix-get-entries, guix-get-show-entries, guix-set-buffer,
  guix-history-call, guix-process-package-actions,
  guix-continue-package-operation-p, guix-delete-generations,
  guix-switch-to-generation): Add 'profile' argument.
* emacs/guix.el (guix-get-show-packages, guix-get-show-generations,
  guix-search-by-name, guix-search-by-regexp, guix-installed-packages,
  guix-obsolete-packages, guix-all-available-packages,
  guix-newest-available-packages, guix-generations, guix-generations-by-time):
  Likewise.
  (guix-last-generations): New command.
* emacs/guix-info.el: Adjust for using 'profile' argument where needed.
* emacs/guix-list.el: Likewise.
* doc/emacs.texi (Emacs Commands): Document 'guix-last-generations' and using
  "C-u" for commands.
  (Emacs Buffer Names): Document 'guix-buffer-name-function'.
2014-10-18 10:24:13 +04:00
Alex Kost 189cea2782 emacs: Add 'guix-generations-by-time' command.
* emacs/guix-main.scm (find-generations): Add finding generations by time.
* emacs/guix-utils.el (guix-read-date): New procedure.
* emacs/guix-base.el (guix-messages): Add new messages.
* emacs/guix.el (guix-generations-by-time): New command.
* doc/emacs.texi (emacs Commands): Document it.
2014-10-17 10:56:27 +04:00
Alex Kost 49d758d212 emacs: Support auto-updating after performing REPL operation.
* emacs/guix-backend.el (guix-operation-buffer): New variable.
  (guix-eval-in-repl): Use it.  Add optional 'operation-buffer' argument.
* emacs/guix-base.el (guix-update-after-operation): New variable.
  (guix-switch-to-buffer, guix-list-or-info-buffer-p, guix-buffers,
  guix-update-buffers-maybe): New procedures.
  (guix-set-buffer): Use 'guix-switch-to-buffer'.  Add optional 'no-display'
  argument.
  (guix-process-package-actions, guix-delete-generations,
  guix-switch-to-generation): Add optional 'operation-buffer' argument.
* emacs/guix-info.el (guix-package-info-insert-action-button,
  guix-generation-info-insert-number, guix-generation-info-insert-current):
  Adjust for using operation buffer.
* emacs/guix-list.el (guix-list-execute-package-actions,
  guix-generation-list-switch, guix-generation-list-execute): Likewise.
2014-10-16 10:09:53 +04:00
Alex Kost 063b60be7b emacs: Add hooks for REPL operations.
* emacs/guix-backend.el (guix-before-repl-operation-hook,
  guix-after-repl-operation-hook, guix-repl-operation-p): New variables.
  (guix-repl-operation-success-message, guix-repl-output-filter): New
  procedures.
  (guix-start-repl): Adjust for using 'guix-repl-output-filter'.
  (guix-eval-in-repl): Honor 'guix-before-repl-operation-hook'.
2014-10-16 10:09:53 +04:00
Alex Kost af874238d4 emacs: Add support for switching generations.
* emacs/guix-base.el (guix-switch-to-generation): New procedure.
* emacs/guix-info.el (guix-generation-info-insert-current): Insert button for
  switching to generation.
* emacs/guix-list.el (guix-generation-list-switch): New procedure.
* doc/emacs.texi (emacs List buffer, emacs Info buffer): Document switching
  generations.
2014-10-13 14:59:35 +04:00
Alex Kost c2379b3c1f emacs: Add 'current' generation parameter.
* emacs/guix-main.scm (generation-param-alist): Add 'current' parameter.
* emacs/guix-base.el (guix-param-titles): Add title for 'current' parameter.
* emacs/guix-info.el: Display 'current' parameter.
  (guix-generation-info-current, guix-generation-info-not-current): New faces.
  (guix-generation-info-insert-current): New procedure.
* emacs/guix-list.el: Display 'current' column.
  (guix-generation-list-get-current): New procedure.
2014-10-13 14:59:35 +04:00
Alex Kost abc5b82971 emacs: Allow list functions to deal with nil values.
* emacs/guix-list.el (guix-list-get-tabulated-entry): Call functions returning
  column value even for nil values.
  (guix-list-get-one-line): Adjust for accepting nil argument.
2014-10-12 08:47:19 +04:00
Alex Kost 5d7a8584f5 ui: Move 'show-manifest-transaction' from (guix profiles).
* guix/profiles.scm: Do not use (guix ui) module.
  (right-arrow, manifest-show-transaction): Move and rename to...
* guix/ui.scm (right-arrow, show-manifest-transaction): ... here.
* tests/profiles.scm ("manifest-show-transaction"): Move to...
* tests/ui.scm ("show-manifest-transaction"): ... here.
  (guile-1.8.8, guile-2.0.9): New variables.
* emacs/guix-main.scm (process-package-actions): Rename
  'manifest-show-transaction' to 'show-manifest-transaction'.
* guix/scripts/package.scm (guix-package): Likewise.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2014-10-10 00:06:35 +02:00
Alex Kost 1f06b28899 emacs: Use 'with-store' in 'process-package-actions'.
* emacs/guix-main.scm (process-package-actions): Use 'with-store'.
2014-10-06 22:14:38 +04:00
Alex Kost cb6a5c71d8 emacs: Add support for deleting generations.
* doc/emacs.texi (emacs List buffer): Mention new key bindings.
* emacs/guix-base.el (guix-delete-generations): New procedure.
* emacs/guix-info.el (guix-generation-info-insert-number): Use it.
* emacs/guix-list.el (guix-generation-list-mark-delete,
  guix-generation-list-execute): New procedures.
* emacs/guix-main.scm (delete-generations*): New procedure.
2014-10-06 00:02:46 +04:00
Alex Kost b497a85be8 emacs: Add support for modifying options during operation confirmation.
* emacs/guix-base.el (guix-operation-option-key): New face.
  (guix-operation-option-true-string, guix-operation-option-false-string,
  guix-operation-option-separator, guix-operation-options): New variables.
  (guix-operation-option-by-key, guix-operation-option-key,
  guix-operation-option-name, guix-operation-option-variable,
  guix-operation-option-value, guix-operation-option-string-value,
  guix-operation-prompt, guix-operation-set-mode-line): New procedures.
  (guix-continue-package-operation-p): Use 'guix-operation-prompt'.
2014-10-02 22:31:18 +04:00
Alex Kost 3472bb20c5 emacs: Use package/output type variables where needed.
* emacs/guix-list.el (guix-package-list-type, guix-output-list-describe-type):
  Move to...
* emacs/guix-base.el: ... here.  Rename 'guix-output-list-describe-type' to
  'guix-package-info-type'.
* emacs/guix-info.el (guix-generation-info-insert-number): Use
  'guix-package-list-type'.
* emacs/guix.el (guix-get-show-packages): Use 'guix-package-info-type'.
2014-09-28 22:46:15 +04:00
Alex Kost 2e269860c4 emacs: Support font-locking.
Avoid breaking highlighting after adding new font-lock keywords.

* emacs/guix-base.el (guix-insert-package-strings): Use 'propertize' instead
  of 'guix-get-string'.
* emacs/guix-info.el (guix, guix-action, guix-file, guix-url,
  guix-package-location, guix-package-name): New button types.
  (guix-info-insert-action-button, guix-info-insert-file-path,
  guix-info-insert-url, guix-package-info-insert-location,
  guix-package-info-insert-full-names,
  guix-package-info-insert-non-unique-text): Adjust for 'guix-insert-button'
  and button types.
  (guix-package-info-name-button): New face.
  (guix-package-info-define-insert-inputs): Use it.  Add new button types.
  (guix-package-info-insert-full-name): Remove.
* emacs/guix-utils.el (guix-get-string): Replace 'face' with 'font-lock-face'.
  (guix-insert-button): Adjust for using button types.
2014-09-28 22:46:15 +04:00
Alex Kost ce8b295352 emacs: Fix errors in receiving information.
* emacs/guix-main.scm (package-pattern-transformer,
  output-pattern-transformer): Add fallback 'match' clauses.
  (find-generations): Fix getting generations by IDs.
2014-09-28 22:46:14 +04:00
Alex Kost a54a237b5f emacs: Add support for displaying outputs.
Suggested by Taylan Ulrich Bayirli/Kammer and Ludovic Courtès.

* emacs/guix-base.el (guix-param-titles): Add output titles.
  (guix-messages): Add output messages.
  (guix-get-package-id-and-output-by-output-id): New procedure.
  (guix-define-buffer-type): Add ':buffer-name' key.
* emacs/guix-info.el: Add "output-info" buffer type.
  (guix-info-insert-methods): Add output methods.
  (guix-info-displayed-params): Add output params.
  (guix-output-info-insert-version, guix-output-info-insert-output): New
  procedures.
* emacs/guix-list.el: Add "output-list" buffer type.
  (guix-list-column-format): Add output formats.
  (guix-list-column-value-methods): Add output methods.
  (guix-package-list-type): New variable.
  (guix-generation-list-show-packages): Use it.
  (guix-package-list-marking-check): Use 'guix-output-list-mode'.
  (guix-list-mark-package-upgrades): New procedure.
  (guix-package-list-mark-upgrades): Use it.
  (guix-list-execute-package-actions): New procedure.
  (guix-package-list-execute): Use it.
  (guix-list-describe-maybe): New procedure.
  (guix-list-describe): Use it.
  (guix-output-list-mark-install, guix-output-list-mark-delete,
  guix-output-list-mark-upgrade, guix-output-list-mark-upgrades,
  guix-output-list-execute, guix-output-list-make-action,
  guix-output-list-describe): New procedures.
  (guix-output-list-describe-type): New variable.
* emacs/guix.el (guix-get-show-packages): Use 'guix-package-list-type'.
* doc/emacs.texi (emacs Commands): Mention 'guix-package-list-type'.
  (emacs List buffer): Adjust accordingly.
  (emacs Info buffer): Likewise.
  (emacs Buffer Names): New node.
  (emacs Keymaps): Add keymaps for output buffers.
2014-09-24 16:09:20 +04:00
Alex Kost 81b339fe31 emacs: Rewrite scheme side in a functional manner.
* emacs/guix-main.scm: Rewrite in a functional way.  Add support for output
  entries.
  (%current-manifest, %current-manifest-entries-table,
  set-current-manifest-maybe!): Replace with...
  (manifest-entries->hash-table, manifest->hash-table): ... this.
  (manifest-entries-by-name+version): Replace with...
  (manifest-entries-by-name): ... this.
  (fold-manifest-entries): Rename to...
  (fold-manifest-by-name): ... this.
  (package-installed-param-alist): Rename to...
  (%manifest-entry-param-alist): ... this.
  (package-param-alist): Rename to...
  (%package-param-alist): this.
  (manifest-entry->installed-entry): Rename to...
  (manifest-entry->sexp): ... this.
  (manifest-entries->installed-entries): Rename to...
  (manifest-entries->sexps): ... this.
  (matching-generation-entries): Replace with...
  (matching-generations): ... this.
  (last-generation-entries): Replace with...
  (last-generations): ... this.
  (get-entries): Rename to...
  (entries): ... this.
  (installed-entries-by-name+version, installed-entries-by-package,
  matching-package-entries, fold-object, package-entries-by-name+version,
  package-entries-by-spec, package-entries-by-regexp, package-entries-by-ids,
  newest-available-package-entries, all-available-package-entries,
  manifest-package-entries, installed-package-entries,
  generation-package-entries, obsolete-package-entries,
  all-generation-entries, generation-entries-by-ids, profile-generations,
  %package-entries-functions, %generation-entries-functions): Remove.
  (manifest=?, manifest-entry->name+version+output, manifest-entry-by-output,
  list-maybe, matching-packages, filter-packages-by-output, packages-by-name,
  manifest-entry->packages, all-available-packages, newest-available-packages,
  specification->package-pattern, specification->output-pattern,
  id->package-pattern, id->output-pattern, specifications->package-patterns,
  specifications->output-patterns, ids->package-patterns,
  ids->output-patterns, manifest-patterns-result, obsolete-package-patterns,
  obsolete-output-patterns, manifest-package-patterns,
  manifest-output-patterns, obsolete-package-sexp,
  package-pattern-transformer, output-pattern-transformer, entry-type-error,
  search-type-error, pattern-transformer, patterns-maker,
  package/output-sexps, find-generations, generation-sexps): New procedures.
  (%pattern-transformers, %patterns-makers): New variables.
* emacs/guix-base.el (guix-continue-package-operation-p): Adjust accordingly.
* emacs/guix-info.el (guix-package-info-insert-action-button): Likewise.
2014-09-24 16:09:20 +04:00
Alex Kost dfeb023927 emacs: Use general functions instead of generated ones.
* emacs/guix-base.el: Add and use general functions instead of
  specialized functions generated by 'guix-define-buffer-type' macro.
  (guix-buffer-type, guix-entry-type): New variables.
  (guix-set-vars): Add new variables.
  (guix-get-show-entries, guix-show-entries, guix-set-buffer)
  (guix-history-call, guix-make-history-item)
  (guix-get-params-for-receiving, guix-revert-buffer)
  (guix-redisplay-buffer): New functions.
  (guix-define-buffer-type): Do not generate specialized functions.
* emacs/guix-info.el (guix-package-info-insert-full-names): Use
  'guix-get-show-entries'.
  (guix-generation-info-insert-number): Likewise.
* emacs/guix-list.el (guix-list-describe): New function.
  (guix-list-define-entry-type): Do not generate specialized one.
  (guix-generation-list-show-packages): Use 'guix-get-show-entries'.
* emacs/guix.el (guix-show-generations-function): Remove.
  (guix-get-show-packages): Use new functions.
  (guix-get-show-generations): Likewise.
2014-09-24 16:09:20 +04:00
Alex Kost 91cc37a1e3 emacs: Improve key bindings for marking the packages.
Use "U" to upgrade the current package, "^" to upgrade all.

* emacs/guix-list.el: (guix-list-unmark): With prefix, mark all.
  (guix-package-list-mark-outputs): New procedure.
  (guix-package-list-mark-install, guix-package-list-mark-delete)
  (guix-package-list-mark-upgrade): Use it.
  (guix-package-list-mark-upgrades): New command.
* doc/emacs.texi (emacs List buffer): Update the manual accordingly.
2014-09-08 22:01:58 +04:00
Alex Kost 8ed08c7602 emacs: Add a face for installed packages.
* emacs/guix-list.el (guix-package-list-installed): New face.
  (guix-package-list-get-name): Use it.
2014-09-06 20:21:21 +04:00
Alex Kost 457f60fa06 Add Emacs user interface.
* configure.ac (emacsuidir): New variable.
  (AC_CONFIG_FILES): Add 'emacs/guix-init.el', 'emacs/guix-helper.scm'.
* Makefile.am: Include 'emacs.am'.
* emacs.am: New file.
* doc/emacs.texi: New file.
* doc/guix.texi: Include 'emacs.texi'.
* emacs/guix-backend.el: New file.
* emacs/guix-base.el: New file.
* emacs/guix-helper.scm.in: New file.
* emacs/guix-history.el: New file.
* emacs/guix-info.el: New file.
* emacs/guix-init.el.in: New file.
* emacs/guix-list.el: New file.
* emacs/guix-main.scm: New file.
* emacs/guix-utils.el: New file.
* emacs/guix.el: New file.
2014-09-03 23:50:35 +04:00