Magit: improve def* search in commit msg builder

This commit is contained in:
TEC 2024-03-08 17:14:45 +08:00
parent ecdaa0b25f
commit 1ae52868fd
Signed by: tec
SSH Key Fingerprint: SHA256:eobz41Mnm0/iYWBvWThftS0ElEs1ftBr6jamutnXc/A
1 changed files with 2 additions and 2 deletions

View File

@ -3820,8 +3820,8 @@ follow [[https://orgmode.org/worg/org-contribute.html#commit-messages][a certain
(cond
((string-match-p "\\.el$" last-file)
(when (re-search-backward "^\\(?:[+-]? *\\|@@[ +-\\d,]+@@ \\)(\\(?:cl-\\)?\\(?:defun\\|defvar\\|defmacro\\|defcustom\\)" temp-point t)
(re-search-forward "\\(?:cl-\\)?\\(?:defun\\|defvar\\|defmacro\\|defcustom\\) " nil t)
(add-to-list 'file-changes (buffer-substring-no-properties (point) (forward-symbol 1)))))
(re-search-forward "\\(?:cl-\\)?\\(?:defun\\|defvar\\|defmacro\\|defcustom\\) \\([^[:space:]\n]+\\)" nil t)
(add-to-list 'file-changes (match-string 1))))
((string-match-p "\\.org$" last-file)
(when (re-search-backward "^[+-]\\*+ \\|^@@[ +-\\d,]+@@ \\*+ " temp-point t)
(re-search-forward "@@ \\*+ " nil t)