unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Alex Kost <alezost@gmail.com>
To: guix-devel@gnu.org
Subject: [PATCH 2/3] emacs: Add license definition button to License Info buffer.
Date: Mon, 18 Apr 2016 11:17:54 +0300	[thread overview]
Message-ID: <1460967475-3771-3-git-send-email-alezost@gmail.com> (raw)
In-Reply-To: <1460967475-3771-1-git-send-email-alezost@gmail.com>

* emacs/guix-ui-license.el (guix-license-insert-file): New procedure.
(guix-license-info-format): Use it.
---
 emacs/guix-ui-license.el | 15 ++++++++++++++-
 1 file changed, 14 insertions(+), 1 deletion(-)

diff --git a/emacs/guix-ui-license.el b/emacs/guix-ui-license.el
index ab1d25b..772a168 100644
--- a/emacs/guix-ui-license.el
+++ b/emacs/guix-ui-license.el
@@ -29,6 +29,7 @@
 (require 'guix-info)
 (require 'guix-backend)
 (require 'guix-guile)
+(require 'guix-license)
 
 (guix-define-entry-type license)
 
@@ -64,7 +65,9 @@ SEARCH-TYPE may be one of the following symbols: `all', `id', `name'."
             ignore
             guix-license-insert-packages-button
             (url ignore (simple guix-url))
-            guix-license-insert-comment)
+            guix-license-insert-comment
+            ignore
+            guix-license-insert-file)
   :titles '((url . "URL")))
 
 (declare-function guix-packages-by-license "guix-ui-package")
@@ -89,6 +92,16 @@ SEARCH-TYPE may be one of the following symbols: `all', `id', `name'."
        (guix-info-param-title 'license 'comment))
       (guix-info-insert-value-indent comment))))
 
+(defun guix-license-insert-file (entry)
+  "Insert button to open license definition."
+  (let ((license (guix-entry-value entry 'name)))
+    (guix-insert-button
+     (guix-license-file) 'guix-file
+     'help-echo (format "Open definition of license '%s'" license)
+     'action (lambda (btn)
+               (guix-find-license-definition (button-get btn 'license)))
+     'license license)))
+
 \f
 ;;; License 'list'
 
-- 
2.7.3

  parent reply	other threads:[~2016-04-18  8:18 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-18  8:17 [PATCH 0/3] emacs: Add possibilities to move to license definition Alex Kost
2016-04-18  8:17 ` [PATCH 1/3] emacs: Add 'guix-find-license-definition' command Alex Kost
2016-04-25 21:46   ` Ludovic Courtès
2016-04-18  8:17 ` Alex Kost [this message]
2016-04-25 21:46   ` [PATCH 2/3] emacs: Add license definition button to License Info buffer Ludovic Courtès
2016-04-18  8:17 ` [PATCH 3/3] emacs: Add "edit" command to a list of licenses Alex Kost
2016-04-25 21:47   ` Ludovic Courtès
2016-04-26  9:48     ` Alex Kost
2016-04-25 21:45 ` [PATCH 0/3] emacs: Add possibilities to move to license definition Ludovic Courtès
2016-04-26  9:49   ` Alex Kost
2016-04-27 12:20     ` 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

  List information: https://guix.gnu.org/

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

  git send-email \
    --in-reply-to=1460967475-3771-3-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 public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).