From ddb5b07e1e43c7b44877bae9d786dbb80ca95311 Mon Sep 17 00:00:00 2001 From: Yuchen Pei Date: Fri, 17 Jan 2025 09:48:03 +1100 Subject: [emacs] Adding buttons to infobox --- emacs/.emacs.d/lisp/my/my-gitlab.el | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'emacs/.emacs.d/lisp/my/my-gitlab.el') diff --git a/emacs/.emacs.d/lisp/my/my-gitlab.el b/emacs/.emacs.d/lisp/my/my-gitlab.el index ad7f0ed..27f3344 100644 --- a/emacs/.emacs.d/lisp/my/my-gitlab.el +++ b/emacs/.emacs.d/lisp/my/my-gitlab.el @@ -73,9 +73,19 @@ (string-match-p "^/[^/]+/[^/]+$" (url-filename urlobj))))) (require 'my-buffer) +(require 'my-web) +(require 'my-magit) +(defun my-gitlab-format-url (url) + (concat url + " -- " (buttonize "clone" + (lambda (_) + (my-magit-clone url current-prefix-arg))) + " " (buttonize "context" + (lambda (_) + (funcall my-url-context-function url))))) (defvar my-gitlab-project-info-specs - `((http_url_to_repo . "Clone") + `((http_url_to_repo . ("URL" . my-gitlab-format-url)) (name_with_namespace . "Name") (description . "Description") (created_at . ("Created at" . my-gitlab-format-time-string)) -- cgit v1.2.3