[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 6/7] emacs: list: Support displaying URL links.
From: |
Alex Kost |
Subject: |
[PATCH 6/7] emacs: list: Support displaying URL links. |
Date: |
Fri, 22 Jan 2016 11:19:34 +0300 |
* emacs/guix-list.el (guix-list-url): New face.
(guix-list-get-url): New procedure.
---
emacs/guix-list.el | 13 +++++++++++++
1 file changed, 13 insertions(+)
diff --git a/emacs/guix-list.el b/emacs/guix-list.el
index 51eb106..c91c67c 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
--
2.7.0
- [PATCH 0/7]: Add "M-x guix-licenses" and friends., Alex Kost, 2016/01/22
- [PATCH 4/7] emacs: Buttonize licenses in "Package Info"., Alex Kost, 2016/01/22
- [PATCH 5/7] emacs: Add 'guix-packages-by-license' command., Alex Kost, 2016/01/22
- [PATCH 1/7] emacs: Rename 'file-path' to 'file-name'., Alex Kost, 2016/01/22
- [PATCH 6/7] emacs: list: Support displaying URL links.,
Alex Kost <=
- [PATCH 7/7] emacs: Add interface for licenses., Alex Kost, 2016/01/22
- [PATCH 3/7] emacs: Add 'guix-browse-license-url' command., Alex Kost, 2016/01/22
- [PATCH 2/7] licenses: Add a list of licenses., Alex Kost, 2016/01/22