diff options
author | Alex Kost <alezost@gmail.com> | 2015-12-09 14:44:34 +0300 |
---|---|---|
committer | Alex Kost <alezost@gmail.com> | 2016-01-02 17:25:35 +0300 |
commit | c80ce104bed39157347078020cbc45c65ff9b893 (patch) | |
tree | a6151b01dd94994065716c1edffba2fd9578c23b /emacs/guix.el | |
parent | b1990426fdec1b0047a115116ac686c6dd4d4884 (diff) | |
download | patches-c80ce104bed39157347078020cbc45c65ff9b893.tar patches-c80ce104bed39157347078020cbc45c65ff9b893.tar.gz |
emacs: Reorganize package/generation UI code.
Move the code for packages/generations interface from "guix-info.el",
"guix-list.el", "guix-base.el" and "guix.el" to "guix-ui-package.el" and
"guix-ui-generation.el".
* emacs/guix-base.el (guix-package-entry->name-specification)
(guix-package-entries->name-specifications)
(guix-package-id-and-output-by-output-id)
(guix-package-installed-outputs, guix-process-package-actions)
(guix-package-list-type, guix-package-info-type)
(guix-continue-package-operation-p, guix-get-package-strings)
(guix-insert-package-strings): Move to "guix-ui-package.el".
(guix-generation-packages-buffer-name-function, guix-output-name-width)
(guix-generation-packages-update-buffer, 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-packages, guix-generation-insert-package)
(guix-profile-generation-manifest-file, guix-delete-generations)
(guix-profile-generation-packages-buffer, guix-switch-to-generation):
Move to "guix-ui-generation.el".
* emacs/guix-info.el (guix-package-location, guix-package-name)
(guix-package-source, guix-package-info-source)
(guix-package-info-heading, guix-package-info-license)
(guix-package-info-name, guix-package-info-name-button)
(guix-package-info-version, guix-package-info-location)
(guix-package-info-synopsis, guix-package-info-description)
(guix-package-info-obsolete, guix-package-info-installed-outputs)
(guix-package-info-uninstalled-outputs)
(guix-package-info-insert-heading)
(guix-package-info-define-insert-inputs)
(guix-package-info-obsolete-string)
(guix-package-info-insert-obsolete-text)
(guix-package-info-insert-non-unique-text)
(guix-package-info-insert-outputs, guix-package-info-insert-output)
(guix-package-info-insert-action-button)
(guix-package-info-auto-find-source)
(guix-package-info-auto-download-source)
(guix-package-info-download-buffer, guix-package-info-show-source)
(guix-package-info-download-source, guix-package-info-insert-source)
(guix-package-info-redisplay-after-download)
(guix-output-info-insert-version, guix-output-info-insert-output):
Move to "guix-ui-package.el".
(guix-generation-info-number, guix-generation-info-current)
(guix-generation-not-current, guix-generation-info-insert-number)
(guix-generation-info-insert-current): Move to "guix-ui-generation.el".
* emacs/guix-list.el (guix-package-list-generation-marking-enabled)
(guix-package-list-installed, guix-package-list-obsolete)
(guix-package-list-get-name, guix-package-list-get-installed-outputs)
(guix-package-list-marking-check, guix-package-list-mark-outputs)
(guix-package-list-mark-install, guix-package-list-mark-delete)
(guix-package-list-mark-upgrade, guix-package-list-mark-upgrades)
(guix-list-mark-package-upgrades, guix-list-execute-package-actions)
(guix-package-list-execute, guix-package-list-make-action)
(guix-package-list-edit, guix-output-list-mark-install)
(guix-output-list-mark-delete, guix-output-list-mark-upgrade)
(guix-output-list-mark-upgrades, guix-output-list-make-action)
(guix-output-list-describe, guix-output-list-edit): Move to
"guix-ui-package.el".
(guix-generation-list-get-current, guix-generation-list-switch)
(guix-generation-list-generations-to-compare)
(guix-generation-list-compare, guix-generation-list-show-packages)
(guix-generation-list-show-added-packages)
(guix-generation-list-show-removed-packages)
(guix-generation-list-diff, guix-generation-list-diff-manifests)
(guix-generation-list-ediff, guix-generation-list-ediff-manifests)
(guix-generation-list-diff-packages)
(guix-generation-list-ediff-packages)
(guix-generation-list-mark-delete, guix-generation-list-execute): Move
to "guix-ui-generation.el".
* emacs/guix.el: Remove.
(guix, guix-faces, guix-edit): Move to "guix-base.el".
(guix-list-single-package, guix-search-params, guix-search-history)
(guix-get-show-packages, guix-search-by-name, guix-search-by-regexp)
(guix-installed-packages, guix-obsolete-packages)
(guix-all-available-packages, guix-newest-available-packages): Move
to "guix-ui-package.el".
(guix-get-show-generations, guix-generations, guix-last-generations)
(guix-generations-by-time): Move to "guix-ui-generation.el".
* emacs.am (ELFILES): Remove "guix.el". Add "guix-ui-package.el" and
"guix-ui-generation.el".
* doc/emacs.texi (Emacs Appearance): Adjust accordingly.
Diffstat (limited to 'emacs/guix.el')
-rw-r--r-- | emacs/guix.el | 210 |
1 files changed, 0 insertions, 210 deletions
diff --git a/emacs/guix.el b/emacs/guix.el deleted file mode 100644 index 12dd4a2553..0000000000 --- a/emacs/guix.el +++ /dev/null @@ -1,210 +0,0 @@ -;;; guix.el --- Interface for GNU Guix package manager - -;; Copyright © 2014, 2015 Alex Kost <alezost@gmail.com> - -;; Package-Requires: ((geiser "0.3")) -;; Keywords: tools - -;; This file is part of GNU Guix. - -;; GNU Guix is free software; you can redistribute it and/or modify -;; it under the terms of the GNU General Public License as published by -;; the Free Software Foundation, either version 3 of the License, or -;; (at your option) any later version. - -;; GNU Guix is distributed in the hope that it will be useful, -;; but WITHOUT ANY WARRANTY; without even the implied warranty of -;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -;; GNU General Public License for more details. - -;; You should have received a copy of the GNU General Public License -;; along with this program. If not, see <http://www.gnu.org/licenses/>. - -;;; Commentary: - -;; This package provides an interface for searching, listing and getting -;; information about Guix packages and generations; and for -;; installing/upgrading/removing packages. - -;;; Code: - -(require 'guix-base) -(require 'guix-list) -(require 'guix-info) -(require 'guix-utils) -(require 'guix-read) - -(defgroup guix nil - "Interface for Guix package manager." - :prefix "guix-" - :group 'external) - -(defgroup guix-faces nil - "Guix faces." - :group 'guix - :group 'faces) - -(defcustom guix-list-single-package nil - "If non-nil, list a package even if it is the only matching result. -If nil, show a single package in the info buffer." - :type 'boolean - :group 'guix) - -(defvar guix-search-params '(name synopsis description) - "Default list of package parameters for searching by regexp.") - -(defvar guix-search-history nil - "A history of minibuffer prompts.") - -(defun guix-get-show-packages (profile search-type &rest search-values) - "Search for packages and show results. - -If PROFILE is nil, use `guix-current-profile'. - -See `guix-ui-get-entries' for the meaning of SEARCH-TYPE and -SEARCH-VALUES. - -Results are displayed in the list buffer, unless a single package -is found and `guix-list-single-package' is nil." - (let* ((args (cl-list* (or profile guix-current-profile) - search-type search-values)) - (entries (guix-buffer-get-entries - 'list guix-package-list-type args))) - (if (or guix-list-single-package - (null entries) - (cdr entries)) - (guix-buffer-display-entries - entries 'list guix-package-list-type args 'add) - (guix-buffer-get-display-entries - 'info guix-package-info-type args 'add)))) - -(defun guix-get-show-generations (profile search-type &rest search-values) - "Search for generations and show results. - -If PROFILE is nil, use `guix-current-profile'. - -See `guix-ui-get-entries' for the meaning of SEARCH-TYPE and -SEARCH-VALUES." - (let ((args (cl-list* (or profile guix-current-profile) - search-type search-values))) - (guix-buffer-get-display-entries - 'list 'generation args 'add))) - -;;;###autoload -(defun guix-search-by-name (name &optional profile) - "Search for Guix packages by NAME. -NAME is a string with name specification. It may optionally contain -a version number. Examples: \"guile\", \"guile-2.0.11\". - -If PROFILE is nil, use `guix-current-profile'. -Interactively with prefix, prompt for PROFILE." - (interactive - (list (read-string "Package name: " nil 'guix-search-history) - (and current-prefix-arg - (guix-profile-prompt)))) - (guix-get-show-packages profile 'name name)) - -;;;###autoload -(defun guix-search-by-regexp (regexp &optional params profile) - "Search for Guix packages by REGEXP. -PARAMS are package parameters that should be searched. -If PARAMS are not specified, use `guix-search-params'. - -If PROFILE is nil, use `guix-current-profile'. -Interactively with prefix, prompt for PROFILE." - (interactive - (list (read-regexp "Regexp: " nil 'guix-search-history) - nil - (and current-prefix-arg - (guix-profile-prompt)))) - (guix-get-show-packages profile 'regexp regexp - (or params guix-search-params))) - -;;;###autoload -(defun guix-installed-packages (&optional profile) - "Display information about installed Guix packages. -If PROFILE is nil, use `guix-current-profile'. -Interactively with prefix, prompt for PROFILE." - (interactive - (list (and current-prefix-arg - (guix-profile-prompt)))) - (guix-get-show-packages profile 'installed)) - -;;;###autoload -(defun guix-obsolete-packages (&optional profile) - "Display information about obsolete Guix packages. -If PROFILE is nil, use `guix-current-profile'. -Interactively with prefix, prompt for PROFILE." - (interactive - (list (and current-prefix-arg - (guix-profile-prompt)))) - (guix-get-show-packages profile 'obsolete)) - -;;;###autoload -(defun guix-all-available-packages (&optional profile) - "Display information about all available Guix packages. -If PROFILE is nil, use `guix-current-profile'. -Interactively with prefix, prompt for PROFILE." - (interactive - (list (and current-prefix-arg - (guix-profile-prompt)))) - (guix-get-show-packages profile 'all-available)) - -;;;###autoload -(defun guix-newest-available-packages (&optional profile) - "Display information about the newest available Guix packages. -If PROFILE is nil, use `guix-current-profile'. -Interactively with prefix, prompt for PROFILE." - (interactive - (list (and current-prefix-arg - (guix-profile-prompt)))) - (guix-get-show-packages profile 'newest-available)) - -;;;###autoload -(defun guix-generations (&optional profile) - "Display information about all generations. -If PROFILE is nil, use `guix-current-profile'. -Interactively with prefix, prompt for PROFILE." - (interactive - (list (and current-prefix-arg - (guix-profile-prompt)))) - (guix-get-show-generations profile 'all)) - -;;;###autoload -(defun guix-last-generations (number &optional profile) - "Display information about last NUMBER generations. -If PROFILE is nil, use `guix-current-profile'. -Interactively with prefix, prompt for PROFILE." - (interactive - (list (read-number "The number of last generations: ") - (and current-prefix-arg - (guix-profile-prompt)))) - (guix-get-show-generations profile 'last number)) - -;;;###autoload -(defun guix-generations-by-time (from to &optional profile) - "Display information about generations created between FROM and TO. -FROM and TO should be time values. -If PROFILE is nil, use `guix-current-profile'. -Interactively with prefix, prompt for PROFILE." - (interactive - (list (guix-read-date "Find generations (from): ") - (guix-read-date "Find generations (to): ") - (and current-prefix-arg - (guix-profile-prompt)))) - (guix-get-show-generations profile 'time - (float-time from) - (float-time to))) - -;;;###autoload -(defun guix-edit (id-or-name) - "Edit (go to location of) package with ID-OR-NAME." - (interactive (list (guix-read-package-name))) - (let ((loc (guix-package-location id-or-name))) - (if loc - (guix-find-location loc) - (message "Couldn't find package location.")))) - -(provide 'guix) - -;;; guix.el ends here |