Add customizations for the bug-reference package

This commit is contained in:
Gergely Polonkai 2019-09-09 17:46:43 +02:00
parent cf9dd26378
commit a3362e7bbe

View File

@ -2464,6 +2464,51 @@ A big help during refactoring.
(use-package hl-todo)
#+END_SRC
** Bug and patch links
#+BEGIN_SRC emacs-lisp
(defvar gpolonkai/bug-reference-url-bug-string "issues"
"String to insert in a `bug-reference-url-format' for bug references.")
(put 'gpolonkai/bug-reference-url-bug-string 'safe-local-variable 'stringp)
(defvar gpolonkai/bug-reference-url-patch-string "merge_requests"
"String to insert in a `bug-reference-url-format' for patch references.")
(defvar-local bug-reference-host "gitlab.com"
"The hostname to use in `bug-reference-url-format'.")
(defvar-local bug-reference-group "gamesystems"
"The group name or username to use in `bug-reference-url-format'.")
(defvar-local bug-reference-repository "game-app"
"The repository name to use in `bug-reference-url-format'.")
(put 'gpolonkai/bug-reference-url-patch-string 'safe-local-variable 'stringp)
(defun gpolonkai/bug-reference-url ()
"Return a GitLab issue or Merge Request URL.
Intended as a value for `bug-referecne-url-format'."
(format "https://%s/%s/%s/%s/%s"
bug-reference-host
bug-reference-group
bug-reference-repository
(if (string-suffix-p "!" (match-string-no-properties 1))
gpolonkai/bug-reference-url-patch-string
gpolonkai/bug-reference-url-bug-string)
(match-string-no-properties 2))
)
(use-package bug-reference
:custom
(bug-reference-bug-regexp (rx (group (in ?! ?#))
(group (+ digit))))
(bug-reference-url-format #'my-gitlab-url)
:hook
(text-mode . bug-reference-mode)
(prog-mode . bug-reference-prog-mode))
#+END_SRC
* Python related setup and ~use-package~ calls
Because, well, thats my job now. Of course it gets a dedicated section.