update packages
This commit is contained in:
@@ -247,7 +247,7 @@ See also manpage git-interpret-trailer(1). This package does
|
||||
not use that Git command, but the initial description still
|
||||
serves as a good introduction."
|
||||
:group 'git-commit
|
||||
:safe (##and (listp %) (seq-every-p #'stringp %))
|
||||
:safe (##and (listp %) (all #'stringp %))
|
||||
:type '(repeat string))
|
||||
|
||||
(defcustom git-commit-use-local-message-ring nil
|
||||
@@ -760,7 +760,7 @@ With a numeric prefix ARG, go back ARG messages."
|
||||
(when-let* ((message (git-commit-buffer-message))
|
||||
(_(not (ring-member log-edit-comment-ring message))))
|
||||
(ring-insert log-edit-comment-ring message)
|
||||
(cl-incf arg)
|
||||
(incf arg)
|
||||
(setq len (ring-length log-edit-comment-ring)))
|
||||
;; Delete the message but not the instructions at the end.
|
||||
(save-restriction
|
||||
@@ -1020,32 +1020,48 @@ completion candidates. The input must have the form \"NAME <EMAIL>\"."
|
||||
(git-commit--insert-trailer trailer (format "%s <%s>" name email)))
|
||||
|
||||
(defun git-commit--insert-trailer (trailer value)
|
||||
(git-commit--insert-trailer-1 (format "%s: %s\n" trailer value)))
|
||||
|
||||
(defun git-commit--insert-trailer-1 (string &optional before-trailers)
|
||||
(save-excursion
|
||||
(let ((string (format "%s: %s" trailer value))
|
||||
(leading-comment-end nil))
|
||||
;; Make sure we skip forward past any leading comments.
|
||||
(goto-char (point-min))
|
||||
(while (looking-at comment-start)
|
||||
(forward-line))
|
||||
(when (or (eobp) (looking-at "diff --git"))
|
||||
(goto-char (point-min))
|
||||
(while (looking-at comment-start)
|
||||
(forward-line))
|
||||
(setq leading-comment-end (point))
|
||||
(save-excursion (insert ?\n)))
|
||||
(let ((bound (and (not (or (bobp) (eobp))) (point))))
|
||||
(goto-char (point-max))
|
||||
(cond
|
||||
;; Look backwards for existing trailers.
|
||||
((re-search-backward (git-commit--trailer-regexp) nil t)
|
||||
(end-of-line)
|
||||
(insert ?\n string)
|
||||
(unless (= (char-after) ?\n)
|
||||
(insert ?\n)))
|
||||
;; Or place the new trailer right before the first non-leading
|
||||
;; comments.
|
||||
(t
|
||||
(while (re-search-backward (concat "^" comment-start)
|
||||
leading-comment-end t))
|
||||
(unless (looking-back "\n\n" nil)
|
||||
(insert ?\n))
|
||||
(insert string ?\n))))
|
||||
(unless (or (eobp) (= (char-after) ?\n))
|
||||
(insert ?\n))))
|
||||
(unless (or (bobp) (= (char-before) ?\n))
|
||||
(insert ?\n))
|
||||
(cond (before-trailers
|
||||
(git-commit--goto-insert-position bound)
|
||||
(while (re-search-backward (git-commit--trailer-regexp) nil t))
|
||||
(unless (looking-back "\n\n" nil)
|
||||
(insert ?\n)))
|
||||
((re-search-backward (git-commit--trailer-regexp) nil t)
|
||||
(goto-char (match-end 0))
|
||||
(if (eobp) (insert ?\n) (forward-char)))
|
||||
(t
|
||||
(git-commit--goto-insert-position bound)
|
||||
(unless (looking-back "\n\n" nil)
|
||||
(insert ?\n)))))
|
||||
(insert string)
|
||||
(unless (ignore-errors (= (char-before) ?\n)) (insert ?\n))
|
||||
(unless (ignore-errors (= (char-after) ?\n)) (insert ?\n))))
|
||||
|
||||
(defun git-commit--goto-insert-position (bound)
|
||||
(let ((match (point)))
|
||||
(cond ((re-search-backward (format "^%s -+ >8 -+" comment-start) nil t))
|
||||
((and (eobp) (bolp))
|
||||
(forward-line -1)))
|
||||
(while (and (or (looking-at comment-start)
|
||||
(looking-at "[\s\t]*$"))
|
||||
(or (not bound) (> (point) bound))
|
||||
(not (bobp)))
|
||||
(setq match (point))
|
||||
(forward-line -1))
|
||||
(goto-char match)))
|
||||
|
||||
;;; Font-Lock
|
||||
|
||||
@@ -1357,11 +1373,15 @@ commit, then the hook is not run at all."
|
||||
;; Local Variables:
|
||||
;; read-symbol-shorthands: (
|
||||
;; ("and$" . "cond-let--and$")
|
||||
;; ("and>" . "cond-let--and>")
|
||||
;; ("and-let" . "cond-let--and-let")
|
||||
;; ("if-let" . "cond-let--if-let")
|
||||
;; ("thread$" . "cond-let--thread$")
|
||||
;; ("when$" . "cond-let--when$")
|
||||
;; ("and-let*" . "cond-let--and-let*")
|
||||
;; ("and-let" . "cond-let--and-let")
|
||||
;; ("if-let*" . "cond-let--if-let*")
|
||||
;; ("if-let" . "cond-let--if-let")
|
||||
;; ("when-let*" . "cond-let--when-let*")
|
||||
;; ("when-let" . "cond-let--when-let")
|
||||
;; ("while-let*" . "cond-let--while-let*")
|
||||
;; ("while-let" . "cond-let--while-let")
|
||||
;; ("match-string" . "match-string")
|
||||
;; ("match-str" . "match-string-no-properties"))
|
||||
|
||||
Reference in New Issue
Block a user