diff --git a/emacs/init.el b/emacs/init.el index 390b130..76e3391 100644 --- a/emacs/init.el +++ b/emacs/init.el @@ -757,17 +757,19 @@ Point must be at the beginning of balanced expression (sexp)." ;; The following snippet is a convenience function for git-commit to add the ticket number, if found ;; in the branch name, to the commit message. -(use-package git-commit - :hook - (git-commit-mode - . - (lambda () - (when-let ((branch (magit-get-current-branch))) - (when (string-match "\\(ticket\\|feature\\)-\\([[:digit]]\\{3,\\}\\)" branch) - (let ((prefix (format "[T-%s] \n" (match-string 2 branch)))) - (goto-char (point-min)) - (insert prefix) - (forward-char -1))))))) +(defun add-git-commit-ticket-id-from-branch () + "A git-commit-mode-hook which inserts the first consecutive + sequence of at least 3 digits in the current branch name at + the beginning of the commit message buffer (in square + brackets)." + (when-let ((branch (magit-get-current-branch))) + (when (string-match "\\([[:digit:]]\\{3,\\}\\)" branch) + (let ((prefix (format "[T-%s] \n" (match-string 1 branch)))) + (goto-char (point-min)) + (insert prefix) + (forward-char -1))))) + + (add-hook 'git-commit-mode-hook 'add-git-commit-ticket-id-from-branch) ;; Magit requires 'transient' >= 0.5.0, but due to bad defaults, Emacs' package manager refuses to ;; upgrade this and other built-in packages to higher releases from GNU Elpa. diff --git a/home.nix b/home.nix index b5fa7e5..02b82d9 100644 --- a/home.nix +++ b/home.nix @@ -21,6 +21,7 @@ args@{ config, pkgs, split-monitor-workspaces, flatpaks, ... }: freetype gcc ghostscript + gimp-with-plugins git-cola git-doc git-filter-repo @@ -31,6 +32,7 @@ args@{ config, pkgs, split-monitor-workspaces, flatpaks, ... }: iconv kteatime lagrange + libreoffice-qt6-fresh liquidprompt kdePackages.dolphin kdePackages.ksshaskpass