[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
02/07: emacs: Add license definition button to License Info buffer.
From: |
Alex Kost |
Subject: |
02/07: emacs: Add license definition button to License Info buffer. |
Date: |
Tue, 26 Apr 2016 09:47:27 +0000 |
alezost pushed a commit to branch master
in repository guix.
commit 57748c27565117b3ad10c7fce67c36ecf5e5d5c7
Author: Alex Kost <address@hidden>
Date: Fri Apr 8 11:51:54 2016 +0300
emacs: Add license definition button to License Info buffer.
* 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)))
+
;;; License 'list'
- branch master updated (f674439 -> 82f4414), Alex Kost, 2016/04/26
- 02/07: emacs: Add license definition button to License Info buffer.,
Alex Kost <=
- 06/07: gnu: git-modes: Update to 1.2.2., Alex Kost, 2016/04/26
- 05/07: gnu: emacs-with-editor: Update to 2.5.1., Alex Kost, 2016/04/26
- 04/07: gnu: magit: Update to 2.6.1., Alex Kost, 2016/04/26
- 07/07: gnu: manaplus: Update to 1.6.4.23., Alex Kost, 2016/04/26
- 03/07: emacs: Add "edit" command to a list of licenses., Alex Kost, 2016/04/26
- 01/07: emacs: Add 'guix-find-license-definition' command., Alex Kost, 2016/04/26