summaryrefslogtreecommitdiff
path: root/emacs
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2016-01-13 17:50:17 +0100
committerLudovic Courtès <ludo@gnu.org>2016-01-13 18:18:48 +0100
commit8c986ab12034d67db836a881f57c69754d8073ae (patch)
treebf5183011119695ac549d4cfff4dc2175e659397 /emacs
parent203795aceaabec0e0e5818e1650ad407d825d1b3 (diff)
parent7a2eed3aac1ecd0bdf293e33a234fad58f2e5f9e (diff)
Merge branch 'master' into core-updates
Diffstat (limited to 'emacs')
-rw-r--r--emacs/guix-command.el1
-rw-r--r--emacs/guix-emacs.el21
-rw-r--r--emacs/guix-init.el13
-rw-r--r--emacs/guix-main.scm1
-rw-r--r--emacs/guix-pcomplete.el7
-rw-r--r--emacs/guix-ui-package.el19
6 files changed, 43 insertions, 19 deletions
diff --git a/emacs/guix-command.el b/emacs/guix-command.el
index 9cb7032abc..cf72b0ea15 100644
--- a/emacs/guix-command.el
+++ b/emacs/guix-command.el
@@ -192,6 +192,7 @@ to be modified."
(guix-command-define-argument-improver
guix-command-improve-build-argument
'(("--no-grafts" :char ?g)
+ ("--file" :fun guix-read-file-name)
("--root" :fun guix-read-file-name)
("--sources" :char ?S :fun guix-read-source-type :switch? nil)
("--with-source" :fun guix-read-file-name)))
diff --git a/emacs/guix-emacs.el b/emacs/guix-emacs.el
index 2f809ed16e..37a0bb26d3 100644
--- a/emacs/guix-emacs.el
+++ b/emacs/guix-emacs.el
@@ -1,6 +1,6 @@
;;; guix-emacs.el --- Emacs packages installed with Guix
-;; Copyright © 2014 Alex Kost <alezost@gmail.com>
+;; Copyright © 2014, 2015, 2016 Alex Kost <alezost@gmail.com>
;; This file is part of GNU Guix.
@@ -24,8 +24,17 @@
;;; Code:
-(require 'guix-profiles)
(require 'cl-lib)
+(unless (require 'guix-profiles nil t)
+ (defvar guix-user-profile (expand-file-name "~/.guix-profile")))
+
+(defcustom guix-package-enable-at-startup t
+ "If non-nil, activate Emacs packages installed in a user profile.
+Set this variable to nil before requiring `guix-emacs' file to
+avoid loading autoloads of Emacs packages installed in
+`guix-user-profile'."
+ :type 'boolean
+ :group 'guix)
(defcustom guix-emacs-activate-after-operation t
"Activate Emacs packages after installing.
@@ -90,7 +99,9 @@ Return nil if there are no emacs packages installed in PROFILE."
"Load autoloads for Emacs packages installed in PROFILE.
If PROFILE is nil, use `guix-user-profile'.
Add autoloads directories to `load-path'."
- (interactive (list (guix-profile-prompt)))
+ (interactive (list (if (fboundp 'guix-profile-prompt)
+ (funcall 'guix-profile-prompt)
+ guix-user-profile)))
(let* ((autoloads (guix-emacs-find-autoloads profile))
(new-autoloads (cl-nset-difference autoloads
guix-emacs-autoloads
@@ -114,6 +125,10 @@ See `guix-emacs-activate-after-operation' for details."
;; profile will not be loaded).
(guix-emacs-load-autoloads guix-current-profile)))
+(when guix-package-enable-at-startup
+ (add-to-list 'load-path (guix-emacs-directory))
+ (guix-emacs-load-autoloads))
+
(provide 'guix-emacs)
;;; guix-emacs.el ends here
diff --git a/emacs/guix-init.el b/emacs/guix-init.el
index 1da607034f..47ced6abaa 100644
--- a/emacs/guix-init.el
+++ b/emacs/guix-init.el
@@ -1,19 +1,6 @@
(require 'guix-autoloads)
(require 'guix-emacs)
-(defcustom guix-package-enable-at-startup t
- "If non-nil, activate Emacs packages installed in a user profile.
-Set this variable to nil before requiring `guix-init' file to
-avoid loading autoloads of Emacs packages installed in
-`guix-user-profile'."
- :type 'boolean
- :group 'guix)
-
-(add-to-list 'load-path (guix-emacs-directory))
-
-(when guix-package-enable-at-startup
- (guix-emacs-load-autoloads))
-
(add-hook 'scheme-mode-hook 'guix-devel-activate-mode-maybe)
(add-hook 'shell-mode-hook 'guix-build-log-minor-mode-activate-maybe)
diff --git a/emacs/guix-main.scm b/emacs/guix-main.scm
index 6f9eb422e0..8c38e7cae3 100644
--- a/emacs/guix-main.scm
+++ b/emacs/guix-main.scm
@@ -307,6 +307,7 @@ Example:
(description . ,package-description-string)
(home-url . ,package-home-page)
(outputs . ,package-outputs)
+ (systems . ,package-supported-systems)
(non-unique . ,(negate package-unique?))
(inputs . ,(lambda (pkg)
(package-inputs-names
diff --git a/emacs/guix-pcomplete.el b/emacs/guix-pcomplete.el
index 85b267a78d..785e54ef6d 100644
--- a/emacs/guix-pcomplete.el
+++ b/emacs/guix-pcomplete.el
@@ -262,7 +262,8 @@ INPUT is the current partially completed string."
(complete (guix-pcomplete-all-packages)))
((option? "-p" "--profile")
(complete* (pcomplete-dirs)))
- ((option? "-m" "--manifest")
+ ((or (option? "-f" "--install-from-file")
+ (option? "-m" "--manifest"))
(complete* (pcomplete-entries)))))
((and (command? "archive" "build" "size")
@@ -270,7 +271,9 @@ INPUT is the current partially completed string."
(complete* guix-help-system-types))
((and (command? "build")
- (option? "-r" "--root"))
+ (or (option? "-f" "--file")
+ (option? "-r" "--root")
+ (string= "--with-source" option)))
(complete* (pcomplete-entries)))
((and (command? "graph")
diff --git a/emacs/guix-ui-package.el b/emacs/guix-ui-package.el
index e0c98eaed6..12bfaeef68 100644
--- a/emacs/guix-ui-package.el
+++ b/emacs/guix-ui-package.el
@@ -221,11 +221,13 @@ ENTRIES is a list of package entries to get info about packages."
(location format (format guix-package-location))
(home-url format (format guix-url))
(license format (format guix-package-info-license))
+ (systems format guix-package-info-insert-systems)
(inputs format (format guix-package-input))
(native-inputs format (format guix-package-native-input))
(propagated-inputs format
(format guix-package-propagated-input)))
- :titles '((home-url . "Home page"))
+ :titles '((home-url . "Home page")
+ (systems . "Supported systems"))
:required '(id name version installed non-unique))
(guix-info-define-interface installed-output
@@ -363,6 +365,20 @@ formatted with this string, an action button is inserted.")
'guix-package-name
'face 'guix-package-info-heading))
+(defun guix-package-info-insert-systems (systems entry)
+ "Insert supported package SYSTEMS at point."
+ (guix-info-insert-value-format
+ systems 'guix-hydra-build-system
+ 'action (lambda (btn)
+ (let ((args (guix-hydra-build-latest-prompt-args
+ :job (button-get btn 'job-name)
+ :system (button-label btn))))
+ (apply #'guix-hydra-build-get-display
+ 'latest args)))
+ 'job-name (guix-package-name-specification
+ (guix-entry-value entry 'name)
+ (guix-entry-value entry 'version))))
+
(defmacro guix-package-info-define-insert-inputs (&optional type)
"Define a face and a function for inserting package inputs.
TYPE is a type of inputs.
@@ -749,6 +765,7 @@ for all ARGS."
(location format (format guix-package-location))
(home-url format (format guix-url))
(license format (format guix-package-info-license))
+ (systems format guix-package-info-insert-systems)
(inputs format (format guix-package-input))
(native-inputs format (format guix-package-native-input))
(propagated-inputs format