Files
.emacs.d/modules/navigation/siren-git-link.el
Jim Myhrberg fe6a4e7ce5 fix(elisp): add lexical-binding comment to all files to suppress new Emacs 31 warnings
I've set `lexical-binding` to `nil` in all Emacs Lisp files to suppress
the warnings introduced in Emacs 31 requiring all elisp files to have a
`lexical-binding` comment.

This retains the default behavior of dynamic binding when no
`lexical-binding` comment is present. With it set to `t` across the
board, various things break, and fixing those is a task for another day.
2025-06-29 12:23:03 +01:00

49 lines
1.7 KiB
EmacsLisp

;;; siren-git-link.el --- jimeh's Emacs Siren: git-link configuration. -*- lexical-binding: nil; -*-
;;; Commentary:
;; Basic configuration for git-link.
;;; Code:
(use-package git-link
:general
("C-c g" 'git-link)
:custom
(git-link-open-in-browser t)
:config
;; Add custom handlers relevant only for machine with hostname "UAC00013".
(when (string-prefix-p "UAC00013" (system-name))
(defun git-link-uac00013-bitbucket (hostname
dirname filename
branch commit
start end)
(format "https://%s/projects/%srepos/%s/browse/%s"
"bitbucket.il2management.local"
(upcase (file-name-directory dirname))
(file-name-nondirectory dirname)
(concat filename
(unless (string= (or branch commit) "master")
(format "?at=%s" (or branch commit)))
(when start
(concat "#"
(if end (format "%s-%s" start end)
(format "%s" start)))))))
(defun git-link-commit-uac00013-bitbucket (hostname dirname commit)
(format "https://%s/projects/%srepos/%s/commits/%s"
"bitbucket.il2management.local"
(upcase (file-name-directory dirname))
(file-name-nondirectory dirname)
commit))
(add-to-list 'git-link-remote-alist
'("git" git-link-uac00013-bitbucket) t)
(add-to-list 'git-link-commit-remote-alist
'("git" git-link-commit-uac00013-bitbucket) t)))
(provide 'siren-git-link)
;;; siren-git-link.el ends here