Fix incorrect use of add-to-list

You can't use add-to-list with lexical variables, push should be used
instead with delete-dups later.
This commit is contained in:
TEC 2024-03-26 12:15:00 +08:00
parent bd8fc036bf
commit 8d3cad7e02
Signed by: tec
SSH Key Fingerprint: SHA256:eobz41Mnm0/iYWBvWThftS0ElEs1ftBr6jamutnXc/A
1 changed files with 3 additions and 2 deletions

View File

@ -3923,11 +3923,12 @@ follow [[https://orgmode.org/worg/org-contribute.html#commit-messages][a certain
((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\\) \\([^[:space:]\n]+\\)" nil t)
(add-to-list 'file-changes (match-string 1))))
(push (match-string 1) file-changes)))
((string-match-p "\\.org$" last-file)
(when (re-search-backward "^[+-]\\*+ \\|^@@[ +-\\d,]+@@ \\*+ " temp-point t)
(re-search-forward "@@ \\*+ " nil t)
(add-to-list 'file-changes (buffer-substring-no-properties (point) (line-end-position)))))))))
(push (buffer-substring-no-properties (point) (line-end-position)) file-changes)))))))
(setq file-changes (delete-dups file-changes))
(push (list last-file file-changes) change-data)
(setq change-data (delete '(nil nil) change-data))
(concat