all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Alex Kost <alezost@gmail.com>
To: guix-devel@gnu.org
Subject: [PATCH 6/6] emacs: Add license/location "Packages" buttons to Info buffer.
Date: Mon,  4 Apr 2016 22:47:46 +0300	[thread overview]
Message-ID: <1459799266-7426-7-git-send-email-alezost@gmail.com> (raw)
In-Reply-To: <1459799266-7426-1-git-send-email-alezost@gmail.com>

* emacs/guix-ui-package.el (guix-package-info-insert-location)
(guix-package-info-insert-license): New procedures.
(guix-package-info-format): Use them.
(guix-output-info-format): Likewise.
---
 emacs/guix-ui-package.el | 40 ++++++++++++++++++++++++++++++++++++----
 1 file changed, 36 insertions(+), 4 deletions(-)

diff --git a/emacs/guix-ui-package.el b/emacs/guix-ui-package.el
index aba30ab..e6f836d 100644
--- a/emacs/guix-ui-package.el
+++ b/emacs/guix-ui-package.el
@@ -223,9 +223,9 @@ ENTRIES is a list of package entries to get info about packages."
             ignore
             (outputs simple guix-package-info-insert-outputs)
             (source simple guix-package-info-insert-source)
-            (location format (format guix-package-location))
+            (location simple guix-package-info-insert-location)
+            (license simple guix-package-info-insert-license)
             (home-url format (format guix-url))
-            (license format (format guix-package-license))
             (systems format guix-package-info-insert-systems)
             (inputs format (format guix-package-input))
             (native-inputs format (format guix-package-native-input))
@@ -383,6 +383,38 @@ formatted with this string, an action button is inserted.")
    'guix-package-heading
    'spec (guix-package-entry->name-specification entry)))
 
+(defun guix-package-info-insert-location (location &optional _)
+  "Insert package LOCATION at point."
+  (if (null location)
+      (guix-format-insert nil)
+    (let ((location-file (car (split-string location ":"))))
+      (guix-info-insert-value-indent location 'guix-package-location)
+      (guix-info-insert-indent)
+      (guix-info-insert-action-button
+       "Packages"
+       (lambda (btn)
+         (guix-package-get-display (guix-ui-current-profile)
+                                   'location
+                                   (button-get btn 'location)))
+       (concat "Show packages from location: " location-file)
+       'location location-file))))
+
+(defun guix-package-info-insert-license (licenses &optional _)
+  "Insert package LICENSES at point."
+  (if (null licenses)
+      (guix-format-insert nil)
+    (dolist (license licenses)
+      (guix-info-insert-value-indent license 'guix-package-license)
+      (guix-info-insert-indent)
+      (guix-info-insert-action-button
+       "Packages"
+       (lambda (btn)
+         (guix-package-get-display (guix-ui-current-profile)
+                                   'license
+                                   (button-get btn 'license)))
+       (concat "Show packages with license: " license)
+       'license license))))
+
 (defun guix-package-info-insert-systems (systems entry)
   "Insert supported package SYSTEMS at point."
   (guix-info-insert-value-format
@@ -798,9 +830,9 @@ for all ARGS."
             (source simple guix-package-info-insert-source)
             (path simple (indent guix-file))
             (dependencies simple (indent guix-file))
-            (location format (format guix-package-location))
+            (location simple guix-package-info-insert-location)
+            (license simple guix-package-info-insert-license)
             (home-url format (format guix-url))
-            (license format (format guix-package-license))
             (systems format guix-package-info-insert-systems)
             (inputs format (format guix-package-input))
             (native-inputs format (format guix-package-native-input))
-- 
2.7.3

  parent reply	other threads:[~2016-04-04 19:48 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-04 19:47 [PATCH 0/6] emacs: Add interface for package locations Alex Kost
2016-04-04 19:47 ` [PATCH 1/6] emacs: Add 'guix-packages-by-location' command Alex Kost
2016-04-05 20:38   ` Ludovic Courtès
2016-04-06  9:20     ` Alex Kost
2016-04-15 22:23       ` Ludovic Courtès
2016-04-17  7:29         ` Alex Kost
2016-04-17 15:40           ` Ludovic Courtès
2016-04-18  7:18             ` Alex Kost
2016-04-04 19:47 ` [PATCH 2/6] emacs: Separate package location code Alex Kost
2016-04-05 20:39   ` Ludovic Courtès
2016-04-04 19:47 ` [PATCH 3/6] emacs: Make 'guix-find-location' interactive Alex Kost
2016-04-05 20:41   ` Ludovic Courtès
2016-04-04 19:47 ` [PATCH 4/6] doc: emacs: Add "Locations" section Alex Kost
2016-04-05 20:46   ` Ludovic Courtès
2016-04-06  9:24     ` Alex Kost
2016-04-04 19:47 ` [PATCH 5/6] emacs: Add interface for package locations Alex Kost
2016-04-05 20:50   ` Ludovic Courtès
2016-04-06  9:23     ` Alex Kost
2016-04-15 22:26       ` Ludovic Courtès
2016-04-04 19:47 ` Alex Kost [this message]
2016-04-05 20:50   ` [PATCH 6/6] emacs: Add license/location "Packages" buttons to Info buffer Ludovic Courtès
2016-04-08  8:40     ` Alex Kost
2016-04-09 14:52       ` Ludovic Courtès
2016-04-05 20:25 ` [PATCH 0/6] emacs: Add interface for package locations Ludovic Courtès

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1459799266-7426-7-git-send-email-alezost@gmail.com \
    --to=alezost@gmail.com \
    --cc=guix-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.