aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Kost <alezost@gmail.com>2016-01-21 11:00:59 +0300
committerAlex Kost <alezost@gmail.com>2016-01-25 22:11:47 +0300
commit6dd460c8565882a9ef3f76cc259bbfe1a9342b6e (patch)
treef40eaae544d7bf68c40db6ca25e93f1be863475e
parent83aab70b2d4d11fa345c1fbf2ccdbec8b7ad6662 (diff)
downloadguix-6dd460c8565882a9ef3f76cc259bbfe1a9342b6e.tar
guix-6dd460c8565882a9ef3f76cc259bbfe1a9342b6e.tar.gz
emacs: list: Support displaying URL links.
* emacs/guix-list.el (guix-list-url): New face. (guix-list-get-url): New procedure.
-rw-r--r--emacs/guix-list.el13
1 files changed, 13 insertions, 0 deletions
diff --git a/emacs/guix-list.el b/emacs/guix-list.el
index 51eb106d82..c91c67cb29 100644
--- a/emacs/guix-list.el
+++ b/emacs/guix-list.el
@@ -38,6 +38,11 @@
"Face used for file names."
:group 'guix-list-faces)
+(defface guix-list-url
+ '((t :inherit guix-info-url))
+ "Face used for URLs."
+ :group 'guix-list-faces)
+
(defface guix-list-time
'((t :inherit guix-info-time))
"Face used for time stamps."
@@ -222,6 +227,14 @@ VAL may be nil."
'follow-link t
'help-echo "Find file"))
+(defun guix-list-get-url (url &optional _)
+ "Return URL button specification for `tabulated-list-entries'."
+ (list url
+ 'face 'guix-list-url
+ 'action (lambda (btn) (browse-url (button-label btn)))
+ 'follow-link t
+ 'help-echo "Browse URL"))
+
;;; 'List' lines