[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
04/09: emacs: Display message if license not found.
From: |
Alex Kost |
Subject: |
04/09: emacs: Display message if license not found. |
Date: |
Mon, 18 Apr 2016 07:13:37 +0000 |
alezost pushed a commit to branch master
in repository guix.
commit 8934c3b60f2d8438dca0e513b286e11cd2adb096
Author: Alex Kost <address@hidden>
Date: Fri Apr 15 21:43:13 2016 +0300
emacs: Display message if license not found.
* emacs/guix-ui-license.el (guix-license-message): New procedure.
(guix-license-info-message-function): Use it.
(guix-license-list-message-function): Likewise.
---
emacs/guix-ui-license.el | 11 +++++++++++
1 files changed, 11 insertions(+), 0 deletions(-)
diff --git a/emacs/guix-ui-license.el b/emacs/guix-ui-license.el
index c5e642f..ab1d25b 100644
--- a/emacs/guix-ui-license.el
+++ b/emacs/guix-ui-license.el
@@ -44,12 +44,22 @@ SEARCH-TYPE may be one of the following symbols: `all',
`id', `name'."
(apply #'guix-list-get-display-entries
'license search-type args))
+(defun guix-license-message (entries search-type &rest args)
+ "Display a message after showing license ENTRIES."
+ ;; Some objects in (guix licenses) module are procedures (e.g.,
+ ;; 'non-copyleft' or 'x11-style'). Such licenses cannot be "described".
+ (when (null entries)
+ (if (cdr args)
+ (message "Unknown licenses.")
+ (message "Unknown license."))))
+
;;; License 'info'
(guix-info-define-interface license
:buffer-name "*Guix License Info*"
:get-entries-function 'guix-license-get-entries
+ :message-function 'guix-license-message
:format '((name ignore (simple guix-info-heading))
ignore
guix-license-insert-packages-button
@@ -86,6 +96,7 @@ SEARCH-TYPE may be one of the following symbols: `all', `id',
`name'."
:buffer-name "*Guix Licenses*"
:get-entries-function 'guix-license-get-entries
:describe-function 'guix-license-list-describe
+ :message-function 'guix-license-message
:format '((name nil 40 t)
(url guix-list-get-url 50 t))
:titles '((name . "License"))
- branch master updated (9bb46c1 -> a7c6178), Alex Kost, 2016/04/18
- 05/09: emacs: Make 'guix-find-location' interactive., Alex Kost, 2016/04/18
- 03/09: emacs: Separate package license code., Alex Kost, 2016/04/18
- 09/09: emacs: Display license info on button press in Package Info buffer., Alex Kost, 2016/04/18
- 01/09: emacs: Add 'guix-packages-by-location' command., Alex Kost, 2016/04/18
- 06/09: doc: emacs: Add "Package Source Locations" section., Alex Kost, 2016/04/18
- 08/09: emacs: Add location "Packages" button to Package Info buffer., Alex Kost, 2016/04/18
- 07/09: emacs: Add interface for package locations., Alex Kost, 2016/04/18
- 02/09: emacs: Separate package location code., Alex Kost, 2016/04/18
- 04/09: emacs: Display message if license not found.,
Alex Kost <=