Browse Source

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.
gn-latest-20200428
Alex Kost 6 years ago
parent
commit
81b339fe31
3 changed files with 555 additions and 342 deletions
  1. +6
    -6
      emacs/guix-base.el
  2. +2
    -1
      emacs/guix-info.el
  3. +547
    -335
      emacs/guix-main.scm

+ 6
- 6
emacs/guix-base.el View File

@@ -323,8 +323,8 @@ following keywords are available:
Call an appropriate scheme function and return a list of the
form of `guix-entries'.

ENTRY-TYPE should be one of the following symbols: `package' or
`generation'.
ENTRY-TYPE should be one of the following symbols: `package',
`output' or `generation'.

SEARCH-TYPE may be one of the following symbols:

@@ -337,7 +337,7 @@ SEARCH-TYPE may be one of the following symbols:
PARAMS is a list of parameters for receiving. If nil, get
information with all available parameters."
(guix-eval-read (guix-make-guile-expression
'get-entries
'entries
guix-current-profile params
entry-type search-type search-vals)))

@@ -563,9 +563,9 @@ See `guix-process-package-actions' for details."
(or (null guix-operation-confirm)
(let* ((entries (guix-get-entries
'package 'id
(list (append (mapcar #'car install)
(mapcar #'car upgrade)
(mapcar #'car remove)))
(append (mapcar #'car install)
(mapcar #'car upgrade)
(mapcar #'car remove))
'(id name version location)))
(install-strings (guix-get-package-strings install entries))
(upgrade-strings (guix-get-package-strings upgrade entries))


+ 2
- 1
emacs/guix-info.el View File

@@ -512,7 +512,8 @@ ENTRY is an alist with package info."
(button-get btn 'output)))))
(concat type-str " '" full-name "'")
'action-type type
'id (guix-get-key-val entry 'id)
'id (or (guix-get-key-val entry 'package-id)
(guix-get-key-val entry 'id))
'output output)))

(defun guix-package-info-insert-output-path (path &optional _)


+ 547
- 335
emacs/guix-main.scm
File diff suppressed because it is too large
View File


Loading…
Cancel
Save