Commit Graph

21 Commits (b1990426fdec1b0047a115116ac686c6dd4d4884)

Author SHA1 Message Date
Alex Kost 6c40b7b703 emacs: Generalize buffer interface.
Extract the code for defining buffer interface from "guix-base.el",
generalize it and move to "guix-buffer.el".

* emacs.am (ELFILES): Add "emacs/guix-buffer.el".
* emacs/guix-base.el (guix-profile, guix-entries, guix-buffer-type)
  (guix-entry-type, guix-search-type, guix-search-vals, guix-set-vars)
  (guix-get-symbol, guix-show-entries, guix-get-show-entries)
  (guix-set-buffer, guix-history-call, guix-make-history-item)
  (guix-get-params-for-receiving): Remove.
  (guix-switch-to-buffer): Rename to 'guix-buffer-display' and move to
  "guix-buffer.el".
  (guix-get-entries): Rename to 'guix-ui-get-entries' and move to
  "guix-ui.el".
  (guix-buffer-data, guix-buffer-value, guix-buffer-param-title)
  (guix-buffer-name, guix-buffer-history-size)
  (guix-buffer-revert-confirm?, guix-buffer-map, guix-buffer-revert)
  (guix-buffer-after-redisplay-hook, guix-buffer-redisplay)
  (guix-buffer-redisplay-goto-button): Move to...
* emacs/guix-buffer.el: ... here.  New file.
  (guix-buffer-item): New variable.
  (guix-buffer-with-item, guix-buffer-with-current-item)
  (guix-buffer-define-current-item-accessor)
  (guix-buffer-define-current-item-accessors)
  (guix-buffer-define-current-args-accessor)
  (guix-buffer-define-current-args-accessors): New macros.
  (guix-buffer-get-entries, guix-buffer-mode-enable)
  (guix-buffer-mode-initialize, guix-buffer-insert-entries)
  (guix-buffer-show-entries-default, guix-buffer-show-entries)
  (guix-buffer-message, guix-buffer-history-item, guix-buffer-set)
  (guix-buffer-display-entries-current)
  (guix-buffer-get-display-entries-current)
  (guix-buffer-display-entries, guix-buffer-get-display-entries): New
  procedures.
* emacs/guix-info.el: Adjust for the procedures renaming.
  (guix-info-define-interface): Add ':show-entries-function' keyword.
* emacs/guix-list.el: Likewise.
* emacs/guix-ui.el (guix-ui-define-interface): Generate
  'guix-ENTRY-TYPE-BUFFER-TYPE-get-entries' procedure based on
  'guix-ui-get-entries'.
* emacs/guix.el (guix-get-show-packages, guix-get-show-generations):
  Adjust for the procedures renaming.
2016-01-02 17:25:35 +03:00
Alex Kost 7735c503b5 emacs: Factorize macros for defining interfaces.
Make a root 'guix-buffer-define-interface' macro.  It should generate a
common code for any type of interface.  Inherit 'guix-info-define-interface'
and 'guix-list-define-interface' from it.  They should provide a general
'info'/'list' interface for any data.  Finally, make
'guix-ui-define-interface' for the common code for interfaces to Guix
packages and generations, and inherit 'guix-ui-info-define-interface' and
'guix-ui-list-define-interface' from it.

* emacs/guix-base.el (guix-define-buffer-type): Rename to...
  (guix-buffer-define-interface): ... this.  Rename internal
  variables ('buf-' -> 'buffer-').  Move ':required' keyword to
  'guix-ui-define-interface'.
* emacs/guix-info.el (guix-info-define-interface): New macro.
  (guix-info-font-lock-keywords): New variable.
* emacs/guix-list.el (guix-list-define-entry-type): Rename to...
  (guix-list-define-interface): ... this.
  (guix-list-font-lock-keywords): New variable.
  (guix-list-describe-ids): Move and rename to...
* emacs/guix-ui.el: New file.
  (guix-ui-list-describe): ... this.
  (guix-ui-define-interface, guix-ui-info-define-interface)
  (guix-ui-list-define-interface): New macros.
  (guix-ui-font-lock-keywords): New variable.
* emacs.am (ELFILES): Add "emacs/guix-ui.el"
2016-01-02 17:25:35 +03:00
Alex Kost 73ce3c19c4 emacs: Add API for 'guix-entry'.
* emacs/guix-info.el: Use new entry procedures.
* emacs/guix-list.el: Likewise.
* emacs/guix-base.el: Likewise.
  (guix-get-entry-by-id): Move and rename to ...
* emacs/guix-entry.el (guix-entry-by-id): ...this.  New file.
  (guix-entry-value, guix-entry-id, guix-entries-by-ids)
  (guix-replace-entry): New procedures.
* emacs.am (ELFILES): Add new file.
2016-01-02 17:25:35 +03:00
Alex Kost 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 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 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 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
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 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 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 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 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 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 fae3d34720 build: Add missing "emacs/guix-messages.el".
* emacs.am (ELFILES): Add "emacs/guix-messages.el".
2014-11-06 00:30:57 +03:00
Ludovic Courtès a9638ac413 build: Don't install elisp files when Emacs is unavailable.
* emacs.am (dist_lisp_DATA, nodist_lisp_DATA): Wrap in 'if HAVE_EMACS'.
2014-09-27 17:30:10 +02:00
Ludovic Courtès 596fcbf768 build: Don't generate Emacs autoloads when Emacs is unavailable.
Reported by Andreas Enge.

* configure.ac: Define 'HAVE_EMACS' Automake conditional.
* emacs.am ($(AUTOLOADS)): Wrap in 'if HAVE_EMACS'.
2014-09-27 17:27:21 +02: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