From mboxrd@z Thu Jan 1 00:00:00 1970 From: Alex Kost Subject: [PATCH 4/7] emacs: Buttonize licenses in "Package Info". Date: Fri, 22 Jan 2016 11:19:32 +0300 Message-ID: <1453450775-594-5-git-send-email-alezost@gmail.com> References: <1453450775-594-1-git-send-email-alezost@gmail.com> Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:52783) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aMWws-0005Py-ET for guix-devel@gnu.org; Fri, 22 Jan 2016 03:20:03 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aMWwr-000738-5Y for guix-devel@gnu.org; Fri, 22 Jan 2016 03:20:02 -0500 Received: from mail-lb0-x244.google.com ([2a00:1450:4010:c04::244]:33009) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aMWwq-000733-Tx for guix-devel@gnu.org; Fri, 22 Jan 2016 03:20:01 -0500 Received: by mail-lb0-x244.google.com with SMTP id bc4so3187602lbc.0 for ; Fri, 22 Jan 2016 00:20:00 -0800 (PST) Received: from localhost.localdomain ([217.107.192.146]) by smtp.gmail.com with ESMTPSA id j71sm725356lfi.20.2016.01.22.00.19.59 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 22 Jan 2016 00:19:59 -0800 (PST) In-Reply-To: <1453450775-594-1-git-send-email-alezost@gmail.com> List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org To: guix-devel@gnu.org * 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