aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--emacs/.emacs.d/init/ycp-web.el2
-rw-r--r--emacs/.emacs.d/lisp/my/my-gitlab.el5
2 files changed, 7 insertions, 0 deletions
diff --git a/emacs/.emacs.d/init/ycp-web.el b/emacs/.emacs.d/init/ycp-web.el
index c50cc46..dd733dc 100644
--- a/emacs/.emacs.d/init/ycp-web.el
+++ b/emacs/.emacs.d/init/ycp-web.el
@@ -254,6 +254,8 @@
. ,(lambda (url &rest _) (exitter-open-post url)))
(my-hacker-news-url-p
. ,(lambda (url &rest _) (hnreader-comment url)))
+ (my-gitlab-project-url-p
+ . ,(lambda (url &rest _) (my-gitlab-project-infobox url)))
(my-mastodon-url-p
. ,(lambda (url &rest _) (mastorg-open url)))
(my-newscorp-au-url-p
diff --git a/emacs/.emacs.d/lisp/my/my-gitlab.el b/emacs/.emacs.d/lisp/my/my-gitlab.el
index 04d2ba0..ad7f0ed 100644
--- a/emacs/.emacs.d/lisp/my/my-gitlab.el
+++ b/emacs/.emacs.d/lisp/my/my-gitlab.el
@@ -67,6 +67,11 @@
(defun my-gitlab-format-time-string (t)
(format-time-string "%Y-%m-%d %M:%M:%S" (encode-time (parse-time-string t))))
+(defun my-gitlab-project-url-p (url)
+ (let ((urlobj (url-generic-parse-url url)))
+ (and (equal (url-host urlobj) "gitlab.com")
+ (string-match-p "^/[^/]+/[^/]+$" (url-filename urlobj)))))
+
(require 'my-buffer)
(defvar my-gitlab-project-info-specs