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 4/7] emacs: Buttonize licenses in "Package Info".
Date: Fri, 22 Jan 2016 11:19:32 +0300	[thread overview]
Message-ID: <1453450775-594-5-git-send-email-alezost@gmail.com> (raw)
In-Reply-To: <1453450775-594-1-git-send-email-alezost@gmail.com>

* emacs/guix-ui-package.el (guix-package-license): New button type.
  (guix-package-info-format, guix-output-info-format): Use it.
* doc/emacs.texi (Emacs Info buffer): Mention it.
---
 doc/emacs.texi           |  1 +
 emacs/guix-ui-package.el | 12 ++++++++++--
 2 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/doc/emacs.texi b/doc/emacs.texi
index eb470ab..d321a89 100644
--- a/doc/emacs.texi
+++ b/doc/emacs.texi
@@ -355,6 +355,7 @@ emacs, The GNU Emacs Manual}) which can be used to:
 @item install/remove a package;
 @item jump to a package location;
 @item browse home page of a package;
+@item browse license URL;
 @item describe packages from ``Inputs'' fields.
 @end itemize
 
diff --git a/emacs/guix-ui-package.el b/emacs/guix-ui-package.el
index 2951452..655ed74 100644
--- a/emacs/guix-ui-package.el
+++ b/emacs/guix-ui-package.el
@@ -35,6 +35,7 @@
 (require 'guix-entry)
 (require 'guix-utils)
 (require 'guix-hydra-build)
+(require 'guix-license)
 
 (guix-ui-define-entry-type package)
 (guix-ui-define-entry-type output)
@@ -220,7 +221,7 @@ ENTRIES is a list of package entries to get info about packages."
             (source simple guix-package-info-insert-source)
             (location format (format guix-package-location))
             (home-url format (format guix-url))
-            (license format (format guix-package-info-license))
+            (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))
@@ -338,6 +339,13 @@ formatted with this string, an action button is inserted.")
   'action (lambda (btn)
             (guix-find-location (button-label btn))))
 
+(define-button-type 'guix-package-license
+  :supertype 'guix
+  'face 'guix-package-info-license
+  'help-echo "Browse license URL"
+  'action (lambda (btn)
+            (guix-browse-license-url (button-label btn))))
+
 (define-button-type 'guix-package-name
   :supertype 'guix
   'face 'guix-package-info-name-button
@@ -767,7 +775,7 @@ for all ARGS."
             (dependencies simple (indent guix-file))
             (location format (format guix-package-location))
             (home-url format (format guix-url))
-            (license format (format guix-package-info-license))
+            (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.0

  parent reply	other threads:[~2016-01-22  8:20 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-22  8:19 [PATCH 0/7]: Add "M-x guix-licenses" and friends Alex Kost
2016-01-22  8:19 ` [PATCH 1/7] emacs: Rename 'file-path' to 'file-name' Alex Kost
2016-01-23 17:06   ` Ludovic Courtès
2016-01-22  8:19 ` [PATCH 2/7] licenses: Add a list of licenses Alex Kost
2016-01-23 17:08   ` Ludovic Courtès
2016-01-23 22:37     ` Alex Kost
2016-01-24 20:59       ` Ludovic Courtès
2016-01-22  8:19 ` [PATCH 3/7] emacs: Add 'guix-browse-license-url' command Alex Kost
2016-01-23 17:13   ` Ludovic Courtès
2016-01-25 19:18     ` Alex Kost
2016-01-23 17:18   ` Ludovic Courtès
2016-01-23 22:49     ` Alex Kost
2016-01-24 21:00       ` Ludovic Courtès
2016-01-22  8:19 ` Alex Kost [this message]
2016-01-23 17:14   ` [PATCH 4/7] emacs: Buttonize licenses in "Package Info" Ludovic Courtès
2016-01-22  8:19 ` [PATCH 5/7] emacs: Add 'guix-packages-by-license' command Alex Kost
2016-01-23 17:15   ` Ludovic Courtès
2016-01-22  8:19 ` [PATCH 6/7] emacs: list: Support displaying URL links Alex Kost
2016-01-23 17:15   ` Ludovic Courtès
2016-01-22  8:19 ` [PATCH 7/7] emacs: Add interface for licenses Alex Kost
2016-01-23 17:17   ` 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=1453450775-594-5-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.